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

Submit a program in another program

Former Member
0 Likes
1,093

Hi All,

I have two programs PROG1 and PROG2. I am submitting PROG2 inside PROG1 using SUBMIT and RETURN statement.PROG2 has output in an internal table ITAB.When the call is passed back to PROG1 after using SUBMIT statement, I want the data in ITAB(of PROG2) in PROG1.How do I achieve this?using Exporting to list and exporting from list is not desirable here.

Thanks in advance

Sandeep

Edited by: sandeep akula on Apr 20, 2009 6:31 PM

9 REPLIES 9
Read only

Former Member
0 Likes
1,059

If saving file on the presentation server is an option then you can simply user GUI_Download and GUI_Upload.

Amit.

Read only

former_member194669
Active Contributor
0 Likes
1,059

Write itab to spool in PROG2 and read the spool in PROG1

a®

Read only

Former Member
0 Likes
1,059

Hi.

You can use EXPORT parameter in PROG 2 and IMPORT parameter in PROG1.

Hope it helps.

Sayan.

Read only

Former Member
0 Likes
1,059

Hi Sandeep,

1. U need to use IMPORT / EXPORT Parameters.

2. EXPORT ITAB TO MEMORY ID 'ITAB'.

IMPORT ITAB FROM MEMORY ID 'ITAB'.

Also Check this thread as a reference.

[Submit & Return|;

Thanks & regards,

Dileep .C

Read only

0 Likes
1,059

Use memory id for this.

Read only

Former Member
0 Likes
1,059

Hey,

Regarding this issue , the internal table can be passed to the driver program through import export parameters...

Cheers

Laveen

Read only

0 Likes
1,059

You can use import and export parameters.

import parameter id 'abc'.

export parameter id 'abc'.

Read only

Former Member
0 Likes
1,059

You can put the internal table data on the Application server(AL11) in the temp folder using OPEN DATASET.

And read it back in your PROG1

Read only

Former Member
0 Likes
1,059

PROGRAM1 write the following code

parameters:kunnr type kunnr.

data:g_kna1 type kna1.

select * from kna1 into g_kna1 where kunnr eq kunnr.

endselect.

WRITE:/ g_kna1-name1, G_KNA1-KUNNR.

PROGRAM2: write the following code

PARAMETERS:P_KUNNR TYPE KUNNR.

DATA gt_KNA1 TYPE TABLE OF abaplist.

submit ZQS_TEST_SUBMIT with kunnr = P_KUNNR exporting LIST TO MEMORY

AND RETURN.

CALL FUNCTION 'WRITE_LIST'

  • EXPORTING

  • WRITE_ONLY = 'X'

TABLES

LISTOBJECT = gt_kna1

  • EXCEPTIONS

  • EMPTY_LIST = 1

  • OTHERS = 2

.

you can also use FM LIST_FROM_MEMORY ,DISPLAY_LIST .

Cheers,

Shaik