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

Error message for ranges in selection screen

Former Member
0 Likes
779

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

1 ACCEPTED SOLUTION
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
652

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

3 REPLIES 3
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
653

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

Read only

Former Member
0 Likes
652

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

Read only

Former Member
0 Likes
652

thank you Tarun its working...