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 and import not working properly in function module.?

former_member220941
Participant
0 Likes
3,587

Dear Experts,

I have 2 FMs in one ZFM I am Export internal table and Importing same data in another FM.

My issue is data is not exporting into memory id in  source FM.

Code : EXPORT  t_bsegc[] TO MEMORY ID 'ABC'.

          

       After this command executes  sy-subrc set to 4.

Can any one let me know the correct syntax of export.

Thanks,

Raj,,,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,389

Have you pressed F1 on EXPORT?

Rob

16 REPLIES 16
Read only

Former Member
0 Likes
2,390

Have you pressed F1 on EXPORT?

Rob

Read only

0 Likes
2,389

Thanks for your quick reply....yes i searched that document i wrote same like that.

But it is not working in my FM

Read only

0 Likes
2,389

Try:

EXPORT t_bsegc TO MEMORY ID 'ABC'. (No square brackets.)

Rob

Read only

0 Likes
2,389

Hi Raj,

Try this

EXPORT itab = i_tab TO MEMORY ID 'ITAB'.

IMPORT itab =  i_tab FROM MEMORY ID 'ITAB'.

i_tab is your internal table,

ITAB memory area.

Thales Schmidt

Read only

0 Likes
2,389

No Rob still it is not working...

Read only

0 Likes
2,389

data moving from itab to i_tab ?

Thanks,

Raj

Read only

0 Likes
2,389

What do you mean by 'not working'? Is sy-subrc still 4? Or are you not able to import it? Or something else?

Rob

Read only

0 Likes
2,389

Based on your example, it would be like this:

EXPORT abc = t_bsegc TO MEMORY ID 'ABC'.

IMPORT abc = t_bsegc FROM MEMORY ID 'ABC'.

or EXPORT t_bsegc = t_bsegc TO MEMORY ID 'ABC'. I can't remember exactly

If your table doesnt have a header line, you dont need the brackets.

Thales Schmidt

Read only

0 Likes
2,389

Sy-subrc is 4 and data not importing...

Read only

0 Likes
2,389

What was sy-subrc before the EXPORT statement?

Rob

Read only

0 Likes
2,389

Thasles,

Thanks for your reply..I tried same thing as you suggested but still it is not working.

Exporting in ZFM.

Code : EXPORT  ex_bsegc = ex_bsegc  TO MEMORY id 'ZCASH'.

Importing in standard FM  ( POST_DOCUMENT) it is Updated FM.

Code : IMPORT ex_bsegc = ex_bsegc FROM MEMORY id 'ZCASH'.

Thanks,

Raj....

Read only

0 Likes
2,389

Rob,

sy-subrc is 0.

Read only

0 Likes
2,389

My last shot

Try like this

IMPORT ex_bsegc TO ex_bsegc FROM MEMORY ID 'ZCASH'.

As an alternative, since I don't know how you are running the FMs, take a look on this topic

Read only

0 Likes
2,389

Well, there seems to be something else going on here. I can find no documentation that says that sy-subrc is set to 4 for the EXPORT statement. If it fails, it raises an exception.

IMPORT, on the other hand, does set sy-subrc to 4 if no data is imported.

So, are you sure there is any data in the table you are exporting??

Rob

Read only

0 Likes
2,389

Thanks a lot Thales....It is working fine.

I will give you party...one fine day.

Regards,

Raj,,

Read only

Former Member
0 Likes
2,389

Hi! Try this(used a 'TO' instead '=' in IMPORT)

EXPORT FIELD = lt_variable1 TO MEMORY ID 'YOURID'.

IMPORT FIELD TO lt_variable2 FROM MEMORY ID 'YOURID'.

Regards!