Application Development 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: 

Problem with export / import

Former Member
0 Kudos

Hi everybody, I am having a problem with an import. I am doing an export with a value in an user exit:

EXPORT V_NLQNR = V_NLQNR TO MEMORY ID 'QUANTL'

And after I call import in another program:

IMPORT V_NLQNR = V_NLQNR FROM MEMORY ID 'QUANTL'.

But when I check the sy-subrc I am getting 4, so I don't get anything.

Does anybody why?? Is there a problem if I call the export from an user exit??

Thanks in advance.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

CAN YOU TRY LIKE THIS

TAKE VALUE IN V_NLQNR HERE

EXPORT V_NLQNR TO MEMORY ID 'QUANTL'.

DECLARE A VAR LIKE V_NLQNR HERE IN IMPORT PROG.

IMPORT V_NLQNR TO MEMORY ID 'QUANTL'.

IT IS GOOD PRACTICE TO USE 3 CHAR IN MEMORY ID YOU CAN CHECK THAT ALSO..

REGARDS

SHIBA DUTTA

11 REPLIES 11

Former Member
0 Kudos

CAN YOU TRY LIKE THIS

TAKE VALUE IN V_NLQNR HERE

EXPORT V_NLQNR TO MEMORY ID 'QUANTL'.

DECLARE A VAR LIKE V_NLQNR HERE IN IMPORT PROG.

IMPORT V_NLQNR TO MEMORY ID 'QUANTL'.

IT IS GOOD PRACTICE TO USE 3 CHAR IN MEMORY ID YOU CAN CHECK THAT ALSO..

REGARDS

SHIBA DUTTA

Former Member
0 Kudos

Hi Shiba Dutta,

Thanks.

I have tried as you said, also with the 3 character ID, but still having 4 in sy-subrc after IMPORT.

Do you have another idea??

Thanks very much for your time

Former Member
0 Kudos

Hi,

You cannot export data to what ever name you want.There are some Predefined Memory locations with its Names.You can export values to those Memory ID's only. Check the database table TPARA.There you'll get the names to which you can Export values.

with regards,

Jay.

naveen1241
Participant
0 Kudos

EXPORT V_NLQNR TO MEMORY ID 'QUANTL'.

IMPORT V_NLQNR FROM MEMORY ID 'QUANTL'.

is this not working.....

Former Member
0 Kudos

Hi ,

I think you cannot export and import values in USER EXITS.

Place the value u want to use in <b>APPLICATION SERVER or PRESENTATION SERVER.</b>

Again get that using <b>OPEN DATASET / GUI_DOWNLOAD</b> f rom where u want it.

Former Member
0 Kudos

Hello to all, still having same problem. I can't use the gui upload, I need a place to leave the value in sap memory, I think the way is with export/import but I can find the solution.

Any other idea??

Thanks very very much

0 Kudos

I guess you are aware that the EXPORT to MEMORY & IMPORT from MEMEORY should be in the same session. Else you might want to use the EXPORT to DATABASE option instead.

~Suresh

Former Member
0 Kudos

Hello,

I think you have the right idea.

As a suggestion I would name my variables to make it clear which data is being

exported/imported. I would also use different names on the left and right side of the = sign.

Here is a working example from programs that I use:

In the first program

EXPORT intercodata FROM g_data_exp TO MEMORY ID 'INTERCOWOS'.

where g_data_exp is declared as a global variable

In the second program

IMPORT intercodata TO g_data_imp FROM MEMORY ID 'INTERCOWOS'.

where g_data_imp is declared as a global variable

The syntax that you use ( p1 = dobj1 ) should work as well, just make sure that the variable v_nlqnr to the right of the equal sign has a value before the export.

Regards

Greg Kern

Former Member
0 Kudos

Hi again, the problem I have is that I can not declare anythins as global because I am using a a user exit, I don't know if the problem is here, i mean with the user exit. But I have tested everything you told me and still doesn't work. If you have more ideas ...

Thank you very much for your time, this thing is getting me crazy.

0 Kudos

Hello,

The variables do not have to be declared globally. If however, the data that you are exporting is not being passed into the user exit(or is not global to the FM) , then you have a bit of a problem. You will need to find some other way around that.

Regards

Greg Kern

Former Member
0 Kudos

The data are in the user exit. Here, in the user exit I use the export, and after in another Z program I use the import. The Z program is raise with an event in the user exit, so may be the problem is over there. That I can not use that memory.