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: 

export / import dynamic itab to memory

Former Member
0 Kudos

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.

7 REPLIES 7

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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?

hymavathi_oruganti
Active Contributor
0 Kudos

data : var type ref to data.

create var like line of (report2).

assign var->* to <fs>.

0 Kudos

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.

Former Member
0 Kudos

Dominik,

Did you get any answer for this?

Im in same situation too....any suggestions would be of great help to me.

-Bhaskar

0 Kudos

I have the same problem ... If someone has a solution please post it.