Skip to Content
0
Former Member
Dec 27, 2007 at 09:05 AM

String search syntax

22 Views

Hi All,

I would like to know what is the syntax to be used to check if a particular word exists in a sentence. I tried the below, but it is not giving me the desired result. I am checking to see if the word Comp exists in the name & also would like to know is this a case-sensitive search? i.e would Comp be treated differently from comp? if i want the search to check for 'comp' irrespective of the case, how should i do it?

SELECT SINGLE NAME1 FROM KNA1 INTO Y_NAME1

WHERE KUNNR EQ VBRK-KUNRG.

IF Y_NAME1 CA 'Comp'.

Y_TYP_SAL = 'INTERNAL'.

ELSE.

Y_TYP_SAL = 'EXTERNAL'.

ENDIF.