Sunday, 8 May 2016

Route Determination Configuration

Define Routes and Stages

IMG à Enterprise Structure à Sales and Distribution à Basic Functions à Define Routes à Define Routes and Stages



  • Enter Route, Description, select Shipping type and Factory calendar.




  • Click on details  to ensure that the values entered above are populated.




2.    Define AFS Route Determination in Purchase Order

IMG à Enterprise Structure à Sales and Distribution à Basic Functions à Define Routes à Define Routes and Stages






  • Define Route:
Routes default from previous step. Transportation Lead Times are entered in this step (which are used in Ex-factory date calculations)




  • Define Transportation Zones:
Routes default from previous step. Transportation Lead Times are entered in this step (which are used in Ex-factory date calculations)




  • Define Route Determination
Assign the Route to the Transportation zone combinations.




Adding new fields for SD Pricing

In SD Pricing , the fields on the basis of which pricing is done are derived from the FIELD CATALOG which is a structure KOMG .This structure is used to transfer transaction data to the pricing procedure in SD and is also known as communication structure.

This structure KOMG consists of two tables KOMK for Header related fields and KOMP for item related fields. The fields which are not in either of the two tables KOMK and KOMP cannot be used in pricing .Sometimes a need arises when the pricing is to be based on some other criteria which is not present in the form of fields in either of the two tables. 

This problem can be solved by using USEREXITS which are provided for pricing in SD. Pricing takes place both when the SALES ORDER ( Transaction VA01) is created as well as when INVOICING ( Transaction VF01) is done.

Hence SAP provides 2 userexits ,one for sales order processing which is

USEREXIT_PRICING_PREPARE_TKOMP or

USEREXIT_PRICING_PREPARE_TKOMK

Depending upon which table (KOMK or KOMP) the new fields were inserted we use either of the above two userexits.These userexits are found in include MV45AFZZ of the standard SAP sales order creation program SAPMV45A.

In the case of userexit which will be called when invoicing is done ,these are provided in the include RY60AFZZ which is in the standard SAP program SAPMV45A.


The name of the userexits are same.

USEREXIT_PRICING_PREPARE_TKOMP or

USEREXIT_PRICING_PREPARE_TKOMK

These userexits are used for passing the data from the communication structure to the pricing procedure, for this we have to fill the newly created field in the communication structure KOMG for this we fill the code in the above userexit using the MOVE statement after the data that has to be passed is taken from the database table by using the SELECT statement. The actual structure which is visible in these userexits and which is to be filled for that particular field is TKOMP or TKOMK.

Before the coding for these userexits is done ,it is necessary to create a new field in either of the two tables KOMK or KOMP .For this purpose includes are provided in each of them .

To create the field in header data (KOMK) the include provided is KOMKAZ and to create the field in item data (KOMP) the include provided is KOMPAZ.


One possible example for the need of creating new fields can be e.g. Freight to be based upon transportation zone, for this no field is available in field catalog and hence it can be created in KOMK and then above userexits can be used to fill the transportation data to it.



How to find user exits in Sales & Distribution

Userxits allow us to add our own functionality to SAP standard program without modifying it. These are implemented in the form of subroutines and hence are also known as FORM EXITs.

The userexits are generally collected in includes and attached to the standard program by the SAP.

All Userexits start with the word USEREXIT

for example

its start with FORM USEREXIT_& end with ENDFORM.


Main challenge in finding the correct userexit and how to find it if one exists for the purpose. Once the correct userexit is found the necessary customer code is inserted in the customer include starting with the z. in the form routine.

e.g.
USEREXIT_NUMBER_RANGE -This userexit is used to assign a different internal document number to the

sales order(VA01) when it is created depending on some criteria like a different SALES RGANIZAION(VKORG)


Now ,How to find correct user exits

Userexits can be found in number of ways:

To find userexits in SD module , goto object navigator(SE80) and select development class from the list and enter VMOD in it. 

All of the userexits in SD are contained in the development class VMOD. Press enter and you will find all the includes which contain userexits in SD for different functions like PRICING, ORDER PROCESSING etc. 

Select the userexit according to the requirement and read the comment inserted in it and start coding..

...