I have table column ZZPATTN which stores patterns like 01-001\*, 01-002\*, etc. and I have the variable IM_NAME which contains values like 01-001-ABC, 01-002-DEF, etc.
In SELECT statement WHERE clause, when I write @IM_NAME LIKE ZZPATTN, when click Check button will show this grammar error (error display cursor in front of @IM_NAME), even though I change \* to %:
"@IM_NAME LIKE ZZPATTN" is invalid here (due to grammar). contains an invalid character or it is a keyword. (It might be possible to escape it using "!"). Or a space is missing or there is one space too many.
I tried using other ways to match, but functions REPLACE(), LEFT(), SUBSTRING() are all unknown. Appreciate any advise thanks.
Code:
SELECT ZZPRICE, ZZEFDAT INTO ( @PRICE, @EFDAT ) FROM ZZPRICE
UP TO 1 ROWS
WHERE ( ( 'X' <> @LV_FLG AND ZZNAME = @IM_NAME ) OR
( 'X' = @LV_FLG AND @IM_NAME LIKE ZZPATTN ) )
ENDSELECT.
The ABAP version is 7.40.