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

SELECT -OPTIONS

Former Member
0 Likes
453

I have taken company code as select-option in my selection screen . I want to check this one with if condition .

I have coded like this

If bukrs in '040'.

but its giving error message .

can any one help me in this issue?

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
392

You can do something like this.



report zrich_0001.

tables: t001.

select-options: s_bukrs for t001-bukrs.

at selection-screen.

  loop at s_bukrs.
    if s_bukrs-low = '0040'
      or s_bukrs-high = '0040'.
      message e001(00) with 'This is not valid'.
    endif.
  endloop.

Regards,

Rich Heilman

2 REPLIES 2
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
393

You can do something like this.



report zrich_0001.

tables: t001.

select-options: s_bukrs for t001-bukrs.

at selection-screen.

  loop at s_bukrs.
    if s_bukrs-low = '0040'
      or s_bukrs-high = '0040'.
      message e001(00) with 'This is not valid'.
    endif.
  endloop.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
392

Hi Priya,

if you declare a variable as Select_option, then it will become a Internal table, it will have fields like LOW, HIGH< SIGN and Option, so if you want to check, then you need to loop that field.

Loop at Bukrs

if bukrs-low = '0040'.

write:/ 'Success'.

elseif bukrs-high = '0040'.

write:/ 'Error'.

Endloop.

Hope you got my point

Regards

Sudheer