2013 Sep 25 3:47 AM
Hi Gurus,
I am facing a peculiar problem while using IMPORT/EXPORT statement in VA02. In one userexit i am exporting a flag to memory id while in other userexit of the same program i am importing it. Sometimes it works and sometimes it doesnt.
In first user exit -
EXPORT lv_flag TO MEMORY ID sy-uname.
In Second User Exit -
IMPORT lv_flag FROM MEMORY ID sy-uname.
I am not sure what can be the possible reason for such kind of behavior.
Please suggest a proper solution/reason for the above issue.
Thanks and Regards,
Chirag
Hi Gurus,
I am facing a peculiar problem while using IMPORT/EXPORT statement in VA02. In one userexit i am exporting a flag to memory id while in other userexit of the same program i am importing it. Sometimes it works and sometimes it doesnt.
In first user exit -
EXPORT lv_flag TO MEMORY ID sy-uname.
In Second User Exit -
IMPORT lv_flag FROM MEMORY ID sy-uname.
I am not sure what can be the possible reason for such kind of behavior.
Please suggest a proper solution/reason for the above issue.
Thanks and Regards,
Chirag
2013 Sep 25 6:28 AM
Hi Chirag,
There might be a possibility that the relevant condition before the Export statement was not satisfied so there was nothing exported hence no value imported.
Using Export/Import can lead to issues while looking to trace the spots from where the value was Exported and where it was Imported unless explicitly mentioned in the Comments of the code. What we follow as practice is create a Function Group with two Function modules, one for Set(Mimicks Export) and the other for Get(Import). The value can be set in a Global variable declared for the Function group, hence will hold the value while you do a Get of the same variable:
eg:
Function Set_Variable
GV_VAR = IV_FLAG.
Endfunction.
Function Get_Variable
EV_FLAG = GV_VAR.
Endfunction.
Hope this helps.
Thanks & Regards,
Vijay
2013 Sep 25 7:36 AM
Hi Chirag Modi,
can you use memory id with different name instead sy-uname, bcz it's a system variable some times it may leads in consistency. And after import just clear the memory id by using FREE MEMORY ID <ID NAME>. I hope it will help you and let us know if you need anything regarding this.
Regards
Venkat.
2013 Sep 25 8:08 AM
Agree with Chirag modi, Instead of using sy-uname use any variable or different name,
Value of sy-uname some times may differ in case of batch job etc.
Hope that will work.
2013 Sep 25 9:04 AM
Hi,
Why don't you use different variable in stead of SY-UNAME.
Let's try with putting memory id in single quotes.
In First User Exit -
EXPORT lv_flag TO MEMORY ID 'FLAG' .
In Second User Exit -
IMPORT lv_flag FROM MEMORY ID 'FLAG' .
Regards,
Keyur Pawar.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |