ABAP 语法
2018-03-10 本文已影响0人
阿努比斯1117
1.case when
ZBU.png
ZBU:1 女装 2 男装 else 童装
SELECT WERKS,
CASE ZBU
WHEN '1' THEN '女装'
WHEN '2' THEN '男装'
ELSE '童装'
END AS ZBU
FROM ZTMM_STORE_PROPS
INTO TABLE @DATA(RESULT).
CL_DEMO_OUTPUT=>DISPLAY( RESULT ).
结果如下
result.png
2.substring ,在substring中需要按照FROM WHERE INTO 的顺序
SELECT SUBSTRING( BUKRS,1,2 ) AS YEAR,
SUBSTRING( BUKRS,3,2 ) AS MONTH
FROM T001
WHERE BUKRS LIKE 'N%'
INTO TABLE @DATA(RESULT)
substring.png