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

if condition with select-options

Former Member
0 Likes
2,694

Hi all,

I have created a select option for status. The status can have value 1 to 5

My requirement is I want to perform a subroutine only when selection screen has status 2

Thanks Vamshi

Hi all,

I have created a select option for status. The status can have value 1 to 5

My requirement is I want to perform a subroutine only when selection screen has status 2

Thanks Vamshi

4 REPLIES 4
Read only

ian_maxwell2
Active Participant
0 Likes
1,070

You can use the "in" opperator:


data:
      r_blah type range of n.

if '2' in r_blah.
   Perform FOOBAR.
endif.

~Ian

Read only

0 Likes
1,070

HI Maxwell,

Thanks for your reply. What is n here

Cheers

Vamshi

Read only

0 Likes
1,070

>Thanks for your reply. What is n here

In this case I was just using a range of data type "N" (Numeric) it could be anything you want. The data statement that I have for a range is similiar to what you would have for a selection option. I was just using the range of type "N" as an example actually.

For your case:

Select-Options:
s_Status for XXXX-Status.

If '2' in s_Status.

 Perform f_FunLittleRoutineNamedNed.

endif.

~Ian

Read only

Former Member
0 Likes
1,070

Hi,

We can even go for CASE statement.

CASE 's_status'.

WHEN '1' .

perform .....

WHEN '2'.

perform....

WHEN '3'.

perform....

WHEN '4'.

perform....

WHEN '5'.

perform....

ENDCASE.

Hope this helps.

thanx,

dhanashri.