08-31-2007 7:58 AM
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
08-31-2007 10:05 AM
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.
08-31-2007 8:13 AM
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.
08-31-2007 9:51 AM
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??
08-31-2007 8:18 AM
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.
08-31-2007 8:27 AM
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!!
08-31-2007 8:58 AM
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).
08-31-2007 8:28 AM
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
08-31-2007 8:37 AM
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.
08-31-2007 8:53 AM
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.
08-31-2007 8:59 AM
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.
08-31-2007 9:40 AM
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~
08-31-2007 10:05 AM
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.
08-31-2007 10:32 AM
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