I would like to use a SQL stmts like this:
SELECT * FROM tab WHERE key1 LIKE '%<i>variable</i>%'.
Using LIKE in the WHERE clause requieres a character field. But I want to use a vairable...
how should i write that?
thx,
holger
Request clarification before answering.
hi,
Check out this sample code.
concatenate sy-cprog '%' into <b>w_bdcerr</b>.
SELECT * FROM APQI UP TO 1 ROWS
WHERE GROUPID LIKE <b>W_BDCERR</b> AND
QSTATE NE 'F'.
ENDSELECT.
You concatenate the variable and % into a string and use that in select. This meets your requirement.
Regards,
Sailaja.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 14 | |
| 13 | |
| 7 | |
| 7 | |
| 5 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.