‎2007 Jan 30 3:49 PM
Hi Experts,
I need to select the PO's from table EKPO of specific number ranges.
The table EKPO has the PO's with different number ranges.
For eg: 4500001
4500002
4500003
4500004
4500005
.............
.............
.............
4600001
4600002
............
............
HDP001
HDP002
HDP003
............
............
MAC001
MAC002
............
............
MRPN01
MRPN02
.............
.............
STR0001
STR0002
.............
.............
Currently the program selects only the '<b>45xxxxx</b>' number range. Now I have to modify the select statement to select the '<b>MRPNxx</b>' series also.
The current form of select statement is:
<b>select ebeln ebelp matnr
from EKPO
into table itab
where matnr = itab2-matnr
and werks = p_werks
and ebeln >= '4500000'
and ebeln < '4600000'.</b>
Please help.
Thanks.
‎2007 Jan 30 3:54 PM
HI,
Take a look at the following eg.
select ebeln ebelp matnr
from EKPO
into table itab
where matnr = itab2-matnr
and werks = p_werks
and ebeln >= '4500000'
and ebeln < '4600000'
or ebeln like 'MRPN%' .<b>OR</b>
select ebeln ebelp matnr
from EKPO
into table itab
where matnr = itab2-matnr
and werks = p_werks
and ebeln like '45%'
or ebeln like 'MRPN%' .Regards,
erwan
‎2007 Jan 30 3:54 PM
HI,
Take a look at the following eg.
select ebeln ebelp matnr
from EKPO
into table itab
where matnr = itab2-matnr
and werks = p_werks
and ebeln >= '4500000'
and ebeln < '4600000'
or ebeln like 'MRPN%' .<b>OR</b>
select ebeln ebelp matnr
from EKPO
into table itab
where matnr = itab2-matnr
and werks = p_werks
and ebeln like '45%'
or ebeln like 'MRPN%' .Regards,
erwan
‎2007 Jan 30 3:54 PM
create a range to replace your ebeln where-clauses:
ranges: lv_ebeln for ekpo-ebeln.
then fill it with your ranges:
sign = I
option = BT
low = '450000'
high = '460000'
and one more entry
sign = I
option = BT
low = 'MRPN00'
high = 'MRPN99'
Instead of BT, you could also use the CP additon....
sign = I
option = CP
low = 'MRPN*'
plz award points to useful answers!
‎2007 Jan 30 3:54 PM
Hi Sey,
use:
select-opstions: s_ebeln for ekpo-ebeln.
*
select ebeln ebelp matnr
from EKPO
into table itab
where matnr = itab2-matnr
and werks = p_werks
*and ebeln >= '4500000'
*and ebeln < '4600000'.
and ebeln in s_ebeln.
in the Input-screen you can insert a lot of ranges.
Regards, Dieter
‎2007 Jan 30 3:54 PM
data : v_string(6).
ranges: s_numbers for v_string.
s_numbers-sign = 'I'.
s_numbers-option = 'CP'. " contains pattern
s_numbers-low = 'MRPN*'.
s_numbers-high = ''.
append s_numbers.
select ebeln ebelp matnr
from EKPO
into table itab
where matnr = itab2-matnr
and werks = p_werks
and ebeln in s_numbers.
‎2007 Jan 30 3:54 PM
select fld1 fld2 from <dbtab>
into table itab
where ( field like '45%' or
field2 like 'MAC%' or
field2 like 'MRPN%' or
field3 like 'STR%').
award points if found helpful
‎2007 Jan 30 3:57 PM
select <fields> from <database>
into table <internal table>
where ( <field> like '45%'
or <field2> like 'MAC%' ).
‎2007 Jan 30 4:00 PM