Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Small Problem with calling a form

Former Member
0 Likes
1,095

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,063

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.

7 REPLIES 7
Read only

Former Member
0 Likes
1,064

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.

Read only

0 Likes
1,063

Hi,

like 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

Read only

arivazhagan_sivasamy
Active Contributor
0 Likes
1,063

Hi Anushka,

Can you declare as

Perform zabc tables itab.

Arivazhagan S

Read only

Former Member
0 Likes
1,063

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

Read only

thangam_perumal
Contributor
0 Likes
1,063

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

Read only

Former Member
0 Likes
1,063

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

Read only

0 Likes
1,063

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.