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

Running programms in parallel

Former Member
0 Likes
527

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 ?

4 REPLIES 4
Read only

Former Member
0 Likes
504

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

Read only

Former Member
0 Likes
504

in prg1 after write command

submit prg2 and return.

Read only

0 Likes
504

but in prog1 i want to call the 2nd prog before write such that both progs run in parallel ....

Read only

Former Member
0 Likes
504

You have to use SUBMIT with additions EXPORTING LIST TO MEMORY and AND RETURN statements. Below example can help you understand. Report1:

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.
Report2:
WRITE:/'B'.