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

problem wid export / import internal table

former_member189410
Participant
0 Likes
1,290

hi,

standard report RFTBCF00 .

in the copy of standard report(ZRFTBCF00_BW ) i added the following as suggested.

export thead to memory id '001'.

export titem to memory id '002'.

submit ZRFTBCF00_BW and return exporting list to memory .

and in other program i added

import thead FROM MEMORY id '001'.

import titem from memory id '002'.

but wen i m checking the data the thead and titem both are initial.

plz letme know where m rong

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,114

Hi,

Try decalring the internal tables in same way at the sender & receiver and it must work. But don't forget to Free the memory.

Eg:

I have used in a BADI (OO)

TYPES: BEGIN OF it_cert,

ebelp TYPE ebelp,

matnr TYPE matnr,

charg TYPE charg_d,

lichn TYPE lichn,

cert(4) TYPE c,

END OF it_cert.

Data: ws_memid(10) TYPE c.

DATA wa_cert TYPE it_cert.

DATA t_cert TYPE STANDARD TABLE OF it_cert.

... After processing the internal table

ws_memid = 'CERT'.

EXPORT t_cert FROM t_cert TO MEMORY ID ws_memid.

In other BADI declaration is same.

ws_memid = 'CERT'.

IMPORT t_cert TO t_cert FROM MEMORY ID ws_memid.

FREE MEMORY ID 'CERT'.

Try to use this code.. I was able to Export the table & Imported by using in this BADI.

8 REPLIES 8
Read only

former_member189410
Participant
0 Likes
1,114

can any one let me know the reason why data is not coming

thnx,

points will b assigned

Read only

uwe_schieferstein
Active Contributor
0 Likes
1,114

Hello Nishu

THEAD and TITEM are defined as itabs with header lines:

************************************************************************
* Internal tables
************************************************************************
data:
   tfha     like vtbfha occurs 0,
   tfhapo   like vtbfhapo occurs 0,
   begin of thead occurs 0.
        include structure vtbfha.
data:
   xgsart(30) type c,
   xfhaart(30) type c,
end of thead,
begin of titem occurs 0.
        include structure vtbfhapo.
data:
   vgtyp(30) type c,
   xbewebe(30) type c,
   xbewart(30) type c,
   whwbetr like vtbfhapo-wzbetr,
end of titem.

Thus, if you export THEAD (or TITEM) you are exporting the <b>header line</b> which apprently is empty.

To export the itab body use:

EXPORT thead[] TO MEMORY ID '001'.
EXPORT titem[] TO MEMORY ID '001'.

Regards

Uwe

Read only

0 Likes
1,114

Thnx,

but still wen i m importing the table its coming empty.

Points will b assigned

Read only

Former Member
0 Likes
1,114

...

Message was edited by:

Sudheer Junnuthula

Read only

Former Member
0 Likes
1,114

Hi,

If you use these EXPORT and IMPORT atatment directly then that won't work in another Program, you need to use the DATABASE ID

You can at this link, you need to use the DATABASE Index for this

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/export01.htm

After writing this write FREE <Database_ID>.

Read only

uwe_schieferstein
Active Contributor
0 Likes
1,114

Hello Nishu

I did not read your posting carefully enough.

When you are exporting a list using SUBMIT <reportname> ... EXPORTING LIST TO MEMORY then you have to use function module <b>LIST_FROM_MEMORY</b> to fetch the list again.

However, this works only if you fetch the list in the program which is calling report ZRFTBCF00_BW via SUBMIT.

If you need the list in a completely different program then you have to store it in a <b>persistent</b> way, e.g.:

EXPORT thead[] titem[] TO DATABASE indx(zy) ID '<my id>'.

Regards

Uwe

Read only

0 Likes
1,114

thnx for ur reply

i used da same n wen i m importing it in other program

import thead[] titem[] from DATABASE indx(zy) ID '<my id>'.

m getting empty tables can u letme know why data is not coming

Read only

Former Member
0 Likes
1,115

Hi,

Try decalring the internal tables in same way at the sender & receiver and it must work. But don't forget to Free the memory.

Eg:

I have used in a BADI (OO)

TYPES: BEGIN OF it_cert,

ebelp TYPE ebelp,

matnr TYPE matnr,

charg TYPE charg_d,

lichn TYPE lichn,

cert(4) TYPE c,

END OF it_cert.

Data: ws_memid(10) TYPE c.

DATA wa_cert TYPE it_cert.

DATA t_cert TYPE STANDARD TABLE OF it_cert.

... After processing the internal table

ws_memid = 'CERT'.

EXPORT t_cert FROM t_cert TO MEMORY ID ws_memid.

In other BADI declaration is same.

ws_memid = 'CERT'.

IMPORT t_cert TO t_cert FROM MEMORY ID ws_memid.

FREE MEMORY ID 'CERT'.

Try to use this code.. I was able to Export the table & Imported by using in this BADI.