05-26-2005 4:28 PM
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
05-26-2005 4:36 PM
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
05-26-2005 4:36 PM
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
05-26-2005 4:37 PM
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
05-26-2005 5:16 PM
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
05-26-2005 5:23 PM
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
05-26-2005 9:09 PM
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
05-27-2005 5:27 PM
Hi Brad ,
Thank you , your solution gives the perfect result.
Regards
Arun