‎2008 Nov 28 9:29 AM
Hi,
I have a program ztest1 from which i want to call ztest2 .
In ztest2 there is a Internal table defined It_out whoes data i want to use in ztest1 without actually using ztables.
Pls note my aim is to get the data from program ztest2 to program ztest1.
i tried submit, it works fine , but i am not able to get the data in called program i.e. ztest1.
can anyone pls help...
Regards.
Harish Kurup.
‎2008 Nov 28 9:45 AM
hi jayant,
can u explain it further.i am using ;
submit test2 and return. " (test2 has internal table it_out whoes data i want in program test1).
do i need any addition in submit statement? and help me with further code.
‎2008 Nov 28 9:33 AM
‎2008 Nov 28 9:39 AM
Hi,
SUBMIT prog|(field) (AND RETURN)(options).
If you use AND RETURN, the system stores the data of the calling executable program and returns to the calling after processing the called program.
Edited by: Neenu Jose on Nov 28, 2008 10:40 AM
‎2008 Nov 28 9:47 AM
hi Neenu ,
where is the data stored in memory and how can i access it in called program after SUBMIT statement.
regards,
Harish Kurup.
‎2008 Nov 28 9:34 AM
Hello,
You can use Memory-ID for the same.
Pass the internal table to Memory Id using: EXPORT <ITAB> from MEMORY-ID 'MY MEMORY'.
Take the data from the memory in another program using: IMPORT <itab> to MEMORY-ID 'MY MEMORY'.
You will be able to access the programs data if both the program runs in the same session. Memory ID uses the ABAP memory space to hold data and Garbage collector deletes the data after the session is over as it does not finds any pointer pointing to that memry address.
Hope it helps.
Thanks,
Jayant
‎2008 Nov 28 9:38 AM
hI
use SET GET parameters to get the data of one program to another program
take the help of KEY word docu there is an example
Use INDX table
regards
Ramchander Rao.K
‎2008 Nov 28 9:45 AM
hi jayant,
can u explain it further.i am using ;
submit test2 and return. " (test2 has internal table it_out whoes data i want in program test1).
do i need any addition in submit statement? and help me with further code.
‎2008 Nov 28 9:46 AM
Hi,
Press F1 help on submit button to see it....U can get how the data is passed between the programs.
Regards,
Nagaraj
‎2008 Nov 28 9:48 AM
Hello Harish,
I have asked you to use the Memory ID concept. It works good. Please try and let me know in case of any issue.
Thanks,
Jayant
‎2008 Nov 28 10:23 AM
Hi Jayant,
calling program ......ztest1. ........here i use import.
called program.......ztest2. "(It_out) ......here i use export..
can u help with precise code for the same with definitions for the variables used..
‎2008 Nov 28 10:37 AM
Hello,
Below statement will put the value in SAP Memory.
EXPORT <your internal table/work area> TO MEMORY ID 'TEST_MEMORY'.
Below statement will get the value stored in internal table.
IMPORT <your internal table/work area> FROM MEMORY ID 'TEST_MEMORY'.
This is all from the syntax side. You can give any name to your memory id.
Thanks,
Jayant
‎2008 Nov 28 10:51 AM
‎2008 Nov 28 10:54 AM
i defined as follows,
memory_id type c.
export it_out from MEMORY_ID 'MEMORY'.
but it says
"Statement concluding with "...'MEMORY'" ended unexpectedly. "
‎2008 Nov 28 10:55 AM
>
> Hi,
> u made it very clear.
> How shall define "MEMORY ID".
Check Rich's post in the thread below, you have to make minor modifications to meet your requirement
use IMPORT statement after SUBMIT...AND RETURN statement in the calling program and EXPORT...in
the called program. You can use your own name for the memory ID.
‎2008 Nov 28 10:56 AM
Hello,
You do not need to define the Memory-id, it will be created at the run time i.e. space will be allocated to you as you encounter the statement export and this space will be deleted or marked for deletion as soon as the session in which your program is running in completed. Garbage collector for SAP will clear the SAP memory that you have utilized. Also, do not fear that you will be using enough memory of SAP which would be causing some problem in Production because there would also be other processes running because this will not take much of you SAP memory and will not effect the system much.
Thanks,
Jayant
‎2008 Nov 28 10:57 AM
Hello Harish,
Use below statement.
EXPORT <your internal table/work area> TO MEMORY ID 'TEST_MEMORY'.
Thanks,
Jayant
‎2008 Nov 28 11:13 AM
Thx Jayant,,,
Thx again.
It help me solve the problem..
Thx again..
‎2008 Nov 28 11:14 AM
‎2008 Nov 28 10:24 AM
use memory concept emport and import and surely it will work .............
see documention for export and import in abap help and write the code
‎2008 Nov 28 10:26 AM
suppose in ztest2 u have it_out internal table ..
u export in ztest2
write export it_out to memory id 'AA'.
then in ztest1 you import the same internal table as
import i_out from memory id 'AA'.
and now the data of it_out table will be available in the program ztest2