Vous êtes sur la page 1sur 21

11/22/2017 Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality | SAP

ality | SAP Blogs

Products
Products Industries
Industries Support
Support Training
Training Community
Community Developer
Developer Partner
Partner

About
About


Home / Community / Blogs + Actions

Creating VOFM custom routine, functionality


same as SAP standard routine 103 with
Additional Functionality
September 19, 2013 | 16,157 Views |

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

1.1 Document Purpose

2 This is the document helps you to create custom


routine for sales order for below specific requirement:

Func onal descrip on:

In case of sale order with the SD document category K or L or H related to


an invoice, we need to ll the xed value date (VBKD_VALDT) with the billing
reference date (VBRK_FKDAT).

For example:

Invoice 90001111, the billing date is 22.07.2013

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

As per the requirement:

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

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.

About VOFM Transac on:

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.

Here we have four important menus:

i) Copying requirements
ii) Data transfer
iii) Requirements
iv) Formulas
Steps to create the custom rou ne:

1) Go to transaction VOFMData transfer Orders

2) Provide a custom routine name

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.

Go to transaction VOFN place the cursor on class input and press


F1 key.

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:

All the fixed values are Group Indicator Code.

Standard SAP routine name starts from 1 to 599.

So all custom name starts from 600 to 999.

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).

1) Double click on the custom routine 901


A modification message appears as:

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:

Now as per requirement above we have written following code:

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

RV80HGEN to regenerate all VOFM routines.

Testing:

The Billing Document 90000112 has been used to create the Sales order :

It has the fixed value date : 22.07.2013

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

Reference document has been taken as billing document(9000112) as


mentioned above.

After clicking on the copy option, a screen will open having the information of
the sales order.

Transporting the custom routine to different system:

Program RV80HGEN can be used to re-generate all VOFM routines. Whenever


VOFM

routines are transported this program should be executed in all target systems.
It is

possible to include an automatic execution of the program in the transport


request by

applying OSS note 598475.

It can be added to the transport request of the custom routine include as:

Double click on the transport request


https://blogs.sap.com/2013/09/19/creating-vofm-custom-routine-functionality-same-as-sap-standard-routine-103-with-additional-functionality/ 11/21
11/22/2017 Creating VOFM custom routine, functionality same as SAP standard routine 103 with Additional Functionality | SAP Blogs

Open it in change mode and provide input as shown below:

And press enter and save.

So when this transport is sent to target system then it gets executed


automatically.

Even if it does not work then we need to run SAP standard program
RV80HGEN manually in the target system.

Activation OR Deactivation Of Custom Routine:

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

September 19, 2013 at 1:18 pm

Hai wonderful document you have shared , really this is very helpful for functional
consultants

thanks a lot

Mohammed Khurshed Post author

September 19, 2013 at 1:33 pm

You are always welcome

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

September 20, 2013 at 4:13 am

Good work,thanks for posting this.

What will be the use of having fixed value date equal to billing date.

Ravin NK

December 11, 2013 at 11:50 pm

That way we are just controlling that the customers due date to pay the
invoice starts on the day he was billed.

Debopriya Ghosh

October 4, 2013 at 1:07 pm

Helpful document..

Mahe jyothi

October 5, 2013 at 5:30 am

good work.. really helpful

VIJAYA SIMHA CHINTARLAPALLI REDDY

December 11, 2013 at 6:05 am

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

December 19, 2013 at 2:37 pm

Hi

I can suggest you these notes

SAP Note 156230 Requirements: What is permitted, what is not?

SAP Note 22808 Transferring formulas

SAP Note 326560 Various problems when using VOFM functions

SAP Note 356737 Customer name range for VOFM routines

SAP Note 381348 Using user exit, customer exit, VOFM in SD

SAP Note 327220 VOFM function and its objects

Regards

Eduardo

madhu kumar

March 19, 2014 at 6:06 am

Thank you very much your suggession and it is really


helpful .

Deep K

December 19, 2013 at 1:20 pm

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

December 19, 2013 at 1:43 pm

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:

Subsequent functions from 900 to 999 (FOFU this case)

Group key routines from 50 to 99

Data transfer routines f. texts from 50 to 99

all other indicators from 600 to 999

Regards

Eduardo

varun yadav

December 30, 2013 at 3:31 pm

Nice.

Helpful.

Rampe V

February 6, 2014 at 3:45 am

Hello Mohammed Khurshed,

Useful document.

Thank You.

Shiva Vasireddy

March 7, 2014 at 9:16 am

This is Very Helpful Document

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

March 19, 2014 at 6:02 am

Hello Mohammed Khurshed,

Your Explanation is very clear and easily understandable and Document is very
helpful.

Continue the good work..

Thanks and Best Regards,

Madhukumar

Mohammad Fazhlay Elahi

April 7, 2014 at 3:45 pm

very useful document

Syed Mehtab

January 8, 2015 at 5:06 am

Hi,

very helpful document.

i look forward to other scenarios based VOFM

Thanks

George Ressos

January 8, 2015 at 7:20 am

Very good and helpfull document.

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

January 8, 2015 at 11:02 am

Very good document waiting for more such kind of documents.

ABAP-SOFOS S0012820640

April 21, 2015 at 1:44 pm

Very good document, thanks for sharing, it was usefull.

Anbuselvan SD

May 4, 2015 at 11:53 pm

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

August 3, 2015 at 10:26 am

Very well documented. Thanks a lot.

VENKATA RAMIREDDY KONDURI

August 3, 2015 at 11:10 am

Hi ,

very usfull document . thanks alot for sharing ..

Regards

venkata rami reddy konduri

Aspire WF

January 27, 2016 at 2:36 pm

Mohammed,

Extremely helpful. Great post! Thanks a lot for sharing.

BR,

Aspire

Santhanakrishnan Arumugam

April 29, 2016 at 6:40 am

Hi,

Great post keep going, Good Luck

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

June 20, 2016 at 5:03 am

Dear Mohammed Khurshed,

Thank you for posting such a detailed document.

Could you also tell me how to segregate customer line item in billing document into
different business areas?

Sandeep Kumar

June 28, 2016 at 12:34 pm

Hi,

Thank you so much.

Right document what I was looking for.

Very helpful.

Thanks,

Sandeep Kumar S

Christian Tapia Sabogal

April 20, 2017 at 8:37 pm

Thanks for this post!!

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

Share & Follow


Privacy Terms of Use Legal Disclosure Copyright Trademark Sitemap Newsletter

https://blogs.sap.com/2013/09/19/creating-vofm-custom-routine-functionality-same-as-sap-standard-routine-103-with-additional-functionality/ 21/21

Vous aimerez peut-être aussi