08-22-2007 10:43 AM
hi all,
i m selecting a belnr from one table and want to fire another query on different table wherein this belnr falls somewhere in middle of the whole field.
eg: wa-belnr = 4000
select * from cdhdr where
objectclass = '%wa-belnr%.
i want to select records which contains this belnr.
but %wa-belnr% doesnt work.
pls suggest if theres any solution.
08-22-2007 10:46 AM
You need to do this
concatenate '%'
wa_belnr
'%'
into w_field
then use w_field on your select.
08-22-2007 10:48 AM
HI
for ex if belnr is the 10 characters in middle of field starting from 6th character
u can use
select * from cdhdr where objectclass = field+5(10).
08-22-2007 10:51 AM
Hi,
select * from cdhdr where
objectclass = '%wa-belnr%.
In the above query use LIKE instead of '='.
Also instead of %wa-belnr% Use like this
<b>DATA: str type string.
concatenate '%' wa_belnr '%' into str.
select * from cdhdr where
objectclass LIKE str.</b>
Regards,
Sesh
08-22-2007 10:59 AM
Hi,
use
concatenate '%'
wa_belnr
'%'
into lv_BELNR
select * from cdhdr where
objectclass LIKE lv_BELNR
regards