04-10-2007 12:23 PM
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.
04-10-2007 12:28 PM
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
04-10-2007 12:28 PM
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
04-10-2007 12:37 PM
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
04-10-2007 1:00 PM
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.
04-10-2007 1:02 PM
EXPORT V_NLQNR TO MEMORY ID 'QUANTL'.
IMPORT V_NLQNR FROM MEMORY ID 'QUANTL'.
is this not working.....
04-10-2007 1:04 PM
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.
04-10-2007 3:07 PM
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
04-10-2007 4:09 PM
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
04-10-2007 4:26 PM
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
04-10-2007 4:48 PM
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.
04-10-2007 5:01 PM
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
04-10-2007 5:15 PM
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.