Application Development 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: 

Exporting an internal table to memory

Former Member
0 Kudos

Hi

I want to call an program from another program and want the values stored in an internal table used in the called program.

how can i export an internal table to memory id an then import it.

Regards

Arun

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Arun,

This is pretty simple, just go:


* From calling program
  EXPORT it_itab TO MEMORY ID 'ZZ_MEM_ID'.

* From within called program
  IMPORT it_itab FROM MEMORY ID 'ZZ_MEM_ID;.

Brad

6 REPLIES 6

Former Member
0 Kudos

Hi Arun,

This is pretty simple, just go:


* From calling program
  EXPORT it_itab TO MEMORY ID 'ZZ_MEM_ID'.

* From within called program
  IMPORT it_itab FROM MEMORY ID 'ZZ_MEM_ID;.

Brad

0 Kudos

Remember also that the internal table must be declared in both programs and must have the <b>same structure and the same name.</b>

Brad

0 Kudos

Hi brad ,

Thank you for the response, do we write the import statement in the called program or in the calling program?

I want to process data retrieved from the called program in the calling program, will the data be available in the calling program if I import it in the called program.

Regards

Arun

0 Kudos

Sorry Arun,

It doesn't matter which program is the calling or the called program. You can use these statements in both directions.

But for your example, put the EXPORT statement in the called program (to export the final internal table to memory), and then put the IMPORT statement in the calling program (to get the results back).

Hope thats clearer now.

Cheers,

Brad

0 Kudos

So to be clear, for your requirement it would be:


* Towards the end of the called program
  EXPORT it_itab TO MEMORY ID 'ZZ_MEM_ID'.
.
.
.
* And then from calling program after the submit zzzz and return statement
  IMPORT it_itab FROM MEMORY ID 'ZZ_MEM_ID'.

Hope that helps.

Brad

Message was edited by: Brad Williams (put back intro text)

Message was edited by: Brad Williams

0 Kudos

Hi Brad ,

Thank you , your solution gives the perfect result.

Regards

Arun