转载

ABAP 动态查询条件

REPORT demo_select_dynamic_conditions .

 

DATA: cond(72) TYPE c,
      itab LIKE TABLE OF cond.

PARAMETERS: city1(10) TYPE c, city2(10) TYPE c.

DATA wa TYPE spfli-cityfrom.

CONCATENATE 'CITYFROM = ''' city1 '''' INTO cond.
APPEND cond TO itab.
CONCATENATE 'OR CITYFROM = ''' city2 '''' INTO cond.
APPEND cond TO itab.
CONCATENATE 'OR CITYFROM = ''' 'BERLIN' '''' 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.

 

 

 

 

上一篇:ABAP 调试技巧
文章最后发布于: 2012-04-06 10:46:57
展开阅读全文
0 个人打赏
私信求帮助

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 1024 设计师: 上身试试

分享到微信朋友圈

×

扫一扫,手机浏览