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

screen field value to program

Former Member
0 Likes
1,081

hi,

how to get screen field value i.e ebeln value from ME22N to zprogram.kindly help regarding this issue.

thanks and regards,

siri

8 REPLIES 8
Read only

Former Member
Read only

Former Member
0 Likes
1,041

Could you pls provide some more details regarding?

Read only

Former Member
0 Likes
1,041

hi check this..

check Dynprofield and retfield

Read only

Former Member
0 Likes
1,041

You can use the get parameter ID for that.

The parameter ID for EBELN is BES. this you can find out by pressing F1 on the field and going to technical info.

In the Zprogram try including the following code, to get the value of EBELN in ME22N.


Data: w_ebeln type ekko-ebeln.
constants: c_parameter_id_bes TYPE memoryid VALUE 'BES'

GET parameter ID c_parameter_id_bes FIELD w_ebeln. 

Read only

0 Likes
1,041

Use code like this to get value from selection screen of other transaction.

get parameter id 'BES' field itab-ebeln.

get parameter id 'BSP' field itab-ebelp.

Call transaction 'ME22N;.

Regards

rajesh

Read only

0 Likes
1,041

hi,

ive tried using your code but even it didnt work.kindly help me.

thanks and regards,

siri

Read only

0 Likes
1,041

The code works perfectly. It reads the current value from SAP memory into the variable in the program. Maybe the memory area is empty.

Say, you have just entered a PO 4500006371 in ME22N in your system, that PO number gets stored in the SAP memory and by using GET parameter ID you can read that value into program.

Enter a PO number in ME22N and then go to the program having GET parameter ID. after the GET parameter statement put a write statement

like this.

write: w_ebeln.

It will surely print the PO number that you had entered recently. Thats how GET parameter ID works.

Read only

Former Member
0 Likes
1,041

Hi Sirisha,

The screen field values are populated at run time only.

Once the transaction is saved, the data is refreshed from the structures or screen fields. At run time or at the time of execution of the transaction we need to capture the screen fields.

The screen field name is MEPO_TOPLINE - EBELN.

Here MEPO_TOPLINE is the structure name.

You can use the Parameter ID and get the value. The parameter ID for EBELN is ' BES '

Best regards,

raam