‎2009 Jun 08 8:23 AM
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
‎2009 Jun 08 8:26 AM
Dear Balu,
Try to append records into inernal table in Loop.
Regards,
Vijay
‎2009 Jun 08 8:27 AM
‎2009 Jun 08 8:27 AM
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.
‎2009 Jun 08 8:33 AM
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.
‎2009 Jun 08 8:37 AM
just a small change in the query.
ITAB3 has all the data, but while displaying only 1st iteration data is getting displayed.
Regards
Balu
‎2009 Jun 08 9:11 AM
‎2009 Jun 08 9:47 AM
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.