‎2009 Apr 11 12:36 PM
Hi
i have this select option statement
SELECT-OPTIONS: s_fevor FOR afko-fevor.
how to write error message for this?
Regards
Smitha
‎2009 Apr 11 1:23 PM
Error messages are displayed for Select-options mostly on two conditions:
1) You needs to check wether a value is entered or not its done by:
a)
Select-options:SELECT-OPTIONS: s_fevor FOR afko-fevor Obligatory.In this case error message is automatically throwed by system.
b) You can do this in Selection Screen events.
Ex:
AT SELECTION-SCREEN./AT SELECTION-SCREEN ON S_FEVOR.
IF S_FEVOR-LOW IS INITIAL.
MESSAGE 'XXXXX' TYPE 'E'.
ENDIF.2) You need to Validate the entered value:
You can do this in Selection Screen events.
Ex:
AT SELECTION-SCREEN./AT SELECTION-SCREEN ON S_FEVOR.
SELECT FEVOR
FROM AFKO
INTO AFKO-FEVOR
UP TO 1 ROWS
ENDSELECT.
IF SY-SUBRC NE 0.
MESSAGE 'XXXXX' TYPE 'E'.
ENDIF.Regards,
Gurpreet
‎2009 Apr 11 12:41 PM
Hi,
Try this:
AT SELECTION-SCREEN ON s_fevor.
your checks....
if fail...
MESSAGE text TYPE 'E'.
Regards,
Ivan
‎2009 Apr 11 12:43 PM
try this
At selection-screen.
if s_fevor is initial. " or is not initial accoding to ur req. .
message 'Please Enter Value in s_fevor' TYPE 'E'.
endif.
Edited by: shishir deshmukh on Apr 11, 2009 1:44 PM
‎2009 Apr 11 1:23 PM
Error messages are displayed for Select-options mostly on two conditions:
1) You needs to check wether a value is entered or not its done by:
a)
Select-options:SELECT-OPTIONS: s_fevor FOR afko-fevor Obligatory.In this case error message is automatically throwed by system.
b) You can do this in Selection Screen events.
Ex:
AT SELECTION-SCREEN./AT SELECTION-SCREEN ON S_FEVOR.
IF S_FEVOR-LOW IS INITIAL.
MESSAGE 'XXXXX' TYPE 'E'.
ENDIF.2) You need to Validate the entered value:
You can do this in Selection Screen events.
Ex:
AT SELECTION-SCREEN./AT SELECTION-SCREEN ON S_FEVOR.
SELECT FEVOR
FROM AFKO
INTO AFKO-FEVOR
UP TO 1 ROWS
ENDSELECT.
IF SY-SUBRC NE 0.
MESSAGE 'XXXXX' TYPE 'E'.
ENDIF.Regards,
Gurpreet
‎2009 Apr 11 2:34 PM
Use this code !
AT SELECTION-SCREEN ON S_FEVOR. " OR AT SELECTION-SCREEN
SELECT SINGLE FEVOR
FROM AFKO
INTO AFKO-FEVOR.
IF SY-SUBRC NE 0.
MESSAGE 'PLEASE ENTER VALUE FOR FEVOR' TYPE 'E'.
" or you can use message class message - MESSAGE E(000) FROM <CLASS NAME>.
ENDIF.when you declare select options as obligatory system will throw error but if you want to validate the date entered you need to use at selection screen. Depends on your requirement.
Regards,
Lalit Mohan Gupta.