Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Introduction
If we create a sale order related to this invoice, we want the fixed value date equal to the billing reference date.
Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality
Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality
Sap standard routine 103 triggers whenever sales order is being created with reference. Sap
standard routine is configured in VOFM transaction as:
Sap standard routine 103 has the functionality of copying the billing document header data and
billing document line item data into the sales order header data, whenever sales order is being
created using reference document.
Note: To achieve this requirement we can also enhance the SAP standard routine 103 but here they
need the custom routine because it will be configured on demand basis by client whenever they need
it.
Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality
Transaction VOFM is a tool that was developed in R/3 to facilitate the definition of both SAP delivered as well
as customer defined routines/rules used in the system during various business processes. VOFM routines are
ABAP code written in Forms. VOFM provides the user with the benefit of choosing from one of the standard
delivered R/3 routines or writing their own. VOFM is intended for the implementation team when configuring the
system. It is not intended for the end user.
Here we have four important menus:
i)
Copying requirements
ii)
Data transfer
iii)
Requirements
iv)
Formulas
1)
2)
Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality
Naming Convention:
VOFM routines are organized using the Group Indicator Code. The VOFM program uses
the group indicator to determine the program include and subroutine names when it
dynamically creates these objects. The assignment of these names is hard coded in the program.
The valid group indicator codes are defined in data base domain GRPZE using a value range.
Go to transaction VOFN place the cursor on class input and press F1 key.
Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality
Now double click on data element and see the domain values as:
Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality
Now provide the custom routine name and press enter, it will ask for access key:
Once the access key provided a include program get generated with transport request as:
Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality
All include program generated from Routine has an entry in table TFRM (Form Routines for Requirements/
Formulas/Data Transports) and TFRMT (FORM Routines for Reqs./Formulae/Data Transports: Texts).
1)
Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality
Then mentioned icon in the above screen shot needs to be used for modification of the custom routine.
Now place the cursor at the end of the ENDFORM and click on the insert button to write our own code as
shown below:
On clicking insert button we have the area for writing our code with *(INSERT,, *) INSERT as:
Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality
Along with code for standard routine 103, the code marked in red is the additional for this specific scenario has
been used.
The billing date has been copied also in VBRK value date which also gets copied into VBKD.
The standard SAP program for creating the sales order using reference document checks for all values and if
found any difference between CVBRK and VBKD, it creates an additional entry for VBKD. For that reason in
this scenario fixed value date is also copied into CVBRK.
Once the coding is over we need to activate the custom routine 901 and include program generated.
For confirming the same we need to check the entries in TFRM table as:
Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality
Even if any error occurs then we need to run the SAP standard program RV80HGEN to
regenerate all VOFM routines.
Testing:
The Billing Document 90000112 has been used to create the Sales order :
Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality
Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality
Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality
Depending upon the action the TRFM or TRFMT entries gets updated automatically as:
Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality