‎2009 Feb 09 5:24 AM
Moderator message: don't offer points
hi experts...
i generated a report.
in that report, the selection screen fields are plant and material type..
now my rqmt is like this :
if user enters any plant except '8210' in the selection screen, then a pop up should appear like.. enter 8210 plant only, and the cursor should remain in the same screen allowing user to enter correct plant.
and then same with the case of material type also..user should enter 'mcfe' material type only..
im using message classes like this:
if so_bwkey-low ne '8210' or so_bwkey-high ne '8210'.
message i000(zts).
endif.
if so_mtart-low is not initial and so_mtart-high is not initial and so_mtart-low ne 'mcfe'
or so_mtart-high ne 'mcfe'.
message i001(zts).
endif.
with this logic, when i enter plant..it is prompting
1) enter plant 8210 only..
and then when i press enter key it is again prompting
2)enter material type mcfe only..
but iam not entering material type here..
i want to get 2nd error message if and only if i enter material type..
help me regarding this issue..
<<text removed>>
thanks in advance,
harini.
Edited by: Matt on Feb 9, 2009 10:14 AM
‎2009 Feb 09 5:26 AM
Hi ,
Use
AT SELECTION0-SCREEN ON p_plant .
SET CURSOR FIELD 'P_PALNT' after the Message statrment .
Similarly use for Material type.
Regards
‎2009 Feb 09 5:28 AM
Hi,
Use Error type message in SELECTION SCREEN EVENT.It will place the cursor in the relevant Field.
At SELECTION-SCREEN ON SO_BWKEY-Low.
if so_bwkey-low ne '8210' .
message E000(zts).
endif.
At SELECTION-SCREEN ON SO_BWKEY-HIGH.
if so_bwkey-high ne '8210'.
message E000(zts).
endif.
At SELECTION-SCREEN ON so_mtart-LOW.
if so_mtart-low is not initial and so_mtart-low ne 'mcfe' .
message E001(zts).
endif.
At SELECTION-SCREEN ON so_mtart-HIGH.
if so_mtart-high is not initial
and so_mtart-high ne 'mcfe'.
message E001(zts).
endif.
This will resolve the issue..
Regards,
Gurpreet
‎2009 Feb 09 5:29 AM
Use AT SELECTION-SCREEN ON FIELD event and write the code in this event. You have two selection screen fields here, so use two ON FIELD events.
‎2009 Feb 09 5:30 AM
Hi Harini,
for your requirement, yu shouldn't use type I message, you should call a function module "POPUPMESSAGE" ( search in se37 with this name ) , and you shud display the messageusing this FM.
FM is "POPUP_DISPLAY_MESSAGE"
or
if so_bwkey-low ne '8210' or so_bwkey-high ne '8210'.
message i000(zts).
STOP. <<<< check with STOP.
endif.
if so_mtart-low is not initial and so_mtart-high is not initial and so_mtart-low ne 'mcfe'
or so_mtart-high ne 'mcfe'.
message i001(zts).
STOP. <<<< check with STOP.
endif.
Regards,
NAveen
Edited by: Naveen Deva on Feb 9, 2009 6:34 AM
‎2009 Feb 09 5:30 AM
Hi;
There is an event a t SELECTION-SCREEN OUTPUT, please use it
Regards
Shashi.
‎2009 Feb 09 5:44 AM
Hi,
If you require to move ahead only if the correct information is enetered, better used message type E rather then I. Becase in case of information message type when you press enter the processing continues after the message statement. that is why you receive the popup two times. Try something as follows.
at selection-screen on p_werks.
if p_werks <> '8210'.
message 'enter 8210 a plant' type 'E'.
endif.
at selection-screen on p_mtart.
if p_mtart <> 'INCFE'.
message '----' type 'E'.
endif.
Here the program will not proceed until correct information is not passed.
(Assumption is the input fields are parameters, just use the same logic as you are using if using select-options).
Hope this helps.
Regards,
Sachin
‎2009 Feb 09 5:56 AM
Thank you every one for helping me in solving the issue..
it was solved.