Application Development and Automation 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: 
Read only

Export internal table to memory.

Former Member
0 Likes
12,225

How can I export and import an internal table to memory?

This:

export messtab to memory id 'TAB'. (in program 1)

import messtab=messtab from memory id 'TAB'. (in program 2)

does not work.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
4,159

HI friend,

Just use:

Export Int_table to memory id 'xyz'

import int_table from memory id 'xyz'.

Thanks,

neel

15 REPLIES 15
Read only

Former Member
0 Likes
4,159

Hi,

Use export to database instead...

Br/Manas

Read only

0 Likes
4,159

I can't. Isn't there any way to export to memory?

Read only

0 Likes
4,159

This message was moderated.

Read only

Former Member
0 Likes
4,159

data: lt_idoc_status1 type standard table of bdidocstat.

export lt_idoc_status1 to memory id 'IDOC_STATUS1'.

Import lt_idoc_status1 from memory id 'IDOC_STATUS1' .

Edited by: Poorna Chandrasekhar on Apr 29, 2009 4:55 PM

Read only

0 Likes
4,159

I can't see any difference except for the suppresion of the =messtab (incidentally, I have already tried without it, and it doesn't seem to work...)

Can it be because of the table type? Mine is a standard table of bapireturn.

Thanks.

Read only

Former Member
0 Likes
4,159

Hi,

In program 1.

EXPORT messtab[] TO MEMORY ID 'ABC'.

in program 2.

IMPORT messtab[] FROM MEMORY ID 'ABC'.

Rgds

Siva

Read only

0 Likes
4,159

I'll try the brackets, thanks.

Read only

0 Likes
4,159

Even without the brackets it doesn't work.

In program 1 I have:

WRITE text-e21 TO messtab-message.

messtab-type = c_tipo_error.

APPEND messtab. CLEAR messtab.

DELETE messtab WHERE message = space.

EXPORT messtab[] TO MEMORY ID para.

EXIT.

The EXIT leads to program 2, from where I made a submit to program 1, and where I have:

import messtab[] from memory id para.

Where:

DATA: para TYPE tpara-paramid VALUE 'MES',

messtab TYPE TABLE OF bapireturn WITH HEADER LINE.

What's wrong?

Thanks in advance.

Oh, and I've checked the table in program 1 does have an entry.

Read only

0 Likes
4,159

Hi,

Try this way

EXPORT (messtab) TO MEMORY ID para.

IMPORT (messtab) FROM MEMORY ID para.

OR

EXPORT messtab FROM messtab TO MEMORY ID para.

IMPORT messtab TO messtab FROM MEMORY ID para.

Regards,

Siddarth

Read only

0 Likes
4,159

Hi,

Try like this while exporting.No need of declaring PARA. It should be in quotes.

DATA: messtab TYPE TABLE OF bapireturn WITH HEADER LINE.

WRITE text-e21 TO messtab-message.

messtab-type = c_tipo_error.

APPEND messtab. CLEAR messtab.

DELETE messtab WHERE message = space.

EXPORT messtab TO MEMORY ID 'PARA'.

EXIT.

import messtab from memory id 'PARA'.

Read only

Former Member
0 Likes
4,160

HI friend,

Just use:

Export Int_table to memory id 'xyz'

import int_table from memory id 'xyz'.

Thanks,

neel

Read only

Former Member
0 Likes
4,159

Hello,

The code below should work.

 EXPORT messagetab TO MEMORY ID 'ZMESGTAB' 

To further import, use:

 IMPORT messagetab TO itab                " MESSAGETAB was exported
             FROM MEMORY ID 'ZMESGTAB'.

Regards,

Eduardo

Read only

Former Member
0 Likes
4,159

The problem has disappeared, I'm not sure why. Maybe because I changed the internal table to one without header line. Thanks to all for your answers.

Read only

0 Likes
4,159

I can verify that I had the same problem and it cleared up from my EXPORT statement when I removed the header line from my internal table, but it is still happening when I try to IMPORT. I get the following syntax error:

"FIELD "'BADI_OFFINV_DETAIL'" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. "DATA" statement."

Edited by: James Smith on Jul 16, 2009 12:28 AM

Read only

Former Member
0 Likes
4,159

I'm a little bit late, but this could help.

You can also pass internal table with IMPORT/EXPORT statement using deserialization like this :

DATA :

xml type string,

my_itab type table of stuff.

* 1) DESERIALIZATION

CALL TRANSFORMATION id

  SOURCE zit_fields = my_itab "don't forget to add brackets with header line : my_itab[]

  RESULT XML xml.

EXPORT xml TO MEMORY ID 'MYID'.

* .../...

IMPORT xml FROM MEMORY ID 'MYID'.

* 2 ) SERIALIZATION

CALL TRANSFORMATION id

  SOURCE XML xml

  RESULT zit_fields = my_itab.