我有以下abap程序,如下所示:
TABLES lfa1.
DATA gt_lfa1 TYPE SORTED TABLE OF lfa1 WITH UNIQUE DEFAULT KEY.
SELECT-OPTIONS sl_lifnr FOR lfa1-lifnr.
SELECT-OPTIONS sl_name FOR lfa1-name1.
START-OF-SELECTION.
SELECT * FROM lfa1
INTO CORRESPONDING FIELDS OF TABLE gt_lfa1
WHERE lifnr IN sl_lifnr
AND name1 LIKE sl_name.
搜索名称以:
开头的供应商我没有结果,但它存在这种模式的供应商。
答案 0 :(得分:2)
答案 1 :(得分:-1)
如果使用LIKE操作数,则需要用%替换*。 https://help.sap.com/doc/abapdocu_750_index_htm/7.50/de-DE/abenwhere_logexp_like.htm
REPLACE ALL OCCURENCES OF '*' in sl_lifnr WITH '%'
REPLACE ALL OCCURENCES OF '*' in sl_name WITH '%'
SELECT * FROM lfa1
INTO CORRESPONDING FIELDS OF TABLE gt_lfa1
WHERE lifnr LIKE sl_lifnr
AND name1 LIKE sl_name.