‎2014 Jan 08 6:53 AM
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.
‎2014 Jan 08 7: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.
‎2014 Jan 08 7: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.
‎2014 Jan 08 7:16 AM
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
‎2014 Jan 08 7:05 AM
Hi Anushka,
Can you declare as
Perform zabc tables itab.
Arivazhagan S
‎2014 Jan 08 7: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
‎2014 Jan 08 7: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
‎2014 Jan 08 7:18 AM
‎2014 Jan 08 7:20 AM
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.