‎2009 Jun 02 4:52 AM
hi
i hav written error message for production sheduler...
if the input is wrong i want the errror to be displayed as invalid input...
if they dnt enter any data then no need to display any error msg i hav written this below code...
here im getting error if i dont enter account group and if i enter correct group also it is giving error msg...
wt is wrong in my code?
AT SELECTION-SCREEN on s_fevor.
s_fevor-sign = 'I'.
s_fevor-option = 'EQ'.
s_fevor-low = s_fevor.
s_fevor-high = s_fevor.
APPEND s_fevor.
CLEAR s_fevor.
IF not s_fevor-low in s_fevor.
SELECT fevor
from afko
INTO TABLE t_fevor
WHERE fevor in s_fevor.
IF sy-subrc ne 0.
MESSAGE e001.
ENDIF.
ENDIF.
‎2009 Jun 02 4:58 AM
Hi,
INITIALIZATION.
s_fevor-sign = 'I'.
s_fevor-option = 'EQ'.
s_fevor-low = 'Give value here'.
s_fevor-high = 'Give value here'.
APPEND s_fevor.
CLEAR s_fevor.
AT SELECTION-SCREEN.
IF not s_fevor-low in s_fevor.
SELECT fevor
from afko
INTO TABLE t_fevor
WHERE fevor in s_fevor.
IF sy-subrc ne 0.
MESSAGE e001.
ENDIF.
ENDIF.
Regards,
Kumar Bandanadham
Edited by: Velangini Showry Maria Kumar Bandanadham on Jun 2, 2009 5:59 AM
‎2009 Jun 02 5:01 AM
Hello
Please modify your code as below .WHICH WIll work for all scenarios i mean even if you give Option as EXCLUSIVE also .....
{
AT SELECTION-SCREEN on s_fevor.
DATA : l_t_fevor TYPE TABLE OF afko-fevor WITH HEADER LINE.
SELECT fevor INTO TABLE l_t_fevor FROM afko.
LOOP AT s_fevor.
IF NOT s_fevor-low IS INITIAL.
READ TABLE l_t_fevor WITH KEY = s_fevor-low.
IF sy-subrc <> 0.
SET CURSOR FIELD 'S_FEVOR-LOW'.
MESSAGE e<> ENDIF.
ENDIF.
IF NOT s_FEVOR-high IS INITIAL.
READ TABLE l_t_fevor WITH KEY = s_fevor-high.
IF sy-subrc <> 0.
SET CURSOR FIELD 'S_FEVOR-HIGH'.
MESSAGE e<> ENDIF.
ENDIF.
ENDLOOP.
}
Regards
‎2009 Jun 02 5:43 AM
Hi,
Change your code like this
AT SELECTION-SCREEN.
IF not s_fevor-low in s_fevor.
SELECT fevor
from afko
INTO TABLE t_fevor
WHERE fevor in s_fevor.
IF sy-subrc ne 0.
MESSAGE e001.
ENDIF.
ENDIF.
Regards,
Jyothi CH.