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

Problem in exporting in another program.

Former Member
0 Likes
425

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_call

But 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???

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
404

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

3 REPLIES 3
Read only

Former Member
0 Likes
405

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

Read only

0 Likes
404

Thank u Sudha.

Read only

amit_khare
Active Contributor
0 Likes
404

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