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

Calling Prog uses Include Form/Need to pass itab to and from the includ

What is te best method?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Dec 04, 2007 at 06:45 PM

    Hi,

    You can specify the name of a subroutine and, in the case of external calls, the name of the program in which it occurs, dynamically as follows:

    PERFORM (<fsubr>)[IN PROGRAM (<fprog>)][USING   ... <pi>... ] 
                                           [CHANGING... <pi>... ] 
                                           [IF FOUND].
    

    The names of the subroutine and the external program are the contents of the fields <fsubr> and <fprog> respectively. By using the option IF FOUND, you can prevent a runtime error from being triggered if <fprog> does not contain a subroutine with the name <fsubr>. If you omit the parentheses, this variant of the PERFORM statement behaves like the static variant.

    Regards,

    Ferry Lianto

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 06:52 PM

    Check the below example :

    PERFORM write_2_server TABLES hire_emp_tab.

    PERFORM write_2_server TABLES entrance_tab.

    PERFORM write_2_server TABLES integration_tab.

    PERFORM write_2_server TABLES duty_tab .

    PERFORM write_2_server TABLES type_emp_tab.

    PERFORM write_2_server TABLES job_part_tab .

    PERFORM write_2_server TABLES free_days_tab.

    PERFORM write_2_server TABLES status_tab.

    PERFORM write_2_server TABLES bank_detailes_tab.

    FORM write_2_server TABLES p_tab_data.

    FIELD-SYMBOLS: <wa> TYPE ANY.

    " MOVE 'D:_pa_test_mmsk_pa1.txt' TO adress.

    OPEN DATASET adress IN TEXT MODE

    ENCODING DEFAULT FOR OUTPUT.

    IF sy-subrc = 0.

    no_file = ' '.

    LOOP AT p_tab_data ASSIGNING <wa>.

    TRANSFER <wa> TO adress.

    ENDLOOP.

    CLOSE DATASET adress.

    ELSE.

    no_file = 'X'.

    ENDIF.

    endform.

    you get reusability.

    Thanks

    Seshu

    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.