‎2007 May 10 9:45 AM
In this context, i got a help from the following SDN link:
I Referred Rich Heilman's post and develop the following two program:
report z_82235_test1_fs .
data: itab type table of string with header line.
field-symbols: <fs> type table.
itab = 'This is the line 1'. append itab.
itab = 'This is the line 2'. append itab.
perform simulate_function_call in program z_82235_test2_fs.
REPORT Z_82235_TEST2_FS .
perform simulate_function_call.
form simulate_function_call .
field-symbols: <fs> type table.
data: wa type string.
data: pointer_tab(20) type c.
pointer_tab = '(Z_82235_TEST1_FS)ITAB[]'.
assign (pointer_tab) to <fs>.
loop at <fs> into wa.
write:/ wa.
endloop.
endform. " simulate_function_callBut while execution i am getting runtime error. Could anyone plz tell me the reason and what correction i have to do to make my code work???
‎2007 May 10 9:56 AM
The error occurs because your pointer_tab is only 20 chars long, so the name that it stores is (Z_82235_TEST1_FS)IT, instead of (Z_82235_TEST1_FS)ITAB[]. It cannot find such an itab, and errors out.
You will need to either shorten your program name, or increase the length of pointer_tab.
Hope this helps.
Sudha
‎2007 May 10 9:56 AM
The error occurs because your pointer_tab is only 20 chars long, so the name that it stores is (Z_82235_TEST1_FS)IT, instead of (Z_82235_TEST1_FS)ITAB[]. It cannot find such an itab, and errors out.
You will need to either shorten your program name, or increase the length of pointer_tab.
Hope this helps.
Sudha
‎2007 May 10 10:07 AM
‎2007 May 10 10:06 AM
Did you activated both the programs before executing & change Pointer length as I run them and they are executing.
Remember these are two different reports in SE38.
this is first -
report z_82235_test1_fs .
data: itab type table of string with header line.
field-symbols: <fs> type table.
itab = 'This is the line 1'. append itab.
itab = 'This is the line 2'. append itab.
perform simulate_function_call in program z_82235_test2_fs.
This is second -
REPORT Z_82235_TEST2_FS .
perform simulate_function_call.
form simulate_function_call .
field-symbols: <fs> type table.
data: wa type string.
data: pointer_tab(<b>30</b>) type c.
pointer_tab = '(Z_82235_TEST1_FS)ITAB[]'.
assign (pointer_tab) to <fs>.
loop at <fs> into wa.
write:/ wa.
endloop.
endform. " simulate_function_call
Activate both.
Regards,
Amit