‎2008 Apr 03 7:20 AM
How can u run 2 programs in parallel such that ..FOR EXAMPLE a report program 1 has a statement 'WRITE 'A'.
report prog 2 has statement WRITE 'B'. NOW when my 1st prog calls 2nd prog then it should immediately return to 1st prog and the 2 programs should run in parallel such that th eoutput is:
A
B
WHAT IS THE CODE ?
‎2008 Apr 03 7:24 AM
Hi
Make use of the SUBMIT ...AND RETURN keyword in your first program so that the transfer is controlled to the 2nd program. After execution, control is returned back to 1st program.
Thanks
VIjay
‎2008 Apr 03 7:25 AM
‎2008 Apr 03 7:30 AM
but in prog1 i want to call the 2nd prog before write such that both progs run in parallel ....
‎2008 Apr 03 7:33 AM
You have to use SUBMIT with additions EXPORTING LIST TO MEMORY and AND RETURN statements.
Below example can help you understand.
Report1:
Report2:
DATA: i_list TYPE TABLE OF abaplist.
WRITE:/ 'A'.
SUBMIT report2 EXPORTING LIST TO MEMORY AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = i_list
EXCEPTIONS
not_found = 1
OTHERS = 2.
CALL FUNCTION 'WRITE_LIST'
EXPORTING
write_only = 'X'
TABLES
listobject = i_list
EXCEPTIONS
empty_list = 1
OTHERS = 2.WRITE:/'B'.