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

EXPORT & IMPORT Memory ID

Former Member
0 Likes
14,538

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

6 REPLIES 6
Read only

narin_nandivada3
Active Contributor
0 Likes
2,370

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

Read only

Former Member
0 Likes
2,370

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

Read only

Former Member
0 Likes
2,370

try using the following syntax

IMPORT LWA_SERIAL-SERIALNO TO lv_serial_no FROM MEMORY ID 'SER'.

~Piyush

Read only

Former Member
0 Likes
2,370

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).

Read only

Former Member
0 Likes
2,370

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

Read only

Former Member
0 Likes
2,370

sfdsf