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 program & return

Former Member
0 Likes
486

I m having 2 programs separately.

in the first program i m calling the second program via submit .

If i use submit program & return means the control comes back to first program form second one .

But wat i need is i want to get values from the second program to first program through Internal table

Is this possible..

If yes maens can any one help me to solve this.

Thanks in advance.

Kalpanashri Rajendran

1 ACCEPTED SOLUTION
Read only

ferry_lianto
Active Contributor
0 Likes
444

Hi Kalpanashri,

You can use EXPORT and IMPORT statement.

Please check this sample code.

Program A :

SELECT-OPTIONS: S_BELNR FOR BKPF-BELNR.

EXPORT S_BELNR TO MEMORY ID 'ZXC9'.

Program B :

DATA: BEGIN OF S_BELNR OCCURS 10.

INCLUDE STRUCTURE STRUC1.

DATA: LOW LIKE BKPF-BELNR,

HIGH LIKE BKPF-BELNR.

DATA: END OF S_BELNR.

IMPORT S_BELNR FROM MEMORY ID 'ZXC9'.

For EXPORT: http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/export01.htm

For IMPORT: http://www.geocities.com/siliconvalley/campus/6345/import01.htm

Hope this will help.

Regards,

Ferry Lianto

3 REPLIES 3
Read only

ferry_lianto
Active Contributor
0 Likes
445

Hi Kalpanashri,

You can use EXPORT and IMPORT statement.

Please check this sample code.

Program A :

SELECT-OPTIONS: S_BELNR FOR BKPF-BELNR.

EXPORT S_BELNR TO MEMORY ID 'ZXC9'.

Program B :

DATA: BEGIN OF S_BELNR OCCURS 10.

INCLUDE STRUCTURE STRUC1.

DATA: LOW LIKE BKPF-BELNR,

HIGH LIKE BKPF-BELNR.

DATA: END OF S_BELNR.

IMPORT S_BELNR FROM MEMORY ID 'ZXC9'.

For EXPORT: http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/export01.htm

For IMPORT: http://www.geocities.com/siliconvalley/campus/6345/import01.htm

Hope this will help.

Regards,

Ferry Lianto

Read only

0 Likes
444

Use export in the first program

and import the same mem ID in the second program

Regards

- Gopi

Read only

Former Member
0 Likes
444

1. You have to define an internal table ITAB in program AAA.

2. In the program AAA you export your ITAB to the memory.

EXPORT ITAB TO MEMORY ID 'TD' (ID is the name of memory, you don't need to create it ).

3. In program BBB you have to declare The same table (same table's name and same fields).

4. In BBB you can import ITAB :

IMPORT ITAB FROM MEMORY ID 'TD'