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

Get Parameter Id NOT WORKING

Former Member
0 Likes
1,256

Hi,

-


GET PARAMETER ID

is returning sy-subrc 4

in field exit

for MM02

-


I have used the below mentioned

code in a field exit for some

field on tcode MM02.

In MM02, there is one field WERKS (Plant)

which i need to capture in my field exit.

But not working.

The same is working for MATNR.

-


data : werks TYPE marc-werks.

GET PARAMETER ID 'WRK' FIELD werks.

-


Can anybody guide ?

Regards,

Amit Mittal.

1 REPLY 1
Read only

athavanraja
Active Contributor
0 Likes
524

for get parameter to work the same should have been set before in the program or maintained at system->user profile->owndata -> parameters tab.

<b><u>here are the few lines from ABAP key word documentation</u></b>

If the SPA/GPA parameter specified in pid was not yet created in the SAP Memory for the current user, the data object dobj is initialized and sy-subrc is set to 4.

sy-subrc Meaning

0 The SPA/GPA parameter specified in pid exists for the current user in the SAP Memory and its value was transferred to the target field.

4 The SPA/GPA parameter specified in pid does not exist for the current user in the SAP Memory.

An SPA/GPA parameter that is readable with GET PARAMETER can previously have been created in the SAP Memory using the SET PARAMETER statement or automatically during the event PAI of a screen or selection screen.

Regards

Raja