ABAP-SQL技巧

select WERKS, MATNR,
  sumcase when SHKZG 'S' then MENGE when SHKZG 'H' then ( MENGE * -end )
  as MENGE
  from MSEG into corresponding fields of table @LT_MSEGS
  where MATNR in @SO_MATNR
  and WERKS  in @SO_WERKS
  and BUDAT_MKPF in @R_FDAY
  and BWART in ('101','102','161','162','122','123')
  group by WERKS,MATNR order by WERKS,MATNR

原文地址:https://www.cnblogs.com/eagle-dtq/p/11803963.html