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

IMPORT/EXPORT Itab issue in function module.

Former Member
0 Likes
1,005

Hi Experts.

i have used import statement in a BTE as below.

    EXPORT it_bseg FROM MEMORY ID 'ZBD1'.

i have used export statement in a implicit enhancement of FM 'POST_DOCUMENT.

    EXPORT it_bseg FROM MEMORY ID 'ZBD1'.


if i check in the debug mode , the internal table 'it_bseg' is empty.



please suggest.


Thanks

NK.

5 REPLIES 5
Read only

Former Member
0 Likes
882

You say you're IMPORTing, but you actually appear to be EXPORTing.

Rob

Read only

0 Likes
882

sorry, Its my bad, its an Typo in therad discussion.

i used as below in my program

i have used export statement in a BTE as below.

    EXPORT it_bseg to  MEMORY ID 'ZBD1'.

i have used import statement in a implicit enhancement of FM 'POST_DOCUMENT.

    IMPORT it_bseg FROM MEMORY ID 'ZBD1'.



please help me.\

thanks

NK

Read only

0 Likes
882

for test purpose i used the below code in same BTE only.

EXPORT it_bseg1 TO MEMORY ID 'ZZKONTL'


IMPORT it_bseg1 to it_bseg2 from MEMORY ID 'ZZKONTL'.


if i see in debugging the data is transfered from it_bseg1 to it_bseg2  success fully..


if place the second line  (IMPORT it_bseg1 to it_bseg2 from MEMORY ID 'ZZKONTL') in the FM.


both  the table it_bseg1 and it_bseg2 are blank.


what could be the reason.


thanks

NK

Read only

0 Likes
882

Post_document is a update module, so it works in a different workprocess. How they work in different workprocess, the memory area also is different.

When you are working in different workprocess, you need to use EXPORT ... TO DATABASE / IMPORT ...FROM DATABASE.

DATA wa_indx TYPE indx.

EXPORT it_bseg FROM it_bseg  TO DATABASE indx(XY)  FROM wa_indx  ID 'TABLE'.

IMPORT it_bseg TO it_bseg FROM DATABASE indx(XY) ID 'TABLE'.

Read only

0 Likes
882

Thanks for responses and  i resolved the issue as below

The FM is internally calling background mode,

so i coded as below and it working fine now.

in BTE,

EXPORT it_bseg2 to SHARED BUFFER indx(st) id 'ZIBT'.


in FM


IMPORT it_bseg2 = it_bseg2 FROM SHARED BUFFER indx(st) ID 'ZIBT'.


Thanks