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

program called by another program

Former Member
0 Likes
680

how do u call a program from another program?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
662

<b>Refer below two program. Submit command will solve ur purpose. In the below, first program call the second one.</b>

report  z_82235_test1                           .

types: begin of tab1,
         a(1),
         b(1),
       end of tab1.

types: begin of tab2,
         c(1),
         d(1),
       end of tab2.

data: itab1 type table of tab1,
      wa1 like line of itab1,
      itab2 type table of tab2,
      wa2 like line of itab2.

wa1-a = '1'.
wa1-b = '2'.
append wa1 to itab1.
clear wa1.

wa1-a = '3'.
wa1-b = '4'.
append wa1 to itab1.
clear wa1.


export itab1 to memory id '001'.
export itab2 to memory id '002'.

submit z_82235_test2 and return exporting list to memory .


import itab1 from memory id '003'.
import itab2 from memory id '004'.

write:/ 'ITAB1'.
loop at itab1 into wa1.
write : / wa1-a, wa1-b.
clear: wa1.
endloop.

write:/ 'ITAB2'.
loop at itab2 into wa2.
write : / wa2-c, wa2-d.
clear: wa2.

report  z_82235_test2                           .

types: begin of tab1,
         a(1),
         b(1),
       end of tab1.

types: begin of tab2,
         c(1),
         d(1),
       end of tab2.

data: itab1 type table of tab1,
      wa1 like line of itab1,
      itab2 type table of tab2,
      wa2 like line of itab2.

import itab1 from memory id '001'.
import itab2 from memory id '002'.

itab2[] = itab1[].

wa1-a = 'a'.
wa1-b = 'b'.
append wa1 to itab1.
clear wa1.




export itab1 to memory id '003'.
export itab2 to memory id '004'.

5 REPLIES 5
Read only

Former Member
0 Likes
662

Hi,

Make use of <b>submit</b> statement.

  Submit ZREPORT and return.

Regards

Sailaja.

Read only

Former Member
0 Likes
663

<b>Refer below two program. Submit command will solve ur purpose. In the below, first program call the second one.</b>

report  z_82235_test1                           .

types: begin of tab1,
         a(1),
         b(1),
       end of tab1.

types: begin of tab2,
         c(1),
         d(1),
       end of tab2.

data: itab1 type table of tab1,
      wa1 like line of itab1,
      itab2 type table of tab2,
      wa2 like line of itab2.

wa1-a = '1'.
wa1-b = '2'.
append wa1 to itab1.
clear wa1.

wa1-a = '3'.
wa1-b = '4'.
append wa1 to itab1.
clear wa1.


export itab1 to memory id '001'.
export itab2 to memory id '002'.

submit z_82235_test2 and return exporting list to memory .


import itab1 from memory id '003'.
import itab2 from memory id '004'.

write:/ 'ITAB1'.
loop at itab1 into wa1.
write : / wa1-a, wa1-b.
clear: wa1.
endloop.

write:/ 'ITAB2'.
loop at itab2 into wa2.
write : / wa2-c, wa2-d.
clear: wa2.

report  z_82235_test2                           .

types: begin of tab1,
         a(1),
         b(1),
       end of tab1.

types: begin of tab2,
         c(1),
         d(1),
       end of tab2.

data: itab1 type table of tab1,
      wa1 like line of itab1,
      itab2 type table of tab2,
      wa2 like line of itab2.

import itab1 from memory id '001'.
import itab2 from memory id '002'.

itab2[] = itab1[].

wa1-a = 'a'.
wa1-b = 'b'.
append wa1 to itab1.
clear wa1.




export itab1 to memory id '003'.
export itab2 to memory id '004'.

Read only

0 Likes
662

Another way is :

1. add a t-code with the second program.

2. In first program use command "call transaction" to call the second program.

Read only

Former Member
0 Likes
662

Hi,

You can use SUBMIT statementto execute 1 program within another program

Revert back if any issues.

Regards,

Naveen.

Read only

Former Member
0 Likes
662

hi,

use submit option.

submit <Program name> with <select-options> and return.

Reward with points if useful.