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

Export & Import internal table data across the programs

Former Member
0 Likes
805

Hi All,

I have two different reports,let say ZPRO1 & ZPRO2. I want to export internal table data of ZPRO1 to ZPRO2 and then I want to do some calculations in ZPRO2 with the imported internal table data(ZPRO1).

If I use 'SUBMIT' or CALL TRANSACTION syntax ZPRO1 is displaying..but I want to use only internal table data of ZPRO1.

Pls advise.

Pranitha.

5 REPLIES 5
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
743

I understand that these programs are custom! The easiest(and convenient) solution would be to EXPORT the internal table of ZPRO1 to some memory cluster & later on IMPORT it in ZPRO2.

Since you intend to SUBMIT ZPRO1, you must remember accessing the table through the call stack is not an option!

BR,

Suhas

PS: Similar requirements have been discussed before in the forums, you can refer to those as well

Edited by: Suhas Saha on May 26, 2011 2:20 PM

Read only

Former Member
0 Likes
743

Hi Pranitha,

You can use export and import statements to use your programs.

In the first program, use EXPORT statement and in the sceond one you can IMPORT it.

For the sytax, press F1 key on the words EXPORT and IMPORT.

For variable we use EXPORT statement as below:

EXPORT V_BATCH_FLAG TO MEMORY ID 'ZCON_LM05'.

Thanks,

Archana

Read only

Former Member
0 Likes
743

EXPORT obj1 ... objn TO DATABASE dbtab(ar) ID key.

IMPORT obj1 ... objn FROM DATABASE dbtab(ar) ID key.

Read only

Former Member
0 Likes
743

Hi,

Please follow the simple code and try to solve your issue.

Code in program1


types: begin of ty_itab,
       matnr type matnr,
       end of ty_itab.

data: it_itab type table of ty_itab,
      wa_itab type ty_itab,
      it_itab1 type table of ty_itab.

select matnr from mara into table it_itab.

export it_itab to shared buffer indx(st) id 'ABC'.

Code in program2


types: begin of ty_itab,
       matnr type matnr,
       end of ty_itab.

data: it_itab type table of ty_itab,
      wa_itab type ty_itab.

import it_itab from shared buffer indx(st) id 'ABC'.
 loop at it_itab into wa_itab.
 write:/ wa_itab-matnr.
 endloop.

Please delete shared buffer indx(st) id 'ABC', once we don't need the internal table data.

Regards

Dande

Read only

Former Member
0 Likes
743

Answered.