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 statement not working..

Former Member
0 Likes
3,586

Hi all,

I want to export some data from BADI & Import it back in user exit.

I wrote following line of code in BADI

export P1 FROM xstr to memory id 'ZABHI'.

& following line of code in User Exit

import P1 to xstr FROM memory id 'ZABHI'.

After export sy-subrc becomes 0 hence export statement is working fine but when aftr import xstr remains blank.(sy-subrc = 4)

I tried to execute same code in single ztest abap program & it works fine there.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,614

Hi,

You could also try the EXPORT TO DATABASE statement

EXPORT pname = cname TO DATABASE indx(xy) FROM wa_indx CLIENT

sy-mandt ID 'ZABHI'.

and import from database likewise, but be sure to delete it from that location

once u've read it into the user exit.

Regards,

Samson Rodrigues.

7 REPLIES 7
Read only

Former Member
0 Likes
1,614

try set and get

Read only

Former Member
0 Likes
1,615

Hi,

You could also try the EXPORT TO DATABASE statement

EXPORT pname = cname TO DATABASE indx(xy) FROM wa_indx CLIENT

sy-mandt ID 'ZABHI'.

and import from database likewise, but be sure to delete it from that location

once u've read it into the user exit.

Regards,

Samson Rodrigues.

Read only

0 Likes
1,614

Thanks Samson,

That solved the problem. May I know why the earlier statement was not working?

Also please tell me how do I delete it form database? and why do we need to delete it.

Read only

0 Likes
1,614

hi abhijeet,

you are most welcome....

to delete, use

** deletes the data to save wastage of memory
delete from database indx(xy)
  client sy-mandt
  id 'ZABHI'.

you need to delete it coz, its available to all programs in the R/3

server via the ID and you don't want anybody to view the data u are

sending into memory.

the statement that u used earlier was program specific and hence

not accessible to the user exit.

Regards,

Samson Rodrigues.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,614

Hi,

If the memory is cleared before the import, then it can be blank.

Read only

Former Member
0 Likes
1,614

Hi

Check Program demo_data_ext_cluster_import

in ur system . Hope it Helps.

Praveen.

Read only

Former Member
0 Likes
1,614

hi

pls check the ur import parameter type and fm import parameter types .

doublie click on that fm check the impoty parameter types

regards

kk.