‎2008 Nov 18 6:21 AM
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.
‎2008 Nov 18 6:23 AM
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
‎2008 Nov 18 6:25 AM
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.