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 with Submitt statement

Former Member
0 Likes
703

Hi Experts,

There are two prgrams let say X and Y.

1) I am calling program Y inside the loop of X program using Submitt statement and exporting the output of Y program to memory.

2) Inside the same loop i am using FM LIST_FROM_MEMORY to get the output into an internal table(ITAB1).

3) After getting the output i am moving the contents of ITAB1 to ITAB2. This process is repeated till the end of the loop.

4) After the end of the loop, I am passing ITAB2 data to FM LIST_TO_ASCI, and getting output of this FM to ITAB3.

The problem is, if there the loop iterates for 2 times, ITAB3 contains data only of 1st iteration but 2nd iteration data is missing.

Please suggest a solution to this problem.

Regards

Balu

7 REPLIES 7
Read only

Former Member
0 Likes
673

Dear Balu,

Try to append records into inernal table in Loop.

Regards,

Vijay

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
673

Debug it... i think its getting overwritten or cleared !!!

Read only

Former Member
0 Likes
673

Hello,

Please check if there is no data getting exported from program Y.

It is better to clear the work area and the table itab1 at every loop pass.

Instead of directly assigning itab1 to itab2, if you want all the data in itab2, use the statement,

"Append lines of itab1 to itab2."

Hope this helps.

Read only

Former Member
0 Likes
673

Hi,

Check FM LIST_FROM_MEMORY ..it is reading First list again and again. Check in debugging or check wether in each loop list is getting generated or not.

Read only

0 Likes
673

just a small change in the query.

ITAB3 has all the data, but while displaying only 1st iteration data is getting displayed.

Regards

Balu

Read only

Former Member
0 Likes
673

can you paste your code?

Read only

0 Likes
673

Loop at gt_upload into wa_upload.

Submit..................

..................

....................

  • Import the. outport present in the memory

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

listobject = list_tab

EXCEPTIONS

not_found = 1

OTHERS = 2.

IF sy-subrc = 0.

REFRESH: gt_calldata.

IF gt_list IS INITIAL.

gt_list[] = list_tab[].

ELSE.

APPEND LINES OF list_tab TO gt_list.

ENDIF.

endloop.

IF sy-subrc = 0.

CALL FUNCTION 'WRITE_LIST'

TABLES

listobject = gt_list[].

ENDIF.