Académique Documents
Professionnel Documents
Culture Documents
Products
Products Industries
Industries Support
Support Training
Training Community
Community Developer
Developer Partner
Partner
About
About
Home / Community / Blogs + Actions
Mohammed Khurshed
more by this author
SD Sales
Sales | SAP ERP | SD (Sales and Distribution) | enterprise resource planning | sap erp sales and distribution
share
0 share
0 tweet share
0
Follow
1. Introduction
https://blogs.sap.com/2013/09/19/creating-vofm-custom-routine-functionality-same-as-sap-standard-routine-103-with-additional-functionality/ 1/21
11/22/2017 Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality | SAP Blogs
For example:
If we create a sale order related to this invoice, we want the xed value date
equal to the billing reference date.
https://blogs.sap.com/2013/09/19/creating-vofm-custom-routine-functionality-same-as-sap-standard-routine-103-with-additional-functionality/ 2/21
11/22/2017 Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality | SAP Blogs
Sap standard rou ne 103 triggers whenever sales order is being created with
reference. Sap standard rou ne is congured in VOFM transac on as:
Sap standard rou ne 103 has the func onality 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.
https://blogs.sap.com/2013/09/19/creating-vofm-custom-routine-functionality-same-as-sap-standard-routine-103-with-additional-functionality/ 3/21
11/22/2017 Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality | SAP Blogs
Transac on VOFM is a tool that was developed in R/3 to facilitate the deni on
of both SAP delivered as well as customer dened rou nes/rules used in the
system during various business processes. VOFM rou nes are ABAP code
wri en in Forms. VOFM provides the user with the benet of choosing from
one of the standard delivered R/3 rou nes or wri ng their own. VOFM is
intended for the implementa on team when conguring the system. It is not
intended for the end user.
i) Copying requirements
ii) Data transfer
iii) Requirements
iv) Formulas
Steps to create the custom rou ne:
https://blogs.sap.com/2013/09/19/creating-vofm-custom-routine-functionality-same-as-sap-standard-routine-103-with-additional-functionality/ 4/21
11/22/2017 Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality | SAP Blogs
Naming Convention:
VOFM routines are organized using the Group Indicator Code. The
VOFMprogram 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.
https://blogs.sap.com/2013/09/19/creating-vofm-custom-routine-functionality-same-as-sap-standard-routine-103-with-additional-functionality/ 5/21
11/22/2017 Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality | SAP Blogs
Now double click on data element and see the domain values as:
Now provide the custom rou ne name and press enter, it will ask for access
key:
https://blogs.sap.com/2013/09/19/creating-vofm-custom-routine-functionality-same-as-sap-standard-routine-103-with-additional-functionality/ 6/21
11/22/2017 Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality | SAP Blogs
Once the access key provided a include program get generated with transport
request as:
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).
https://blogs.sap.com/2013/09/19/creating-vofm-custom-routine-functionality-same-as-sap-standard-routine-103-with-additional-functionality/ 7/21
11/22/2017 Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality | SAP Blogs
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:
https://blogs.sap.com/2013/09/19/creating-vofm-custom-routine-functionality-same-as-sap-standard-routine-103-with-additional-functionality/ 8/21
11/22/2017 Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality | SAP Blogs
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:
Even if any error occurs then we need to run the SAP standard program
https://blogs.sap.com/2013/09/19/creating-vofm-custom-routine-functionality-same-as-sap-standard-routine-103-with-additional-functionality/ 9/21
11/22/2017 Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality | SAP Blogs
Testing:
The Billing Document 90000112 has been used to create the Sales order :
Now following steps has been taken to create the sales order using billing
document as follows:
In VA01 transaction for a given order type(ZRD) when sales order has been
created with Reference
https://blogs.sap.com/2013/09/19/creating-vofm-custom-routine-functionality-same-as-sap-standard-routine-103-with-additional-functionality/ 10/21
11/22/2017 Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality | SAP Blogs
After clicking on the copy option, a screen will open having the information of
the sales order.
routines are transported this program should be executed in all target systems.
It is
It can be added to the transport request of the custom routine include as:
Even if it does not work then we need to run SAP standard program
RV80HGEN manually in the target system.
Sometimes while transporting the entries in table TFRM or TFRMT does not
exists in target system. In this case we need to run the standard SAP program
RV80HGEN first and then Standard SAP program SDINVOFM used to identify
and repair missing table entries in the VOFM control tables TFRM and TFRMT.
We can also activate and deactivate our custom routine from VOFM as:
Depending upon the action the TRFM or TRFMT entries gets updated
automatically as:
https://blogs.sap.com/2013/09/19/creating-vofm-custom-routine-functionality-same-as-sap-standard-routine-103-with-additional-functionality/ 12/21
11/22/2017 Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality | SAP Blogs
Alert Moderator
28 Comments
You must be Logged on to comment or reply to a post.
venu gopal
Hai wonderful document you have shared , really this is very helpful for functional
consultants
thanks a lot
https://blogs.sap.com/2013/09/19/creating-vofm-custom-routine-functionality-same-as-sap-standard-routine-103-with-additional-functionality/ 13/21
11/22/2017 Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality | SAP Blogs
Pradeep Mani
What will be the use of having fixed value date equal to billing date.
Ravin NK
That way we are just controlling that the customers due date to pay the
invoice starts on the day he was billed.
Debopriya Ghosh
Helpful document..
Mahe jyothi
Very good.Can you please let me me know more about this VOFMs if you have any
document please share it with me .
https://blogs.sap.com/2013/09/19/creating-vofm-custom-routine-functionality-same-as-sap-standard-routine-103-with-additional-functionality/ 14/21
11/22/2017 Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality | SAP Blogs
Eduardo Hinojosa
Hi
Regards
Eduardo
madhu kumar
Deep K
Hi Mohammed,
Very useful document for those are not worked with copying routine.
Thanks,
Deep.
Eduardo Hinojosa
https://blogs.sap.com/2013/09/19/creating-vofm-custom-routine-functionality-same-as-sap-standard-routine-103-with-additional-functionality/ 15/21
11/22/2017 Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality | SAP Blogs
Good job, but your document needs a comment. The range for VOFM according
Note 327220 VOFM function and its objects in 2.2 Namespaces is for FOFU (this
case from 900 to 999), in detail:
Regards
Eduardo
varun yadav
Nice.
Helpful.
Rampe V
Useful document.
Thank You.
Shiva Vasireddy
https://blogs.sap.com/2013/09/19/creating-vofm-custom-routine-functionality-same-as-sap-standard-routine-103-with-additional-functionality/ 16/21
11/22/2017 Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality | SAP Blogs
madhu kumar
Your Explanation is very clear and easily understandable and Document is very
helpful.
Madhukumar
Syed Mehtab
Hi,
Thanks
George Ressos
https://blogs.sap.com/2013/09/19/creating-vofm-custom-routine-functionality-same-as-sap-standard-routine-103-with-additional-functionality/ 17/21
11/22/2017 Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality | SAP Blogs
SANJIT BHATTACHARYA
ABAP-SOFOS S0012820640
Anbuselvan SD
Hi Mohammed,
Thank you for the well illustrated document. It would be helpful for newbies like
myself. But I am unable to understand the business need to ll the xed value date
(VBKD_VALDT) with the billing reference date (VBRK_FKDAT).
In what scenario, the business would like to have this kind of requirement.. since we
have a field called service rendered date..
https://blogs.sap.com/2013/09/19/creating-vofm-custom-routine-functionality-same-as-sap-standard-routine-103-with-additional-functionality/ 18/21
11/22/2017 Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality | SAP Blogs
Tanmay Verma
Hi ,
Regards
Aspire WF
Mohammed,
BR,
Aspire
Santhanakrishnan Arumugam
Hi,
https://blogs.sap.com/2013/09/19/creating-vofm-custom-routine-functionality-same-as-sap-standard-routine-103-with-additional-functionality/ 19/21
11/22/2017 Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality | SAP Blogs
Hussain Lalji
Could you also tell me how to segregate customer line item in billing document into
different business areas?
Sandeep Kumar
Hi,
Very helpful.
Thanks,
Sandeep Kumar S
Just an aclaration, when adding the program RV80HGEN to the Transport Request,
it should be of type XPRA, and not PROG. As the description says: Program
executed after transport
https://blogs.sap.com/2013/09/19/creating-vofm-custom-routine-functionality-same-as-sap-standard-routine-103-with-additional-functionality/ 20/21
11/22/2017 Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality | SAP Blogs
https://blogs.sap.com/2013/09/19/creating-vofm-custom-routine-functionality-same-as-sap-standard-routine-103-with-additional-functionality/ 21/21