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

Small Problem with calling a form

Dear Experts,

I have an internal table 'itab' declared in my program and there is an include 'zabc' in this include i have a form 'fill_itab'.

In this form itab is filled with several line items.

I call the form using

perform zabc changing itab[].

How do i declare the reference itab in the form ?

Thanks so much in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    Posted on Jan 08, 2014 at 07:04 AM

    option 1.

    Declare itab as global parameter, in the main program. All parameters in main program are also available in the include, provided, the include statement is given after the data declaration statement.

    Then just call subroutine.

    perform fill_itab. " No requirement of passing any parameters.

    opiton2.

    perform fill_itab TABLES itab.

    Form Fill_itab TABLES f_itab like itab[].

    endform.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      like @Susmitha Susan Thomas said you could used the LIKE statement.

      And others solution is to used a structure declare in the dictionary (SE11).

      And the last solution is to use a TYPES declaration. if your programs are not in the same master program, you could create an include with all the TYPES and make a reference on all the master program (like a TYPE POOL)

      regards

      Fred

  • Posted on Jan 08, 2014 at 07:05 AM

    Hi Anushka,

    Can you declare as

    Perform zabc tables itab.

    Arivazhagan S

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 08, 2014 at 07:06 AM

    Have a common top for the calling program and the include and declare your internal table in the top and you are good to go..

    Abhinab

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 08, 2014 at 07:18 AM

    Hi Anushka,

    if you using include zabc also in same program please refer below

    Perform fill_itab using itab.

    form fill_itab using itab.

    if it is an different program

    Perform fill_itab in program zabc using itab.

    form fill_itab using itab.

    let me know still if you are facing same problem.

    Regards,

    Thangam.P

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2014 at 07:18 AM

    Big Thank you to all of you.....

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Anuska-

      Here is how you can use CHANGING for internal tables .

      Example -

      TYPES : BEGIN OF t_itab,
      value TYPE char20,
      END OF t_itab.

      DATA : itab TYPE STANDARD TABLE OF t_itab,
      w_itab TYPE t_itab.

      w_itab-value = '0001'.
      PERFORM fill_itab USING w_itab
      CHANGING itab.

      FORM fill_itab USING wa TYPE any
      CHANGING ptab TYPE INDEX TABLE.
      APPEND wa TO ptab.

      ENDFORM.

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.