08-17-2006 8:36 AM
Hi all,
I'm struggling doing an export and import from dynamic internal tables to the memory through field-symbols.
My target is to export the itab in report 1 and import it in report 2.
I thin
mild attempt:
Report 1:
DATA: BEGIN OF itab
,
EXPORT itab from itab TO MEMORY ID memkey.
* submit diplay report
SUBMIT ('REPORT2')
WITH memkey = memkey
AND RETURN.
REPORT 2:
PARAMETERS: memkey(60) TYPE c NO-DISPLAY.
FIELD-SYMBOLS: <itab> TYPE ANY TABLE.
IMPORT <itab> FROM MEMORY ID memkey.
This code doesn't work because the 'field symbol has not yet been assigned'.
Any ideas? Thanx in advance.
08-17-2006 8:42 AM
It will not work as you have not assigned any variable to the field symbol.
Define an internal table, ITAB2 in Report 2 with a structure similar to ITAB in Report1. Assign ITAB2 to the field-symbol <ITAB>.
i.e. ASSIGN ITAB2 to <ITAB>.
IMPORT <ITAB> FROM MEMORY ID memkey.
-Kiran
*Please reward useful answers
08-17-2006 8:46 AM
The problem is that you are missing the assign...the best soln is usually to have an include abap used by both abaps and define the internal table structure in it.
So you can easily export and import using ITAB.
Regards
Anurag
08-17-2006 12:02 PM
Both answers are correct. My problem is how to assign to a itab structure which is not known in report 2 because it's dynamic in report 1 as well.
I tried <i>DATA: itab TYPE REF TO data.</i> with <i>ASSIGN itab->* TO <itab>.</i> but this isn't possible either. Any other suggestions?
08-17-2006 12:07 PM
data : var type ref to data.
create var like line of (report2).
assign var->* to <fs>.
08-17-2006 12:48 PM
Thanx for your suggestion:
data : var type ref to data.
create var like line of (itab).
assign var->* to <fs>.
But how do I get the structure of the dynamic table of report 1 (itab) to report 2.
My problem to transfer the dynamic table (itab) from one report to another.
06-04-2007 4:35 PM
Dominik,
Did you get any answer for this?
Im in same situation too....any suggestions would be of great help to me.
-Bhaskar
08-01-2007 5:19 PM
I have the same problem ... If someone has a solution please post it.