Skip to Content

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Apr 14, 2009 at 07:08 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 14, 2009 at 07:10 AM
    AT SELECTION-SCREEN ON S_FEVOR.
    
    SELECT FEVOR
    FROM AFKO
    INTO S_FEVOR
    WHERE FEVOR IN S_FEVOR.            "  use IN instead of EQ
    * UP TO 1 ROWS.
    ENDSELECT.
    
    IF SY-SUBRC NE 0.
    MESSAGE E000.
    ENDIF.

    Regards,

    Siddarth

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 14, 2009 at 07:12 AM

    thank you Tarun its working...

    Add comment
    10|10000 characters needed characters exceeded