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

Define Selection Options

Former Member
0 Likes
392

if there are some values for selection like A1,A2,AZ,AF,A8 etc (A* values),is there any better way to define the ragne at one shot?

the logic is as follows,

If itab-slno = (A1/A2/AZ,AF,A8).

....... some code

else

........some code

endif.

2 REPLIES 2
Read only

anversha_s
Active Contributor
0 Likes
345

Hi,

Try this.

Define a range:

Ranges: r_field for <table>.

if not field1 is initial.
r_field-sign = 'I'.
r_field-option = 'EQ'.
r_field-option-low = field1.
append r_field.
endif.

if not field2 is initial.
r_field-sign = 'I'.
r_field-option = 'EQ'.
r_field-option-low = field2.
append r_field.
endif.

if field1 is initial and field2 is initial.
r_field-sign = 'I'.
r_field-option = 'EQ'.
append r_field.
endif.

select * from <table> where field1 in r_field.

The 'I' value in the SIGN field denotes 'Include', that means to Include the values given in the LOW and HIGH fields.

U may use 'E' here to exclude these values, when u r using the range in a SELECT query.

Regards,

Anversha

Read only

GauthamV
Active Contributor
0 Likes
345

hi,

you can define like this.


Ranges :  r_hkont_34a FOR bsis-hkont.

PERFORM append_range USING
'BT' '0000560600' '0000560900'
CHANGING
 r_hkont_34a.

 APPEND r_hkont_34a.
 CLEAR r_hkont_34a.