Application Development 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: 

About selection-screen's question?

Former Member
0 Kudos

Dear gurus:

I have declare a screen like below:

SELECTION-SCREEN BEGIN OF BLOCK blk_d WITH FRAME TITLE text-004.

PARAMETERS: p_matnr TYPE resb-matnr. "Material

PARAMETERS: p_bdmng LIKE resb-bdmng. "Request Qty

PARAMETERS: p_meins LIKE resb-meins.

SELECTION-SCREEN END OF BLOCK blk_d.

How to achieve such an effect:

after i input a materical code to p_matnr, display the corresponding unit in p_meins.

Actually, when the user input the qty, them want know the unit of currently material. So i want show the unit in parameter(p_meins) after them input the p_matnr,but before them input the qty.

Message was edited by:

Shao Hui Young

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi shao,

1. User has to press ENTER,

just after entering / selecting via F4,

the material number.

2. This is one way.

3. Just copy paste.

4.

REPORT ABC.

SELECTION-SCREEN BEGIN OF BLOCK BLK_D WITH FRAME TITLE TEXT-004.

PARAMETERS: P_MATNR TYPE RESB-MATNR. "Material

PARAMETERS: P_BDMNG LIKE RESB-BDMNG. "Request Qty

PARAMETERS: P_MEINS LIKE RESB-MEINS.

SELECTION-SCREEN END OF BLOCK BLK_D.

<b>*----


AT SELECTION-SCREEN OUTPUT.

SELECT SINGLE MEINS

INTO P_MEINS

FROM MARA

WHERE MATNR = P_MATNR.</b>

regards,

amit m.

12 REPLIES 12

amit_khare
Active Contributor
0 Kudos

Write the Code in AT SELECTION SCREEN OUTPUT.

When user enter the value in p_matnr and press enter the other screen will take corresponding data.

Only thing to handle here is an event.Because unless an event is triggered thos field will not get filled, if user is using F4 then it will trigger. But if he is entering manually then need to press enter.

Regards,

Amit

Reward all helpful replies.

0 Kudos

Dear Amit:

Actually, when the user input the qty, them want know the unit of currently material. So i want show the unit in parameter(p_meins) after them input the p_matnr,but before them input the qty.

can I achieve??

Former Member
0 Kudos

Hello Shao,

use the following logic....

at selection-screen output on p_matnr.

select single matnr meins from resb where matnr in p_matnr.

move resb-meins to p_meins.
modify screen.

Reward If Helpful.

Regards

--

Sasidhar Reddy Matli.

0 Kudos

Hi Sasidhar:

I use the code which just you give me .

but the system give me a error like this: "." expected after output.

It seemed as if can't put "on p_matnr" after "at selection-screen output"

Reward all helpful advice!!

0 Kudos

Hi Sasidhar:

Actually, when the user input the qty, them want know the unit of currently material. So i want show the unit in parameter(p_meins).

Former Member
0 Kudos

Hi

<b>at selection-screen output on p_matnr.

select single matnr meins from resb where matnr in p_matnr.

move resb-meins to p_meins.

modify screen.</b>

reward if usefull

0 Kudos

Hi Naresh:

Thanks for your advice first,

but it seem can't put the <font color=red>on p_matnr</font> after <font color=red>at selection-screen output </font>, my sap system give a error.

Former Member
0 Kudos

hi,

try this code:

SELECTION-SCREEN BEGIN OF BLOCK blk_d WITH FRAME TITLE text-004.

PARAMETERS: p_matnr TYPE resb-matnr. "Material

PARAMETERS: p_bdmng LIKE resb-bdmng. "Request Qty

PARAMETERS: p_meins LIKE resb-meins.

SELECTION-SCREEN END OF BLOCK blk_d.

at selection-screen output.

select meins into p_meins from resb where matnr = p_matnr.

endselect.

plz reward points if it helps.

rgds.

Former Member
0 Kudos

hi,

the code i pasted before & the one iam pasting now wuld give the same result.

u have to use ;

at selection-screen on p_matnr.

(if u use at selection-screen output on p_matnr u will get an error)

SELECTION-SCREEN BEGIN OF BLOCK blk_d WITH FRAME TITLE text-004.

PARAMETERS: p_matnr TYPE resb-matnr. "Material

PARAMETERS: p_bdmng LIKE resb-bdmng. "Request Qty

PARAMETERS: p_meins LIKE resb-meins.

SELECTION-SCREEN END OF BLOCK blk_d.

at selection-screen on p_matnr.

select single meins into p_meins from resb where matnr = p_matnr.

*move resb-meins to p_meins.

modify screen.

plz reward points if it helps.

0 Kudos

Hi abaper :

Thk u first.

i have test your code, the unit will display after i push the execute button, But i want display the unit after i input the material code.

can l achieve?

Reward all helpful advice~

Former Member
0 Kudos

Hi shao,

1. User has to press ENTER,

just after entering / selecting via F4,

the material number.

2. This is one way.

3. Just copy paste.

4.

REPORT ABC.

SELECTION-SCREEN BEGIN OF BLOCK BLK_D WITH FRAME TITLE TEXT-004.

PARAMETERS: P_MATNR TYPE RESB-MATNR. "Material

PARAMETERS: P_BDMNG LIKE RESB-BDMNG. "Request Qty

PARAMETERS: P_MEINS LIKE RESB-MEINS.

SELECTION-SCREEN END OF BLOCK BLK_D.

<b>*----


AT SELECTION-SCREEN OUTPUT.

SELECT SINGLE MEINS

INTO P_MEINS

FROM MARA

WHERE MATNR = P_MATNR.</b>

regards,

amit m.

Former Member
0 Kudos

hi,

ive already given the code in my first post .

SELECTION-SCREEN BEGIN OF BLOCK blk_d WITH FRAME TITLE text-004.

PARAMETERS: p_matnr TYPE resb-matnr. "Material

PARAMETERS: p_bdmng LIKE resb-bdmng. "Request Qty

PARAMETERS: p_meins LIKE resb-meins.

SELECTION-SCREEN END OF BLOCK blk_d.

at selection-screen output.

select meins into p_meins from resb where matnr = p_matnr.

endselect.

when the user hits enter key the value for meins is displayed.

plz reward points if it helps

rgds