2013 Apr 03 10:56 AM
Hello Experts,
I have table where one of the columns is called COL1.
Suppose this table has just one record where the column COL1 has the value 56006*.
I want to select the above record even when I look up this table for records with COL1 value = 560068.
How can I write such a query?
Thanks & Regards,
Saurabh
2013 Apr 03 11:07 AM
2013 Apr 03 11:06 AM
In select you can use the like operator and the % symbol.
select
col1 from itab1 where col1 like '56006%'.
2013 Apr 03 11:07 AM
2013 Apr 04 2:32 PM
It seems you're the only who spotted that the wildcard is a value the table!
2013 Apr 04 2:48 PM
Yes, alas , as most people see what they expect to see, not what is written. Moreover, in this case the question would have been too basic and would have justified a "Report abuse" .
It looks like a Customizing table with wildcard and the program look for items that can be applied to a value.
Regards,
Raymond
2013 Apr 04 10:15 AM
Hi,
I think that this example is useful for you
REPORT z_example_abap.
TABLES vbak.
DATA: BEGIN OF tb_vbak OCCURS 0,
vbeln LIKE vbak-vbeln,
netwr LIKE vbak-netwr,
END OF tb_vbak.
START-OF-SELECTION.
REFRESH tb_vbak.
CLEAR tb_vbak.
SELECT vbeln netwr FROM vbak
INTO TABLE tb_vbak
WHERE vbeln LIKE '%178%'.
DESCRIBE TABLE tb_vbak LINES sy-tfill.
END-OF-SELECTION.
Regards
Ivan
2013 Apr 04 1:38 PM
2013 Apr 04 1:46 PM
SELECT * FROM table name INTO TABLE gt_itab WHERE COL1 LIKE '560006%'.