Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Applies to:
SAP 4.6C
Summary
In pricing procedure there are different condition types and some time we can not use direct this condition
type in pricing procedure as it is based on different condition. In such situation we have to define custom
routine. In Sales and Distribution module I have define custom routine to calculate Condition value for some
condition types.
Depending on the business processes used it may be necessary to influence the standard behavior of R/3
applications. For that purpose the VOFM function provides a corresponding environment in order to be able
to develop and manage customer-specific logic simply.
The system stores the objects generated via the VOFM in the Customizing of the respective application area
(Pricing, message determination and so on) and its programs call the objects correspondingly.
Author(s):
Nilesh Shete
© 2006 SAP AG 1
Company: Tata Consultancy Services Ltd. Mumbai India
Author Bio
Name - Nilesh Shete,
Working as SAP Technical Consultant ABAP Workbench on different areas SAP –External
system interface, ABAP reporting, ALV, BAPI, etc.
© 2006 SAP AG 2
Introduction
First of all I will explain what is the difference between Condition Value and Condition base value?
o Condition value is nothing but the calculated value depending upon the specified condition or pricing
condition type. The include name will start with RV64A* and subroutine name will be Form routine:
FRM_KONDI_WERT_<ROUTINE NUMBER>.
o Whereas Condition base value are used to validate for the particular pricing condition type value. .
The include name will start with RV61A* and subroutine name will be Form routine:
FRM_KONDI_WERT_<ROUTINE NUMBER>.
Important Points
o Access key for each custom routine. VOFM objects are subject to SSCR registration
o Required authorization to define custom routine.
o Understand the requirement and check whether it is possible to incorporate in the custom routine or
not
o We have customer number range from 900 to 999 for custom routine.
o Execute ‘RV80HGEN’ report after completing the routine in each system.
Step to Follows
To define Custom Z routine in Sales and Distribution module please follow the following steps.
© 2006 SAP AG 3
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.
Sample Code 1
CHECK KOMP-KZWI1 NE 0.
IF XWORKJ NE 0.
WORKFIELD = ( KOMP-KZWI1 - XWORKJ ) * 10000 / KOMP-KZWI1.
XKWERT = WORKFIELD.
ELSE.
XKWERT = 0.
ENDIF.
© 2006 SAP AG 4
Sample code 2
CLEAR: XKWERT.
ZKOMV[] = XKOMV[].
IF SY-SUBRC = 0.
WORKFIELD2 = ZKOMV-KWERT.
ELSE.
READ TABLE ZKOMV WITH KEY KSCHL = C_PRICE1.
IF SY-SUBRC = 0.
WORKFIELD2 = ZKOMV-KWERT.
ENDIF.
ENDIF.
CHECK WORKFIELD2 NE 0.
IF WORKFIELD1 NE 0.
WORKFIELD = ( WORKFIELD1 - WORKFIELD2 ) * 10000 / WORKFIELD2.
XKWERT = WORKFIELD.
ELSE.
XKWERT = 0.
SAP will not be held liable for any damages caused by using or misusing the information, code or methods
suggested in this document, and anyone using these methods does so at his/her own risk.
SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of
this technical article or code sample, including any liability resulting from incompatibility between the content
within this document and the materials and services offered by SAP. You agree that you will not hold, or
seek to hold, SAP responsible or liable with respect to the content of this document.
© 2006 SAP AG 5