2007 May 02 4:09 PM
I want to apply error and warning messages to display on using the selection screen when the fields are bland and wrong values... How to do that??? any help
2007 May 02 4:11 PM
Hi
Use the at selection-screen on field.
Write the validation logic.
finally emessageno(message class)..for errors
and wmessageno(message class)..for warnings.
Regards,
Sreeram
2007 May 02 4:12 PM
2007 May 02 4:12 PM
parameters : p_field(10).
at selection-screen.
if p_field is initial.
SET CURSOR FIELD 'P_FIELD'.
message e001(ZZ) with 'enter a value for field p-fiel'.
endif.
2007 May 02 4:16 PM
2007 May 02 4:17 PM
Hi,
Here is a simple code to check if the parameter is blank.
PARAMETERS: p_string TYPE char20.
AT SELECTION-SCREEN ON p_string.
IF p_string IS INITIAL.
MESSAGE exxx(YYYY).
ENDIF.
Regards,
Sumant.
2007 May 03 8:21 AM
Hi,
parameters : p_mantr like mara-matnr.
at selection-screen.
if p_matnr is initial.
SET CURSOR FIELD 'P_MATNR'.
message e001(ZZ) with 'enter material number'.
endif.
Reward points if it is helpful.
Regards,
Sangeetha.A
2007 May 03 9:52 AM
Hi
Follow the below programs
DEO_SELECTION_SCREEN_EVENTS
DEMO_AT_SELECTION_SCREEN_PBO
http://help.sap.com/saphelp_nw04/helpdata/en/56/1eb6c705ad11d2952f0000e8353423/content.htm
Hope this is useful
<u><b>Award if useful</b></u>
Regards,
Sudheer
2007 May 03 10:13 AM
Hi,
What is your Actual Requirement. you can do validations in selection screens also.
your are asking Warning and Error message, actually which message you want to through, why becuase if you use Error message it won't move to next field until it corrected and Waring message will give when you press enter it will moves to next step. now you can decide which message type you want
1. My point is if you don't want blank fields then that field should make it as Obligatory field then it never move without value to next field or Default value you can initialize.
2. you can put search help to that field then user selects maximum from that data only or at selection-screen on field use the event and do validation there
if sy-subrc ne 0 through a error message
Regards
Ganesh
2007 May 03 11:17 AM
parameters : p_matnr like mara-matnr.
at selection-screen on p_matnr.
if p_matnr is initial.
message i000(bctrain) with ' Enter value for matnr'.
endif.
at selecion-screen on p_matnr.
if p_matnr ne '1616'.
message e000(bctrain) with 'Enter correct value'.
endif.
Message was edited by:
Premalatha G
2007 May 07 11:18 AM
Hi,
U have to <b>award points for useful answers</b> and u have to mention it as solved if ur question is solved. Dont forget.
Regards,
Sudheer