creating vofm custom routine

Upload: ashok-kumar-kethineni

Post on 15-Oct-2015

423 views

Category:

Documents


11 download

DESCRIPTION

Creating VOFM Custom Routine

TRANSCRIPT

  • 5/26/2018 Creating VOFM Custom Routine

    1/12

    Creating VOFM custom routine, functionality same as SAP standard routine 103 with

    Additional Functionality

    1. Introduction

    1.1 Document Purpose

    1.2 This is the document helps you to create custom routine for sales order for below specific

    requirement:

    Functional description:

    In case of sale order with the SD document category Kor Lor Hrelated to an invoice, we need to fill

    the fixed 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 fixed value date equal to the billing

    reference date.

    http://scn.sap.com/servlet/JiveServlet/showImage/102-46586-3-282456/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/102-46586-3-282562/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/102-46586-3-282456/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/102-46586-3-282562/Capture.JPG
  • 5/26/2018 Creating VOFM Custom Routine

    2/12

    As per the requirement:

    Sap standard routine 103triggers whenever sales order is being created with reference. Sap standard

    routine is configured in VOFM transaction as:

    http://scn.sap.com/servlet/JiveServlet/showImage/102-46586-3-282464/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/102-46586-3-282599/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/102-46586-3-282464/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/102-46586-3-282599/Capture.JPG
  • 5/26/2018 Creating VOFM Custom Routine

    3/12

    Sap standard routine 103has 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.

    About VOFM Transaction:

    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.

    http://scn.sap.com/servlet/JiveServlet/showImage/282466/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282465/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282466/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282465/Capture.JPG
  • 5/26/2018 Creating VOFM Custom Routine

    4/12

    Here we have four important menus:

    i) Copying requirementsii) Data transferiii) Requirementsiv) Formulas

    Steps to create the custom routine:

    1) Go to transaction VOFMData transfer Orders

    2) Provide a custom routine name

    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.

    http://scn.sap.com/servlet/JiveServlet/showImage/282474/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282473/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282474/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282473/Capture.JPG
  • 5/26/2018 Creating VOFM Custom Routine

    5/12

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

    Now double click on data element and see the domain values as:

    http://scn.sap.com/servlet/JiveServlet/showImage/282476/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282475/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282476/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282475/Capture.JPG
  • 5/26/2018 Creating VOFM Custom Routine

    6/12

    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 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:

    http://scn.sap.com/servlet/JiveServlet/showImage/282482/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282478/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282482/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282478/Capture.JPG
  • 5/26/2018 Creating VOFM Custom Routine

    7/12

    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:

    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:

    http://scn.sap.com/servlet/JiveServlet/showImage/282484/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282483/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282484/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282483/Capture.JPG
  • 5/26/2018 Creating VOFM Custom Routine

    8/12

    Now as per requirement above we have written following code:

    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:

    http://scn.sap.com/servlet/JiveServlet/showImage/282504/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282488/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282504/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282488/Capture.JPG
  • 5/26/2018 Creating VOFM Custom Routine

    9/12

    Even if any error occurs then we need to run the SAP standard program RV80HGENto regenerate all

    VOFM routines.

    Testing:

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

    http://scn.sap.com/servlet/JiveServlet/showImage/282511/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282510/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282509/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282511/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282510/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282509/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282511/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282510/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282509/Capture.JPG
  • 5/26/2018 Creating VOFM Custom Routine

    10/12

    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

    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.

    http://scn.sap.com/servlet/JiveServlet/showImage/102-46586-3-282595/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282525/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/102-46586-3-282594/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/102-46586-3-282595/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282525/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/102-46586-3-282594/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/102-46586-3-282595/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282525/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/102-46586-3-282594/Capture.JPG
  • 5/26/2018 Creating VOFM Custom Routine

    11/12

    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

    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 RV80HGENmanually 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:

    http://scn.sap.com/servlet/JiveServlet/showImage/282534/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282533/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282534/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282533/Capture.JPG
  • 5/26/2018 Creating VOFM Custom Routine

    12/12

    Depending upon the action the TRFM or TRFMT entries gets updated automatically as:

    http://scn.sap.com/servlet/JiveServlet/showImage/282545/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282535/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282545/Capture.JPGhttp://scn.sap.com/servlet/JiveServlet/showImage/282535/Capture.JPG