10-04-2005 7:25 AM
hi
could anybody tell me
how to pass internal table between two reports..?
is ther any way ?
thanking you
Bharadwaj
10-04-2005 7:46 AM
Hi Bharadwaj,
You can pass internal table between two reports.
pls check the below code for the same.
REPORT ypa1_test10.
DATA : BEGIN OF itab OCCURS 0,
lin(80) TYPE c,
END OF itab.
itab-lin = 'This is first line.'.
APPEND itab.
itab-lin = 'This is second line.'.
APPEND itab.
EXPORT itab TO MEMORY ID 'ID1'.
SUBMIT yap1_test11.
second program
REPORT ypa1_test11.
DATA : BEGIN OF itab OCCURS 0 ,
lin(80) TYPE c,
END OF itab.
IMPORT itab FROM MEMORY ID 'ID1'.
itab-lin = 'In the second program'.
append itab.
LOOP AT itab.
WRITE 😕 itab-lin.
ENDLOOP.
I hope this will give some idea
Bye
Pavan
10-04-2005 7:29 AM
Bharadwaj,
Use IMPORT and EXPORT commands. This should solve your problem.
REgards,
Ravi
Note : Please remember to reward points if the answers help you.
10-04-2005 7:36 AM
Hi,
Place your ITAB in Include file.
You can call this Include where ever you want.
CHEERS
10-04-2005 7:46 AM
Hi Bharadwaj,
You can pass internal table between two reports.
pls check the below code for the same.
REPORT ypa1_test10.
DATA : BEGIN OF itab OCCURS 0,
lin(80) TYPE c,
END OF itab.
itab-lin = 'This is first line.'.
APPEND itab.
itab-lin = 'This is second line.'.
APPEND itab.
EXPORT itab TO MEMORY ID 'ID1'.
SUBMIT yap1_test11.
second program
REPORT ypa1_test11.
DATA : BEGIN OF itab OCCURS 0 ,
lin(80) TYPE c,
END OF itab.
IMPORT itab FROM MEMORY ID 'ID1'.
itab-lin = 'In the second program'.
append itab.
LOOP AT itab.
WRITE 😕 itab-lin.
ENDLOOP.
I hope this will give some idea
Bye
Pavan
10-04-2005 7:57 AM
10-04-2005 7:50 AM
Hi,
Passing data from one ABAP program to another:
1. You have to define an internal table ITAB in program AAA.
2. In the program AAA you export your ITAB to the memory.
<b> EXPORT ITAB TO MEMORY ID 'TD'</b> (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 :
<b>IMPORT ITAB FROM MEMORY ID 'TD'</b>
5. Now you can export it to AAA after modifications.
<b>EXPORT ITAB TO MEMORY ID 'TD'</b>
6. In AAA :
<b>IMPORT ITAB FROM MEMORY ID 'TD'</b>
This solution is independant to SUBMIT.
Hope it helps u
Thanks&Regards
Ruthra.R
10-04-2005 8:23 AM
Bharadwaj,
If you are done with the thread, request to please close the thread by clicking on the start icon, which indicate the question is resolved.
Regards,
Ravi
10-04-2005 8:36 AM
Hi,
The internal table contents that you pass to Memory ID using <b>IMPORT/EXPORT</b> statements will only be there for the current Session.
Say you call the same transaction( the program you are running now) again you won't get those contents.
In these cacse yiou need to use <b>DATABASE INDEX</b> to achieve this.
Please reward points if this explanation is useful.
Regards,
Siva
10-04-2005 8:49 AM
see basically yyou can transport the internal tabel in two ways
1 import/export - abap memory (in the same transaction )
2. INDX cluster database - SAp memory (B/W transaction ).
now.if you use first method try to use following syntax
export <itab> to memory <id>
and in the report wher you want to send you shoul write the folowing code in that report.
import <itab> from memory <id>
<id> should be same in both the cases this can be any valid unique number.
2. if you use the second methoduse this syntax.
export <itab> to INDX(ar) id <key>
in the report where you want to use wtite teh following code.
import <itab> from INDX(ar) id <key>
pls reply if any doubts
cheers