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

posted @ 2019-11-06 11:12  東東東東  阅读(371)  评论(0编辑  收藏  举报