Skip to Content
author's profile photo Former Member
Former Member

HOw can we Call Subroutine in Sap Script?

HOw can we Call Subroutine in Sap Script?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 11:02 AM

    Hi

    Go through the following link

    http://www.allinterview.com/showanswers/37425.html

    <b>Rewards Point if Useful</b>

    Regards

    Saket Sharma

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 22, 2007 at 11:02 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 11:07 AM
    Hi 
    *You have to call sub routine from script like this.
    
    /:   PERFORM DATE_FORMAT IN PROGRAM &SY-REPID&
    /:   USING &RM06P-LFDAT&
    /:   USING &PEKKO-LFDAT&
    /:   CHANGING &VALUE_OLD&
    /:   CHANGING &VALUE_NEW&
    /:   ENDPERFORM
    
    *In print program write code.
    FORM date_format TABLES in_tab STRUCTURE itcsy
    out_tab STRUCTURE itcsy.
    
      DATA : date TYPE char10.
      DATA : date2 TYPE char10.
      DATA : l_dmbtr TYPE char10.
    
      READ TABLE in_tab WITH KEY 'RM06P-LFDAT'.
      IF sy-subrc = 0.
        "Your code goes here
        CLEAR l_dmbtr.
      ENDIF.
    
      READ TABLE in_tab WITH KEY 'PEKKO-LFDAT'.
      IF sy-subrc = 0.
        l_dmbtr = in_tab-value.
        "Your code goes here
        CLEAR l_dmbtr.
      ENDIF.
    
      READ TABLE out_tab WITH KEY 'VALUE_NEW'.
        IF sy-subrc EQ 0.
            out_tab-value = date2.
            MODIFY out_tab INDEX sy-tabix.
        ENDIF.
      READ TABLE out_tab WITH KEY 'VALUE_OLD'.
        IF sy-subrc = 0.
            out_tab-value = l_dmbtr.
            MODIFY out_tab INDEX sy-tabix.
        ENDIF.
    ENDFORM.            "DATE_FORMAT
    
    
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.