2007 Jan 09 9:36 AM
Hi,
I am facing problem in the select statement ,
SELECT * FROM ZTABLE INTO CORRESPONDING FIELDS OF TABLE ITAB
WHERE PERNR = IPERNR
AND CUNAME CS VAR1.
I am facing problem in the select statement in the selection of cuname, I want to fetch cuname from the ztable if it contains the string var1 contents.
Thanks in Advance,
IFF
2007 Jan 09 9:38 AM
Hello,
The VAR1 should<b> XYZ* or XYZ%</b>
SELECT * FROM ZTABLE INTO CORRESPONDING FIELDS OF TABLE ITAB
WHERE PERNR = IPERNR
<b>AND CUNAME LIKE VAR1.</b>
If useful reward.
Vasanth
2007 Jan 09 9:39 AM
Check this way ...
SELECT * FROM ZTABLE INTO CORRESPONDING FIELDS OF TABLE ITAB
WHERE PERNR = IPERNR
AND CUNAME CS %VAR1%.
2007 Jan 09 9:50 AM
Hi Santosh,
I am getting as
CS is not a valid comparison operator.
2007 Jan 09 9:58 AM
Hi ,
Use the following statement
concatenate '%' var '%' into v_string.
SELECT * FROM ZTABLE INTO CORRESPONDING FIELDS OF TABLE ITAB
WHERE PERNR = IPERNR
AND CUNAME like v_string.
Regards
Arun
2007 Jan 09 9:49 AM
Hi,
Concatenate '%' var1 '%' into var1.
SELECT * FROM ZTABLE INTO CORRESPONDING FIELDS OF TABLE ITAB
WHERE PERNR = IPERNR
AND CUNAME like VAR1.
2007 Jan 09 10:05 AM
Do this way ...
concatenate '%' var1 '%' into var2.
SELECT * FROM ZTABLE INTO CORRESPONDING FIELDS OF TABLE ITAB
WHERE PERNR = IPERNR
AND CUNAME like var2.
Regards,
Santosh
2007 Jan 09 10:07 AM
use this demo code -
tables zgill_main.
data: begin of itab occurs 0.
include structure zgill_main.
data end of itab.
select * from zgill_main into table itab where name like '%AM%'.
loop at itab.
write:/ itab.
endloop.
2007 Jan 09 10:01 AM
try jayanthi code... it is correct.
use like operator
add % to the first and end of the string
as
concatenate '%' var1 '%' into var2.
SELECT * FROM ZTABLE INTO CORRESPONDING FIELDS OF TABLE ITAB
WHERE PERNR = IPERNR
AND CUNAME like VAR2.