‎2007 Aug 22 10:20 PM
Hi,
We need to do a select single only for a part of a field...
something like...
select single bktxt
into w_bktxt
from bkpf
where bktxt(4) eq '1234'.
Thanks In Advance
Juan
‎2007 Aug 22 10:23 PM
select single bktxt
into w_bktxt
from bkpf
where bktxt like '1234%'.
Greetings,
Blag.
‎2007 Aug 22 10:22 PM
HI,
you cannot use the offset specification for a database field.
rather u try this.
select single bktxt
into w_bktxt
from bkpf
where bktxt like '1234%'.
Thanks
Mahesh
‎2007 Aug 22 10:23 PM
select single bktxt
into w_bktxt
from bkpf
where bktxt like '1234%'.
Greetings,
Blag.
‎2007 Aug 22 10:31 PM
Thanks Mahesh and Alvaro...
Can i do this?
data w_ad(4) type c.
concatenate w_ad '%' into w_ad
and then
select single bktxt
into w_bktxt
from bkpf
where bktxt like w_ad.
if w_ad is '123 ' the select will be sy-subrc = 4 ?
Thanks In Advance
Juan
‎2007 Aug 22 10:36 PM
> Can i do this?
>
> data w_ad(4) type c.
>
> concatenate w_ad '%' into w_ad
Sure, the code it's ok -:) But w_ad must have a value first -;)
w_ad = '123'.
concatenate w_ad '%' into w_ad.
> and then
>
> select single bktxt
> into w_bktxt
> from bkpf
> where bktxt like w_ad.
Yes...It can be done that way...
> if w_ad is '123 ' the select will be sy-subrc = 4 ?
The <b>%</b> works like this....123% is equal as saying....123(and every number)...
So if you perform your SELECT and the value stored in the DB is 123, the SY-SUBRC is going to 0...But if the value stored in the DB is for example 132, then the SY-SURBC is going to be 4 -:)
Greetings,
Blag.
‎2007 Aug 22 10:39 PM
Yes if you have w_ad defined with length 5 and default it to 1234.
data w_ad(5) type c value '1234'.
concatenate w_ad '%' into w_ad
condense w_ad no-gaps.
select single bktxt
into w_bktxt
from bkpf
where bktxt like w_ad.
This will bring any document that has a BKTXT value that starts with 1234