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

ABAP

Former Member
0 Likes
669

HI,

HOW DO I CREATE MEMORY IDS ZMATNR Z WERKS

CLEAR MEMORY ID'S ZMATNR ZWERKS AND THEN

EXPORT MATNR AND WERKS VARIABLES TO MEMORY IDS.

PLEASE PROVIDE ME WITH THE CODE.

REGards,

Deepthi

6 REPLIES 6
Read only

Former Member
0 Likes
641

Could you be more precise.

Read only

Former Member
0 Likes
641

Hi ,

Use the following syntax :

DATA: REPID(8) VALUE 'RFSCHU01'.

SET PARAMETER ID 'RID' FIELD REPID.

DATA : REPID(8).

GET PARAMETER ID 'RID' FIELD REPID.

Regards ,

Senthil

Read only

anversha_s
Active Contributor
0 Likes
641

hi,

1. When u use memory id, make sure of the

following points.

a) The memory id is SAME as the variable name

b) Memory id should be in CAPITAL

c) When u want to import,

the variable name should be same as original one,

and should be declared in the same fashion only.

<u>an example</u>

*-------- for Z1
report zmem_sha.
DATA : PERNR LIKE P0001-PERNR.
PERNR = '00004556'.
EXPORT PERNR TO MEMORY ID 'PERNR'.
CALL TRANSACTION 'ZTR01'.

*-------- For Z2 (having tcode ZTR01)
report abc.
DATA : PERNR LIKE P0001-PERNR.
IMPORT PERNR FROM MEMORY ID 'PERNR'.
break point.

Regards

Anver

Read only

Former Member
0 Likes
641

Hello,

You dont have to create memory ids. When you use the Export statement, the parameters passed with it will be stored in memory id name you specify with the Export statement.

To Export Variables:

EXPORT LV_MATNR LV_WERKS TO MEMORY ID MID.

To Import:

IMPORT LV_MATNR LV_WERKS FROM MEMORY ID MID.

To Clear:

FREE MEMORY ID MID

You will have to use the same variable names in the Export and Import statements.

Regards,

Manoj

Read only

Former Member
0 Likes
641

JUST WRITE THE CODE

EXPORT ITAB TO MEMORY ID 'ZMT'.

IMPORT ITAB FROM MEMORY ID 'ZMT'.

FREE MEMORY ID 'ZMT'.

YOU HAVE TO USE ONLY 3 CHAR AS ID.

REGARDS

SHIBA DUTTA

Read only

Former Member
0 Likes
641

clear <local_matnr>.

clear <local_werks>.

EXPORT matnr = <local_matnr> = lwa_edidc-sndprn TO MEMORY ID 'ZMATNR'.

EXPORT werks = <local_werks> = lwa_edidc-sndprn TO MEMORY D 'ZWERKS'.

  • Fill <local_matnr> and <local_werks>.

EXPORT matnr = <local_matnr> = lwa_edidc-sndprn TO MEMORY ID 'ZMATNR'.

EXPORT werks = <local_werks> = lwa_edidc-sndprn TO MEMORY D 'ZWERKS'.

Regards

Bernd