cancel
Showing results for 
Search instead for 
Did you mean: 

Pricing routines

Former Member
0 Kudos

Can anyone tell me the procedure to create separate pricing routine for complex pricing procedure and where to assign in my pricing?

Regards

Inder

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

HI Inder,

To define Custom Z routine in Sales and Distribution module please follow the following steps.

o Transaction Code - VOFM (Maintain: Requirements and Formulas)

o Menu Path - Formulas --> Condition value.

o Go to bottom of the table control,

o Enter the routine number for Ex. 900 and some meaningful description,

o It will ask the Access key, enter the available access key. Now ABAP editor will be opened, you can switch off Modification Assistant from Menu EDIT �� Modification operation �� Switch off Assistant.

o In custom routine we can use KOMP structure, where we can get the pricing value,

o To access the whole condition record, we can use structure XKOMV. But to access this XKOMV structure we have to define one internal table of type ‘INDEXED_KOMV’ and pass the structure XKOMV value to the new defined internal table.

o Depending upon the requirement you can refer KOMP or XKOMV structure in your code.

o The calculated result we have to pass to XWERT field, which will be display to the condition record.

o To activate the subroutine we have to first save the code and come out from the routine. In Maintain: Formulas Condition value screen, select routine to activate and select Edit menu �� Activate.

o After activating the custom routine, functional person will attach this custom routine to the condition type of the pricing procedure at AltCty column.

o Function person can define one field at Subto column for condition type, which we can use in our custom routine.

o For ex. We require to calculate the % discount depending upon the two condition type. To get the condition value for the both the condition type we have to select one field at Subto column. There are two types of fields, one is ‘Copy value to’ and another one is ‘Carry over value to’. One store the condition value whereas second store Condition rate. Depending upon the requirement we can select the field type. Before using the Subto field please make sure that it is not referring to other condition type.

o To calculate the % you have to divide or multiply by 10000 not by 100 due to SAP current type.

This is an example of a code sample:

DATA: WORKFIELD(16) TYPE P DECIMALS 2.

CHECK KOMP-KZWI1 NE 0.

IF XWORKJ NE 0.

WORKFIELD = ( KOMP-KZWI1 - XWORKJ ) * 10000 / KOMP-KZWI1.

XKWERT = WORKFIELD.

ELSE.

XKWERT = 0.

ENDIF.

Reward points pls.

Regards,

Govind.

Answers (2)

Answers (2)

Manoj_Mahajan78
Active Contributor
0 Kudos

Inder,

Form routines for pricing and various other functions can be maintained form routines are something to do with ABAP code.

Go to (VOFM) where all requirements which are represented by form routines can be maintained. Requirements are available to be assigned where access sequences are used (for determination procedures, here pricing).

Once the t-code VOFM is accessed you will see requirements and go select "pricing" again you need access key to create your own or copy a routine.

Say you want header price not to have effect the item pricing, you need to go to the program to change ABAP code to meet the requirement. this specific requirement you created will be assigned in the pricing proc. determination "requirements field"

usually with a number beyond 600. Note: make sure you activate your routine for its effect to take place

Also VISIT-

http://www.sapprofessionals.org/?q=vofm_requirement_and_formulas_for_sap_sd_pricing

Reward if it Helps..

Regds

MM

Former Member
0 Kudos

Hi

Form routines for pricing and various other functions can be maintained form routines are something to do with ABAP code.

Go to (VOFM) where all requirements which are represented by form routines can be maintained. Requirements are available to be assigned where access sequences are used (for determination procedures, here pricing).

Once the t-code VOFM is accessed you will see requirements and go select "pricing" again you need access key to create your own or copy a routine.

Say you want header price not to have effect the item pricing, you need to go to the program to change ABAP code to meet the requirement. this specific requirement you created will be assigned in the pricing proc. determination "requirements field"

usually with a number beyond 600. Note: make sure you activate your routine for its effect to take place

REFER LINK BELOW FOR FURTHER DETAILS

<a href="http://www.sapprofessionals.org/?q=vofm_requirement_and_formulas_for_sap_sd_pricing">VOFM: SAP-SD Pricing</a>