‎2008 Aug 19 10:05 AM
Hi experts.
I have a strange problem:
Within the PI-Sheet I get a serial number and activate a FM that has the following command:
EXPORT LWA_SERIAL-SERIALNO TO MEMORY ID 'SER'.
(LWA_SERIAL-SERIALNO has the requested value).
At the end of the process I activate a FM that has the command IMPORT LV_SERNR FROM MEMORY ID 'SER'.
For some reason field LV_SERNR doesn't get the value and sy-subrc equal 4.
Both LWA_SERIAL-SERIALNO and LV_SERNR are the same type (GERNR).
Does anyone know why's that ???
Thanks in advance,
Rebeka
‎2008 Aug 19 10:08 AM
Hi,
The problem is not a strange problem... its a common problem if the variable names are different during EXPORT and IMPORT.
To get the value from memory id it is a must that both have the same name as well as the same type and also of the same length.. so that is why you could export the value to memory... but during retrieving the value from the memory the above mentioned are the prerequisites.
In you case Both LWA_SERIAL-SERIALNO and LV_SERNR should be of same type (GERNR) and should be of the same variable name.
Replace the variable name during export or import.. so as you are using the table field during export declared that while importing as declared during exporting.
Hope this would help you.
Good luck
Narin
‎2008 Aug 19 10:10 AM
Hi,
Check in the debugging mode called program, wethere the Exported data is present or not. If not, then it is not exported properly
EXPORT LWA_SERIAL-SERIALNO TO MEMORY ID 'SER'
submit <calledprogram name>.
-
IMPORT LWA_SERIAL-SERIALNO FROM MEMORY ID 'SER'.
Here the Name shoud be same.Regards
Lekha
‎2008 Aug 19 10:10 AM
try using the following syntax
IMPORT LWA_SERIAL-SERIALNO TO lv_serial_no FROM MEMORY ID 'SER'.
~Piyush
‎2008 Aug 19 10:30 AM
I have now 2 commands:
EXPORT LV_SERNR TO MEMORY ID 'SER'.
and after that (in a different program).
IMPORT LV_SERNR FROM MEMORY ID 'SER'.
The import command doesn't work (subrc = 4).
‎2008 Aug 19 10:40 AM
I think that the problem comes from the scope issue.
Nither set / get parameters and import / export parameters don't do the job although it's the sames names, sizes and the like.
The first program does not activating the second one, there is no CALL TRANSACTION or SUBMIT command.
I'm searching for a general solution that is not depends on anything.
Thanks,
Rebeka
‎2008 Aug 31 9:05 AM