Professional Documents
Culture Documents
VMS Complete Document - Ravi Anand
VMS Complete Document - Ravi Anand
com
The Vehicle Management System (VMS) is an application for the Automotive industry. It
supports, in the area of Sales & Services, the business processes that you require as vehicle
importer when dealing with your original equipment manufacturers (OEMs) and your dealers
in new and used vehicle sales. VMS offers you complete integration of all the relevant
processes such as procurement, sales, rework, returns processing, trade-in and service
processing. It also supports the archiving of vehicle data. In other words, it allows you to react
flexibly to customers’ requirements in the area of production (using the “pull strategy”) and
fast delivery times with reduced warehouse stock and sales/distribution costs.
For the vehicle importer, VMS serves as a central tool for managing, procuring,
sales/distribution and tracking of vehicles. Your dealers use it as a workplace for
configuration, searching, purchasing and tracking of vehicles for your end customers. The
dealers can log in to your system remotely via Internet and access your data
The following graphic shows the use of VMS in vehicle procurement, vehicle sales and service.
VMS is completely integrated into the SAP application components MM, SD, CS and FI/CO.
You can call and execute actions for a vehicle easily and quickly from VMS. By an action we
mean a business function that affects the procurement of a vehicle at the manufacturer by
the importer or the sale of the vehicle to the dealer. Examples are: create or change vehicle,
create purchase order (at manufacturer), create sales order/delivery/outgoing invoice (for
dealer) and post goods receipt/goods issue.
A large part of the actions delivered by SAP are based on the SAP standard transactions: they
are delivered in a separate and easy-to-use interface but with the complete functionality. The
posting documents that are created by these actions are also SAP standard posting
documents that are stored in the application components MM, SD, CS or FI/CO in the SAP
system.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
Apart from these general business actions, there are also Special VMS Actions, for example,
actions for making reservations, actions that hide or display vehicles for other dealers, actions
for changing vehicles, for setting a vehicle location or for assigning a sales campaign. You can
enhance the actions that are delivered to suit your own requirements or programme your
own actions. The action concept is on a modular basis and flexible so that you can adjust it at
any time to suit changes in your business processes.
The typical scenario when using VMS revolves around the procurement and sale of new
vehicles. As importer, you procure vehicles from one or more manufacturers and sell them to
your dealers or directly to large end customers, for example, rent-a-car companies. This
process is supported by VMS in both directions: ·
Pull strategy: the requirement/sale can trigger procurement (MTO = Make-to-Order, make-
to-order production) ·
Push strategy: procurement can come before sales (MTS = Make-to-Stock, make-to-stock
production).
The technical and business integration of all processes and business partners in VMS allows
you to shorten delivery times and – in the case of MTO – consider customer requirements
and therefore increase customer satisfaction.
Process Flow
1. The end customer would like to purchase a vehicle with specific features and approaches
one of your dealers.
2. The dealer searches your stock using the Internet to see if an appropriate vehicle exists.
3. If yes, the dealer enters additional characteristics for the vehicle, which are then installed
later in the course of local rework activities (for example, installing a radio, dog grate,
telephone, different tyres etc.). He/she then determines the price for the desired
configuration and creates a sales order in your system for this vehicle (scenario: make-to-
stock production). If no, the dealer also creates a sales order, but not for an existing vehicle.
He/she creates a sales order for the customer’s dream car. The importer then creates a
purchase order for this vehicle at the manufacturer’s and thus triggers production (scenario:
make-to-order production).
4. Status updates per EDI from the manufacturer give you and the dealer up-to-date
information on the status of the vehicle, in other words, information on the progress in
production or delivery. The dealers have access to this information via Internet and can
forward the information directly to the end customers.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
5. VMS supports vehicle procurement and sales, including all the postings involved and
oversees the entire business process until the time when your dealer delivers the desired car
to the end customer. The following graphic displays which documents are exchanged via VMS
between OEM, dealer and importer during vehicle procurement, vehicle sales and service.
The dealer have access to SAP system via some URL, They can access data and create Sales
Order Etc.
OEM is original Manufacturer where vehicle manufactured. So the process for make to Stock
would be
1. Through ECC system Exa. US , one PO will be created for OEM for Exa. Japan.
2. OEM will confirm the order.
3. Status of the order get change.
4. They will deliver the Vehicle to ECC means US.
5. Good Receipt and Invoice will be processed.
6. At the Dealer level, They will create a Sales Order for Vehicle in US region.
7. Product will be deliver to End client, Than Good Issue , Invoice and Payment will take
place.
A vehicle is a business object (BUS1200) in the SAP system. A vehicle is the result of using
a create action in VMS to create a vehicle for a vehicle model. It is therefore, an instance
of a vehicle model, in other words, an individual object. A configuration is always created
for a vehicle; the characteristics in the configuration may have not yet had any values
assigned to them, partly have had values assigned or have had all values assigned. You
can identify the vehicle by its vehicle number and define it further using a batch, valuation
type and, where appropriate, an equipment number.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
When you create a vehicle it receives an internal vehicle number. This number is the also
the batch number and the valuation type number. Each vehicle, therefore, has its own
batch and valuation type. You can display valuated stock using transaction MMBE Stock
Overview .
Vehicle Model : Basic type of a vehicle that can be varied. Vehicle models are
created as configurable materials in the SAP system. A vehicle model can be a general
vehicle type or a vehicle type for which specific characteristic values have been predefined
using object dependencies.
The vehicle data is the result of actions that have been performed for a vehicle. The data
is enhanced and updated continuously. Example: the following data is entered and
determined on creating a vehicle: internal vehicle number, plant, vehicle model,
configuration, primary action control, primary status, availability status, gross list price
and, where appropriate, production date and vendor. When the purchase order is
created, this data is completed with entries for the vendor and the location.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
Every vehicle model that is managed with VMS is described by a configurable material and
the appropriate class. Before you can work with VMS, you must first maintain
characteristics, classes, variant conditions, object dependencies and material master
records.
The master data that you require belongs to the following SAP applications: ·
Material Master Record ·
Classification System ·
Variant Configuration ·
Pricing (SD and MM) ·
Business Partner Administration
Vehicle models are created in the SAP ECC system as configurable materials (material type
VEHI = configurable vehicle).
Classes with characteristics are assigned to the materials. A vehicle model can be a general
vehicle type or a vehicle type for which specific characteristic values have been predefined
using object dependencies.
Every vehicle model that is managed with VMS is described by a configurable material and
the appropriate class. Before you can work with VMS you must have created material
master records for the vehicle models.
One item category is basically used in the sales order. Item category determination is
controlled by the sales document type and the item category group. You can find the item
category group in the material master record for the view Sales and Distribution: Sales
Organization 2 .
Item category group VMS0 ( Vehicle VMS ) is delivered for VMS as standard, which links
to the special VMS item category VTAC that is also delivered as standard. Item category
VTAC differs from the standard item category TAC by billing relevance “B”. VTAC can be
billed related to the order, in other words, the billing document can be created as soon as
the sales order has been created.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
1. Gross listed price Action CREA-> Create Vehicle Without discount. Std Pricing
Procedure RVAA01.
2. ORD1->ME01(Create PO->MEK1) or CUOR->SD Price (Create Sales Order ->VK11).
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
Now you have defined the Material Basic price for MM and SD. Next go to CT04.
Basic Price of the material will be for all the mentioned Char. -> Need to check.
Next Role and Authorization.
3. Configuration Role : Depending on the vehicle model, status and so on, the
configuration role specifies which vehicle characteristics the system should make
visible for the user and which changes the user is allowed to make to the vehicle
characteristics
Activity
1. Assign vehicle models to the vehicle model roles (transaction VELORM).
changed in the SAP Internet Pricing and Configurator (SAP IPC) and which cannot. For
example, when you create a sales order or change a purchase order etc., characteristics that
can no longer be changes can either be displayed or rendered invisible to the user.
Procedure :
1. In transaction VELOP, create a configuration change profile for every combination of
characteristics that can be changed and under Define Visibility of Characteristics ,
define which configuration characteristics you want to be visible but not changeable
and which you do not want to be visible. To do this, you must know the configuration
characteristics for the vehicle models for which you want to create the configuration
change profile.
Define when you want the profile to be used under Define Determination of Profile .
Determination can be dependent on the following parameters:
1. Configuration role
2. Vehicle model
3. Availability status
4. Primary action control
5. Primary status
6. Secondary action control
7. Secondary status
When you create and configure a vehicle, VMS calculates the gross list price from the basic
price of the vehicle model and the prices for the individual characteristics. The system
automatically adjusts the gross list price when changes are made to the configuration. This
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
gross list price is independent of customers to which the vehicle is sold or has been sold and
does not contain any discounts. It is, therefore, not the price for which you sell the vehicle to
the dealer.
The system simulates a sales order when it calculates the gross list price and it therefore
requires all the data that you have to enter when you create a sales order. It writes the price
that it calculates to the vehicle data as the gross list price.
Action Control
You can represent your business processes in the system with action controls. You define
which actions can follow one after the other when handling vehicles and which changes to
the status of the vehicle are involved in this.
You can distinguish between primary and secondary action controls, depending on the
process that is being represents by the action control. The primary action control usually
represents the procurement process, in other words, ordering the vehicle from the
manufacturer and the secondary action control the sales process.
Multiple combination can be defined, Its like access sequence in SD. Fields are Plant, Pur. Org
Vendor Etc.
You don not have to enter a value in all the key fields. A key field that is empty means that
the entry is valid for all values that are possible for this field.
Determination of the action control works as follows:
1. In Customizing, the system checks whether the action that you want to perform is a
primary action, a secondary action or both.
2. The system checks whether the appropriate action controls have already been assigned to
the vehicle. If yes, it uses these. The assignment of an action control to a vehicle cannot be
changed.
3. If no, the system triggers the action control and evaluates the entries in the table for
transaction VELOS. This takes place on the basis of the action data and the existing vehicle
data. The system makes checks in the following order:
a. Is there a fitting entry in the table for transaction VELOS? If yes, the system uses
this entry.
b. If no: is there a generic entry that fits, in other words, an entry for which fields are
empty and therefore all existing values can be taken? If yes, the system uses this entry.
If there is no generic entry or more than one suitable one and if the action controls in
the entries are not identical, the system displays an error message.
As soon as the system has found the correct action control, determination is ended.
The system performs the desired action and sets the status that is stored in the system
as new status for this action in the action control. If the system does not find a suitable
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
action control, it displays an error message and you have to correct the entries in
transaction VELOS appropriately.
Vehicle IDOC.
The vehicle IDoc VEHCLE01 is part of VMS. It serves to transfer vehicle data between
manufacturer and importer or between different sales organizations. It can be an
inbound or an outbound IDoc.
The Vehicle Manager (transaction VELO) is the central transaction of the Vehicle
Management System and contains all the most important functions in a concise form.
Configuration Scenario.
Process Flow
Make-to-Stock-Scenario (MTS)
1. The vehicle configuration is at the beginning of the MTS scenario.
2. As soon as the purchase order is created at the manufacturer, the configuration for
the purchase order becomes the vehicle configuration.
3. As soon as a subcontracting purchase order is created for rework, the additional
rework characteristics are copied to the vehicle configuration. If no rework is required,
the purchase order configuration and the sales order configuration are the same.
4. At the end, the vehicle configuration shows what the vehicle really looks like.
Make-to-Order-Scenario (MTO)
1. The vehicle configuration is at the beginning of the MTO scenario.
2. As soon as the dealer creates the sales order, the configuration for the sales order
becomes the vehicle configuration.
3. As soon as the purchase order is created, its configuration is copied to the vehicle
configuration.
Creating a Vehicle.
Procurement : Create PO
Important Actions :
1. LORS create loose link between Sales Order and Vehicle ( Batch ).
a. VELO11_LORS_EXECUTE
2. DELR to delete loose link between Vehicle and Sales Order.
a. VELO11_DELR_EXECUTE
3. TIRS to create tight Link between Vehicle and Sales Order.
a. VELO11_TIRS_EXECUTE
4. DETR to delete tight link between Vehicle and sales order.
a. VELO11_DETR_EXECUTE
First LORS is perquisite for TIRS.
Action for Deliver are : DELI for Delivery and DEDE to delete a Delivery.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
Goods Issue / GR
Transaction VELOM
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
You can add your model , All the model should not be visible to every one so we have
created VMS Role here.
In VELO we can see only those model which is maintained in VOLM.
Transaction VELORU
CU43.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
Dependency
So this dependency we maintain table name and fields , all fields which we maintained
there will be copied from CU60 based on table name.
You can maintain data in CU60.
Based on the key fields which we defined in CU62 there will be multiple entries in
CU60 transaction.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
Based on the production date it will pick the CU60 data which is close to production
date.
In MM03 Characteristic we see the possible value and in VELO configuration we see
value which is populated so actually in VELO its instance of Char. Which we defined in
MM03 using class type.
Here we defined Char. Which is possible and once we create a Vehicle we populate
values.
Class type 300 will be assigned to Material in MM03.
One base Engine can have multiple BOM. OCC Code first need to maintain in CU60.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
Now only those OCC Code we can use. OCC code should be only one, in case of
multiple system will not pick anything.
Availability
Configuration of Action
SPRO->
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
Define Actions
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
Interlinking means : You are performing some action and in the back end you are
performing some other action.
Internal Action : Not called through VELO action. You can call it in BADI Etc.
Primary Action :
Secondary Action :
Primary Status :
Secondary Status :
Status Table
There is single table for both Primary and Secondary status, Its Free text without any
validation.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
Action Matrix
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
Under details Tab if we click on Action we will get all the action and when we click on
Action tab than it will show us only those action , possible for this Vehicle.
When we execute Tight Link, Batch number will be updated in sales order. And entry
from Reservation get deleted. VLCRESERVATION is only to show that Vehicle is loose
linked.
Secondary Action means another set of action which we can perform parallel.
VMS Technical
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
BADI :
METHOD IF_EX_VLC_EXECUTE_ACTION~EXECUTE_FURTHER_ACTIONS.
break ranand.
CASE INCOMING_ACTION_IS-AKTION.
WHEN 'ZSP1'.
CALL FUNCTION 'ZVELO10_UORD_EXECUTE1'
* EXPORTING
* ABA_UORD_IV = ABA_UORD_GC
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
* ABA_UTPO_IV = ABA_UTPO_GC
TABLES
VLCDIAVEHI_CT = VLCDIAVEHI_CT
VLCH_MSSG_CT = VLCH_MSSG_CT
VLCBAPICU_IT = VLCBAPICU1_IT
CHANGING
VLCACTDATA_CS = VLCACTDATA_CS
EXCEPTIONS
NO_LGORT =1
REWORK_BACKUP_CFG_ERROR =2
ORD1_ERROR =3
GMVT_HEADER_ERROR =4
GMVT_ITEM_ERROR =5
GMVT_UNKNOWN_ERROR =6
GMVT_POST_ERROR =7
GMVT_NOT_PERFORMED =8
VLCGMOVEM_NOT_UPDATED =9
OPEN_DELIVERY_FOUND = 10
OTHERS = 11
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
WHEN 'ZSP2' .
CALL FUNCTION 'ZVELO17_UGRE_EXECUTE1'
EXPORTING
ABA_UORD_IV = 'UORD'
ABA_UGRE_IV = 'UGRE'
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
TABLES
VLCDIAVEHI_CT = VLCDIAVEHI_CT
VLCH_MSSG_CT = VLCH_MSSG_CT
CHANGING
VLCACTDATA_CS = VLCACTDATA_CS
EXCEPTIONS
PREPARE_ERROR =1
PORDERS_NOT_FOUND =2
BAPI_HEADER_ERROR =3
BAPI_ITEM_ERROR =4
UGRE_NOT_PERFORMED =5
BAPI_POST_ERROR =6
VLCGRECEIPT_NOT_UPDATED = 7
NO_COMPONENTS_FOUND =8
OTHERS = 9.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
RAISE ACTION_NOT_PERFORMED .
ENDIF.
WHEN 'ZSP3' .
CALL FUNCTION 'ZVELO11_LORS_EXECUTE1'
TABLES
VLCDIAVEHI_CT = VLCDIAVEHI_CT
VLCH_MSSG_CT = VLCH_MSSG_CT
CHANGING
VLCACTDATA_CS = VLCACTDATA_CS
EXCEPTIONS
ACTION_NOT_PERFORMED = 1
UPDATE_NOT_PERFORMED = 2
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
OTHERS = 3.
IF SY-SUBRC <> 0.
RAISE ACTION_NOT_PERFORMED .
ENDIF.
WHEN 'ZSP5'.
when 'ZWGR'.
* ABA_UTPO_IV = ABA_UTPO_GC
TABLES
VLCDIAVEHI_CT = VLCDIAVEHI_CT
VLCBAPICU_IT = VLCBAPICU1_IT
VLCH_MSSG_CT = VLCH_MSSG_CT
CHANGING
VLCACTDATA_CS = VLCACTDATA_CS
EXCEPTIONS
BAPI_HEADER_ERROR =1
PREPARE_ERROR =2
OTHERS =3
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
WHEN 'ZMOR' .
CALL FUNCTION 'ZVELO10_MORD_EXECUTE'
* EXPORTING
* ABA_ORD1_IV = ABA_ORD1_GC
TABLES
vlcdiavehi_ct = vlcdiavehi_ct
vlch_mssg_ct = vlch_mssg_ct
vlcbapicu_it = vlcbapicu1_it
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
CHANGING
vlcactdata_cs = vlcactdata_cs
EXCEPTIONS
PREPARE_ERROR =1
PO_SET_CFG_ERROR =2
SET_TARGET_CFG_ERROR =3
ERROR_UPDATE_VLCPORDER =4
PUR_DOCU_CHANGE_NOT_PERFORMED =5
PO_CFG_TO_DB_ERROR =6
OTHERS =7
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
WHEN 'ZMSO' .
CALL FUNCTION 'ZVELO10_MORD_EXECUTE'
* EXPORTING
* ABA_ORD1_IV = ABA_ORD1_GC
TABLES
vlcdiavehi_ct = vlcdiavehi_ct
vlch_mssg_ct = vlch_mssg_ct
vlcbapicu_it = vlcbapicu1_it
CHANGING
vlcactdata_cs = vlcactdata_cs
EXCEPTIONS
PREPARE_ERROR =1
PO_SET_CFG_ERROR =2
SET_TARGET_CFG_ERROR =3
ERROR_UPDATE_VLCPORDER =4
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
PUR_DOCU_CHANGE_NOT_PERFORMED =5
PO_CFG_TO_DB_ERROR =6
OTHERS =7
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
INCLUDE lvelo02con.
INCLUDE LVELO15F02.
INCLUDE LVELO15O03.
INCLUDE LVELO15F03.
INCLUDE LVELO15I01.
INCLUDE LVELO15F04.
INCLUDE LVELO15I02.
INCLUDE LVELO15F05.
INCLUDE LVELO15I03.
INCLUDE LVELO15F06.
INCLUDE LVELO15O04.
INCLUDE LVELO15F07.
INCLUDE LVELO15I04.
INCLUDE LVELO15F08.
INCLUDE lvelo15f21.
ISOLATION Code
METHOD IF_EX_VLC_EXECUTE_ACTION~VEHICLE_ISOLATION.
BREAK RANAND.
FIELD-SYMBOLS: <FS_OK> TYPE VLCDIAVEHI.
IF ( ELEMENTARY_ACTION_IS-AKTION EQ 'ZSP5'
or ELEMENTARY_ACTION_IS-AKTION EQ 'ZWGR' ).
IF SY-SUBRC = 0.
ENDIF.
REFRESH: LT_VLCVEHICLE,
LT_HISTORY.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
REFRESH LT_VLCVEHICLE.
CLEAR LS_VEHI_OK_TEMP.
READ TABLE LT_VEHI_OK INTO LS_VEHI_OK_TEMP INDEX 1.
IF SY-SUBRC EQ 0.
READ TABLE VLCDIAVEHI_OK_CT INTO LS_VLCDIAVEHI_OK_CT WITH KEY VGUID
= LS_VEHI_OK_TEMP-VGUID.
IF SY-SUBRC EQ 0.
Screen level
FROM GX_ITEM
INDEX TAB_CTR1-CURRENT_LINE.
IF SY-SUBRC NE 0.
APPEND GX_ITEM TO GT_ITEM.
ENDIF.
ENDIF.
ENDMODULE. "TAB_CTR1_MODIFY INPUT
OK_CODE = SY-UCOMM.
PERFORM USER_OK_TC USING 'TAB_CTR1'
'GT_ITEM'
''
CHANGING OK_CODE.
SY-UCOMM = OK_CODE.
CASE SY-UCOMM.
WHEN 'INSERT'.
CLEAR : SY-UCOMM.
"insert row
PERFORM FCODE_INSERT_ROW USING 'TAB_CTR1'
'GT_ITEM'.
WHEN 'APPEND'.
CLEAR : SY-UCOMM.
TAB_CTR1-LINES = TAB_CTR1-LINES + 1.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
CLEAR : GX_ITEM.
APPEND GX_ITEM TO GT_ITEM.
ENDCASE.
*----------------------------------------------------------------------*
* INCLUDE TABLECONTROL_FORMS *
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form USER_OK_TC *
*&---------------------------------------------------------------------*
FORM USER_OK_TC USING P_TC_NAME TYPE DYNFNAM
P_TABLE_NAME
P_MARK_NAME
CHANGING P_OK LIKE SY-UCOMM.
WHEN 'APPEND'.
"insert row
PERFORM FCODE_INSERT_ROW USING P_TC_NAME
P_TABLE_NAME.
CLEAR P_OK.
*
* WHEN 'L-'. "column left
* WHEN 'SASCEND' OR
* 'SDESCEND'. "sort column
* PERFORM FCODE_SORT_TC USING P_TC_NAME
* l_ok.
ENDCASE.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
*&---------------------------------------------------------------------*
*& Form FCODE_INSERT_ROW *
*&---------------------------------------------------------------------*
FORM FCODE_INSERT_ROW
USING P_TC_NAME TYPE DYNFNAM
P_TABLE_NAME .
*&---------------------------------------------------------------------*
*& Form FCODE_DELETE_ROW *
*&---------------------------------------------------------------------*
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
FORM FCODE_DELETE_ROW
USING P_TC_NAME TYPE DYNFNAM
P_TABLE_NAME
P_MARK_NAME .
IF <MARK_FIELD> = 'X'.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
<TC>-LINES = <TC>-LINES - 1.
ENDIF.
ENDIF.
ENDLOOP.
*&---------------------------------------------------------------------*
*& Form COMPUTE_SCROLLING_IN_TC
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_TC_NAME name of tablecontrol
* -->P_OK ok code
*----------------------------------------------------------------------*
FORM COMPUTE_SCROLLING_IN_TC USING P_TC_NAME
P_OK.
*&SPWIZARD: BEGIN OF LOCAL DATA----------------------------------------*
DATA L_TC_NEW_TOP_LINE TYPE I.
DATA L_TC_NAME LIKE FELD-NAME.
DATA L_TC_LINES_NAME LIKE FELD-NAME.
DATA L_TC_FIELD_NAME LIKE FELD-NAME.
IF SYST-SUBRC = 0.
IF L_TC_NAME = P_TC_NAME.
*&SPWIZARD: et actual column *
SET CURSOR FIELD L_TC_FIELD_NAME LINE 1.
ENDIF.
ENDIF.
*&---------------------------------------------------------------------*
*& Form FCODE_TC_MARK_LINES
*&---------------------------------------------------------------------*
* marks all TableControl lines
*----------------------------------------------------------------------*
* -->P_TC_NAME name of tablecontrol
*----------------------------------------------------------------------*
FORM FCODE_TC_MARK_LINES USING P_TC_NAME
P_TABLE_NAME
P_MARK_NAME.
*&SPWIZARD: EGIN OF LOCAL DATA-----------------------------------------*
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
<MARK_FIELD> = 'X'.
ENDLOOP.
ENDFORM. "fcode_tc_mark_lines
*&---------------------------------------------------------------------*
*& Form FCODE_TC_DEMARK_LINES
*&---------------------------------------------------------------------*
* demarks all TableControl lines
*----------------------------------------------------------------------*
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
<MARK_FIELD> = SPACE.
ENDLOOP.
ENDFORM. "fcode_tc_mark_lines
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
*&---------------------------------------------------------------------*
*& Module CHECK_MATNR INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE CHECK_MATNR INPUT.
DATA : LV_MATNR TYPE MATNR.
DATA : LX_ITEM TYPE TY_ITEM.
IF SY-SUBRC NE 0.
MESSAGE 'Invalid Material.....' TYPE 'E'.
ENDIF.
*&---------------------------------------------------------------------*
*& Module MOVE_DATA_GLOBAL INPUT
*&---------------------------------------------------------------------*
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
* text
*----------------------------------------------------------------------*
* VLCACTDATA_ITEM_GT
VLCACTDATA_HEAD_S-DOC_DATE = SY-DATUM.
VLCACTDATA_HEAD_S-BSART = EKKO-BSART.
VLCACTDATA_HEAD_S-EKORG = EKKO-EKORG.
VLCACTDATA_HEAD_S-EKGRP = EKKO-EKGRP.
VLCACTDATA_HEAD_S-LIFNR = EKKO-LIFNR.
VLCACTDATA_HEAD_S-EINDT = EKKO-AEDAT.
ENDFORM. " FORM_MOVE_DATA_GLOBAL
*&---------------------------------------------------------------------*
*& Module MOVE_DATA_GLOBAL OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE MOVE_DATA_GLOBAL OUTPUT.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
PERFORM FORM_MOVE_DATA_GLOBAL.
ENDMODULE. " MOVE_DATA_GLOBAL OUTPUT
*&---------------------------------------------------------------------*
*& Module M_CLEAR_DATA OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE M_CLEAR_DATA OUTPUT.
PERFORM FORM_CLEAR_DATA.
ENDMODULE. " M_CLEAR_DATA OUTPUT
*&---------------------------------------------------------------------*
*& Form FORM_CLEAR_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM FORM_CLEAR_DATA .
* before the action and after the action in order to display data
IF BEFORE_AFTER_LV IS INITIAL OR BEFORE_AFTER_LV = AFTER_ACT_GC.
ENDIF.
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM FORM_FILL_PLANT .
BREAK RANAND.
VLCACTDATA_HEAD_S-LGORT = T001L-LGORT.
ENDFORM. " FORM_FILL_PLANT
*&---------------------------------------------------------------------*
*& Module M_DEFAULT_VALUE OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE M_DEFAULT_VALUE OUTPUT.
PERFORM FORM_DEFAULT_VALUE.
ENDMODULE. " M_DEFAULT_VALUE OUTPUT
*&---------------------------------------------------------------------*
*& Form FORM_DEFAULT_VALUE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM FORM_DEFAULT_VALUE .
IF VLCACTDATA_HEAD_S-BLDAT IS INITIAL.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
VLCACTDATA_HEAD_S-BLDAT = SY-DATUM.
ENDIF.
IF VLCACTDATA_HEAD_S-BUDAT IS INITIAL.
VLCACTDATA_HEAD_S-BUDAT = SY-DATUM.
ENDIF.
FM
*****************************************************************
* THIS FILE IS GENERATED BY THE FUNCTION LIBRARY. *
* NEVER CHANGE IT MANUALLY, PLEASE! *
*****************************************************************
"ZVMS_ACTION_ZSP5
INCLUDE LZVMS_ACTION_ZSP5U02.
"ZVMS_ZSP5_PO_CREATE
INCLUDE LZVMS_ACTION_ZSP5U01.
"ZVMS_ZSP5_RESB_UPDATE
INCLUDE LZVMS_ACTION_ZSP5U03.
"ZVMS_ZWGR_INV_CREATE
FM ZVMS_ZSP5_PO_CREATE.
FUNCTION ZVMS_ZSP5_PO_CREATE.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
*" TABLES
*" VLCDIAVEHI_CT STRUCTURE VLCDIAVEHI
*" VLCBAPICU_IT TYPE VLCBAPICU_T
*" VLCH_MSSG_CT TYPE VLCH_MSSG_PT
*" CHANGING
*" REFERENCE(VLCACTDATA_CS) TYPE VLCACTDATA
*" EXCEPTIONS
*" PO_ERROR
*"----------------------------------------------------------------------
*--- Get the Plant from VLCVEHICLE table based on VGUID
*--- coming from VELO Variables
DATA : LV_EBELP TYPE EBELP.
DATA : LX_VLCVEHICLE TYPE VLCVEHICLE.
DATA : LV_HEADER TYPE BAPIMEPOHEADER.
DATA : LV_HEADERX TYPE BAPIMEPOHEADERX.
DATA : LT_RETURN TYPE STANDARD TABLE OF BAPIRET2.
DATA : LX_RETURN TYPE BAPIRET2.
DATA : LT_ITEM TYPE STANDARD TABLE OF BAPIMEPOITEM.
DATA : LX_ITEM TYPE BAPIMEPOITEM.
DATA : LV_PO_NUMBER(10).
DATA : LV_RSNUM TYPE RESB-RSNUM.
DATA : LT_RESB TYPE STANDARD TABLE OF RESB.
DATA : LX_RESB TYPE RESB.
DATA : LX_RESB_HEADER TYPE RESB.
DATA : LV_MODEL TYPE MATNR.
MSGID_LV = &1.
MSGTY_LV = &2.
MSGNO_LV = &3.
MSGV1_LV = &4.
MSGV2_LV = &5.
MSGV3_LV = &6.
MSGV4_LV = &7.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
MSGID_IV = MSGID_LV
MSGTY_IV = MSGTY_LV
MSGNO_IV = MSGNO_LV
MSGV1_IV = MSGV1_LV
MSGV2_IV = MSGV2_LV
MSGV3_IV = MSGV3_LV
MSGV4_IV = MSGV4_LV
TABLES
VLCH_MSSG_CT = VLCH_MSSG_CT.
END-OF-DEFINITION.
BREAK RANAND.
LOOP AT VLCDIAVEHI_CT INTO VLCDIAVEHI_LS.
CLEAR : LOOP_INDEX_LV.
LOOP_INDEX_LV = SY-TABIX.
*----------------
*--- Set the document type of the action which changes the configuration
VLCDIAVEHI_LS-CUABA = ABA_UORD_IV.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
*--- Set the document type of the action which changes the vehicle
VLCDIAVEHI_LS-ACTDOCTYPE = ABA_UORD_IV.
*--- Make sure that the action doc type is written into the vehicle table
MODIFY VLCDIAVEHI_CT FROM VLCDIAVEHI_LS
INDEX LOOP_INDEX_LV TRANSPORTING ACTDOCTYPE CUABA.
IF SY-SUBRC <> 0.
*--- Macro for error handling
FILL_VLCH_MSSG_CT
SY-MSGID SY-MSGTY SY-MSGNO SY-MSGV1
SY-MSGV2 SY-MSGV3 SY-MSGV4.
RAISE REWORK_BACKUP_CFG_ERROR.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
ENDIF.
CLEAR: ADDCFG_RW_EXIST_LS,
ADDCFG_RW_TODB_LS, " 441657
VLCBAPICU_RW_LS.
REFRESH: ADDCFG_RW_EXIST_LT. " 441657
IF SY-SUBRC <> 0.
IF SY-SUBRC = 1.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
ENDIF.
IF SY-SUBRC = 2.
*--- Unknown error
*--- Macro for error handling
FILL_VLCH_MSSG_CT
'VELO' 'E' '016' 'VELO10_UORD_EXECUTE' '' '' ''.
RAISE REWORK_BACKUP_CFG_ERROR.
ENDIF.
ENDIF.
CLEAR ADDCFG_RW_EXIST_LS.
READ TABLE ADDCFG_RW_EXIST_LT INTO ADDCFG_RW_EXIST_LS
WITH KEY VGUID = VLCDIAVEHI_LS-VGUID.
VLCACTDATA_HEAD_IS = VLCACTDATA_HEAD_LS
VLCACTDATA_ITEM_IS = VLCACTDATA_ITEM_LS
VLCBAPICU_IS = VLCBAPICU_RW_LS
ACTDOCTYPE_IV = ABA_UORD_IV
CFGCALLID_IV = CFGCALLID_3_GC
CUOBJ_IV = ADDCFG_RW_EXIST_LS-CUOBJ
IMPORTING
CUOBJ_EV = ADDCFG_RW_TODB_LS-CUOBJ " 441657
EXCEPTIONS
NO_SET_CONFIG =1
OTHERS = 2.
IF SY-SUBRC <> 0.
*--- Macro for error handling
FILL_VLCH_MSSG_CT
SY-MSGID SY-MSGTY SY-MSGNO SY-MSGV1
SY-MSGV2 SY-MSGV3 SY-MSGV4.
RAISE REWORK_BACKUP_CFG_ERROR.
ENDIF. " IF SY-SUBRC <> 0.
*--- Add the new line to ADDCFG_RW_TODB_LT because it's needed for
*--- calling CUCB_CONFIGURATION_TO_TB
ADDCFG_RW_TODB_LS-VGUID = VLCDIAVEHI_LS-VGUID. " 441657
ADDCFG_RW_TODB_LS-CFGTY = CFGTY_RW_GC. " 441657
APPEND ADDCFG_RW_TODB_LS TO ADDCFG_RW_TODB_LT. " 441657
*--- vehicle
IF ADDCFG_RW_EXIST_LS-CUOBJ IS INITIAL.
BREAK RANAND.
LV_HEADER-DOC_DATE = SY-DATUM.
LV_HEADER-DOC_TYPE = VLCACTDATA_CS-BSART.
LV_HEADER-PURCH_ORG = VLCACTDATA_CS-EKORG.
LV_HEADER-PUR_GROUP = VLCACTDATA_CS-EKGRP.
LV_HEADER-VENDOR = VLCACTDATA_CS-LIFNR.
LV_HEADERX-DOC_DATE = 'X'.
LV_HEADERX-DOC_TYPE = 'X'.
LV_HEADERX-PURCH_ORG = 'X'.
LV_HEADERX-PUR_GROUP = 'X'.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
LV_HEADERX-VENDOR = 'X'.
LV_HEADERX-COMP_CODE = 'X'. " Need
SELECT SINGLE *
INTO LX_VLCVEHICLE
FROM VLCVEHICLE
WHERE VGUID = VLCACTDATA_ITEM_S-VGUID.
LV_MODEL = LX_VLCVEHICLE-MATNR.
CLEAR : LV_EBELP.
LX_ITEMX-MATERIAL = 'X'.
LX_ITEMX-QUANTITY = 'X'.
LX_ITEMX-PO_ITEM = LV_EBELP.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
LX_ITEMX-PLANT = 'X'.
LX_ITEMX-ITEM_CAT = 'X'.
LX_ITEMX-BATCH = 'X'.
LX_ITEMX-INT_OBJ_NO = 'X'.
APPEND LX_ITEMX TO LT_ITEMX.
LX_POCOND-ITM_NUMBER = LV_EBELP.
LX_POCOND-COND_TYPE = 'ZLBR'.
LX_POCOND-COND_VALUE = GX_HEADER-KBETR.
LX_POCOND-CURRENCY = 'USD'.
LX_POCOND-CHANGE_ID = 'I'.
APPEND LX_POCOND TO LT_POCOND.
LX_POCONDX-ITM_NUMBER = LV_EBELP.
LX_POCONDX-COND_TYPE = 'X'.
LX_POCONDX-COND_VALUE = 'X'.
LX_POCONDX-CURRENCY = 'X'.
LX_POCONDX-CHANGE_ID = 'I'.
APPEND LX_POCONDX TO LT_POCONDX.
LX_SCHEDULE-DELIVERY_DATE = GX_HEADER-DEL_DATE.
LX_SCHEDULE-PO_ITEM = LV_EBELP.
APPEND LX_SCHEDULE TO LT_SCHEDULE.
LX_SCHEDULEX-DELIVERY_DATE = 'X'.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
LX_SCHEDULEX-PO_ITEM = LV_EBELP.
APPEND LX_SCHEDULEX TO LT_SCHEDULEX.
ENDLOOP.
*--- Pass tye Model number as main material with Batch number and Item catagory as
L.
IF GX_ITEM-IND = 'X'.
LX_ITEM-IR_IND = ' '.
ENDIF.
LX_ITEMX-MATERIAL = 'X'.
LX_ITEMX-QUANTITY = 'X'.
LX_ITEMX-PO_ITEM = LV_EBELP.
LX_ITEMX-PLANT = 'X'.
LX_ITEMX-ITEM_CAT = 'X'.
IF GX_ITEM-IND = 'X'.
LX_ITEMX-IR_IND = 'X'.
ENDIF.
LX_ITEM-FREE_ITEM = 'X'.
APPEND LX_ITEMX TO LT_ITEMX.
*--- for free material do not pass Price
IF GX_ITEM-IND = ' '.
LX_POCOND-ITM_NUMBER = LV_EBELP.
LX_POCOND-COND_TYPE = 'ZLBR'.
LX_POCOND-COND_VALUE = GX_HEADER-KBETR.
LX_POCOND-CURRENCY = 'USD'.
LX_POCOND-CHANGE_ID = 'I'.
APPEND LX_POCOND TO LT_POCOND.
LX_POCONDX-ITM_NUMBER = LV_EBELP.
LX_POCONDX-COND_TYPE = 'X'.
LX_POCONDX-COND_VALUE = 'X'.
LX_POCONDX-CURRENCY = 'X'.
LX_POCONDX-CHANGE_ID = 'I'.
APPEND LX_POCONDX TO LT_POCONDX.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
ENDIF.
LX_SCHEDULE-DELIVERY_DATE = GX_HEADER-DEL_DATE.
LX_SCHEDULE-PO_ITEM = LV_EBELP.
APPEND LX_SCHEDULE TO LT_SCHEDULE.
LX_SCHEDULEX-DELIVERY_DATE = 'X'.
LX_SCHEDULEX-PO_ITEM = LV_EBELP.
APPEND LX_SCHEDULEX TO LT_SCHEDULEX.
ENDLOOP.
BREAK RANAND.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
POHEADER = LV_HEADER
POHEADERX = LV_HEADERX
IMPORTING
EXPPURCHASEORDER = LV_PO_NUMBER
TABLES
RETURN = LT_RETURN
POITEM = LT_ITEM
POITEMX = LT_ITEMX
POCOND = LT_POCOND
POCONDX = LT_POCONDX
POSCHEDULE = LT_SCHEDULE
POSCHEDULEX = LT_SCHEDULEX.
BREAK RANAND.
Ravi Anand VMS Techno Functional – anandravi75@gmail.com
ENDLOOP.
break ranand.
LV_PO_NUMBER = LV_PO_NUMBER
TABLES
GT_ZSP5_ITEM = GT_ZSP5_ITEM.
ENDFUNCTION.