Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

problm in displaying error msg

Former Member
0 Likes
520

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.

3 REPLIES 3
Read only

Former Member
0 Likes
487

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

Read only

shishupalreddy
Active Contributor
0 Likes
487

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

Read only

Former Member
0 Likes
487

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.