‎2007 Jun 07 7:39 AM
Hi All,
Why is the below statment not fetching any data?
SELECT * FROM t012k INTO TABLE gt_t012k WHERE bankn EQ '%15%'.
Data is present in the table T012k having bankn = %15%.
Thanks,
Rakesh.
‎2007 Jun 07 7:45 AM
hi rakesh,
instead of <b>where</b> u can use where bankn <b>like</b> here.
regards,
seshu.
‎2007 Jun 07 7:49 AM
Hi rakesh,
Change code as below.
SELECT * FROM t012k INTO TABLE gt_t012k WHERE bankn <b>LIKE</b> '%15%'.
Regards,
Atish
‎2007 Jun 07 7:49 AM
Do you actually mean that the bankn = '%15%' or is it LIKE it?
If like then you need to code:
SELECT * FROM t012k INTO TABLE gt_t012k WHERE bankn like '%15%'.
‎2007 Jun 07 7:49 AM
Hi,
You need to write the Select like below
<b>SELECT * FROM t012k INTO TABLE gt_t012k WHERE bankn LIKE '%15%'.</b>
Regards
Sudheer
‎2007 Jun 07 7:50 AM
‎2007 Jun 07 7:52 AM
Hi Rakesh,
yes you can use it. Just use it as you use EQ NE, etc.
Regards,
Atish
‎2007 Jun 07 7:52 AM
LIKE is valid .....show us your full sql and someone will advise you how to edit it.
‎2007 Jun 07 7:52 AM
hi rakesh,
try this,
SELECT * FROM t012k INTO TABLE gt_t012k <b>for all entries in <itab></b> WHERE bankn LIKE '%15%'.
regards,
seshu.
‎2007 Jun 07 7:55 AM
SELECT * FROM t012k INTO TABLE gt_t012k FOR ALL ENTRIES IN gt_checks2
WHERE bankn LiKE gt_checks2-bankn.
The error am getting is THE addittion FOR ALL ENTRIES cannot be used in the where condition BETWEEN LIKE and IN
‎2007 Jun 07 8:10 AM
Hi,
why don't you use operator CS for searching substrings:
SELECT * FROM t012k INTO TABLE gt_t012k
FOR ALL ENTRIES IN gt_checks2
WHERE bankn CS gt_checks2-bankn.
Of course gt_checks2-bankn should not contain the % for substring escaping.
Regards,
Sebastian
‎2007 Jun 08 1:13 AM
OK Rakesh I see your problem now. I did not realise that 'like' was not valid if you have a 'for all entries' clause (CP is also not valid).
If all your entries in the table have the % wildcards you can use this code to convert it to a range and then use the adjusted sql:
ranges r_bankn for t012k-bankn.
r_bankn-SIGN = 'I'.
r_bankn-option = 'CP'.
loop at gt_checks2.
R_BANKN-LOW = gt_checks2-BANKN.
REPLACE ALL OCCURRENCES OF '%'
IN R_BANKN-LOW WITH '*'.
append r_bankn.
endloop.
SELECT * FROM t012k INTO TABLE gt_t012k
WHERE bankn IN R_BANKN.
‎2007 Jun 07 7:54 AM
hi rakesh
please post the way you have defined the internal table.
if you are using the select statement. then try specifying into corresponding fields of table gt_t012k.
try using a key check also with it. like BUKRS or HBKID or HKTID.
and use like also.