‎2008 Oct 21 6:29 PM
hi every body ,
can any body provide me a solution for extracting the OT01 data from kna1 table where the OT01 ends with the string 'town' .
exe : the O/P should be
midTOWN
newTOWN
:
:
:
there is one more query i am not able to execute the following statement .......why?
select ORT01 from KNA1 where ORT01 CS 'TOWN'.
write:/ kna1-ort01.
endselect.
it is showing a syntax error.......
Thank You.
‎2008 Oct 21 6:38 PM
Hi ,
try this one.
select ORT01 from KNA1 where ORT01 CS '%TOWN'.
write:/ kna1-ort01.
endselect.
Regards,
Bharani
‎2008 Oct 21 6:33 PM
Hi Tippu,
You need to create a range for the where clause and assign that value CS 'Town'.
and then execute that range from your query this will fix your problem
Thanks,
Chdianand
‎2008 Oct 21 6:37 PM
‎2008 Oct 21 6:38 PM
Hi ,
try this one.
select ORT01 from KNA1 where ORT01 CS '%TOWN'.
write:/ kna1-ort01.
endselect.
Regards,
Bharani
‎2008 Oct 21 6:42 PM
‎2008 Oct 21 6:46 PM
It's "LIKE" not "CS".
and you will probably run into problems with case sensitivity.
Rob
Edited by: Rob Burbank on Oct 21, 2008 1:46 PM
‎2008 Oct 21 6:46 PM
Hi,
select ORT01 from KNA1 where ORT01 like '%TOWN'.
write:/ kna1-ort01.
endselect.
Regards,
Bharani
Edited by: SeethaRamaiah Bharani on Oct 21, 2008 7:47 PM
‎2008 Oct 21 6:42 PM
Hi Tippu,
Your select statement consists of CS whcih may not be a valid comparision operator because of which error is displayed have look of this..
data itab like kna1 occurs 0 with header line.
parameters: s_town like kna1-ORT01.
select ORT01 from KNA1 into table itab where ORT01 = s_town.
Fetch the city and concatenate with TOWN your issue will be sloved.
Cheers!!
Balu
Edited by: Balu CH on Oct 21, 2008 11:13 PM
‎2008 Oct 21 6:46 PM
i was meant the existing city in kna1 which ends with town.
like midtown , newtown ....etc.
‎2008 Oct 21 6:46 PM
Hi Tippu,
Below is the code for your requirement.
RANGES: R_ORT01 FOR KNA1-ORT01.
R_ORT01 -SIGN = 'I'.
R_ORT01 -OPTION = CS'.
R_ORT01 -LOW = '*TOWN'.
append R_ORT01 .
select ORT01 from KNA1 where ORT01 IN R_ORT01 .
write:/ kna1-ort01.
endselect.
Thanks,
Chidanand