Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Error message for ranges in selection screen

Hi

i have this select option statement

SELECT-OPTIONS: s_fevor FOR afko-fevor.

i have written this code for error message display...

AT SELECTION-SCREEN ON S_FEVOR.

I_FEVOR-SIGN = 'I'.

I_FEVOR-OPTION = 'EQ'.

I_FEVOR-LOW = S_FEVOR.

I_FEVOR-HIGH = S_FEVOR.

IF not I_FEVOR-LOW EQ s_FEVOR .

SELECT FEVOR

FROM AFKO

INTO S_FEVOR

WHERE FEVOR = S_FEVOR.

  • UP TO 1 ROWS.

ENDSELECT.

IF SY-SUBRC NE 0.

MESSAGE E000.

ENDIF.

ENDIF.

if i enter the correct data then also it is giving error message

how to solve this?

Regards

Smitha

Former Member replied

Hi,

Refer this code:-

SELECT-OPTIONS: s_fevor FOR afko-fevor.

DATA : BEGIN OF t_fevor OCCURS 0,
         fevor TYPE afko-fevor,
       END OF t_fevor.

AT SELECTION-SCREEN FOR 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 e000.
    ENDIF.
  ENDIF

Hope this helps you.

Regards,

Tarun

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question