In this program we see the use of where clause.
REPORT ZII_RKP_TEST1.
DATA: cond(72) TYPE c,
itab LIKE TABLE OF cond.
PARAMETERS: source(10) TYPE c, dest(10) TYPE c.
DATA wa TYPE spfli-cityfrom.
CONCATENATE 'CITYFROM = ''' source '''' INTO cond.
APPEND cond TO itab.
CONCATENATE 'OR CITYFROM = ''' dest '''' INTO cond.
APPEND cond TO itab.
CONCATENATE 'OR CITYFROM = ''' 'BAYERN' '''' INTO cond.
APPEND cond TO itab.
LOOP AT itab INTO cond.
WRITE cond.
ENDLOOP.
SKIP.
SELECT cityfrom
INTO wa
FROM spfli
WHERE (itab).
WRITE / wa.
ENDSELECT.
2 Comments
Kumud Singh
For more details on building dynamic queries one can refer the below link:
http://help.sap.com/abapdocu_731/en/abenwhere_logexp_dynamic.htm
Regards,
Kumud
Pavel Astashonok
Your link is outdated, the correct is https://help.sap.com/doc/abapdocu_753_index_htm/7.53/en-US/index.htm?file=abapwith.htm