1. Delete data in FAGLFLEXT and FAGLFLEXA table data.
2. Use tranaction code GLGCU1 to transfer data BSEG to FLEX table,which would copied all dimension data from BSEG.
FROM: http://scn.sap.com/thread/3429789 ManiKumar Yandrapu
为偷懒,自己写段代码用来删除表的数据
data: it_faglflexa like table of faglflexa, it_faglflext like table of faglflext. select * into corresponding fields of table it_faglflext from faglflext where ryear = '2016' and rbukrs = 'C801'. select * into corresponding fields of table it_faglflexa from faglflexa where ryear = '2016' and rbukrs = 'C801'. delete faglflexa from table it_faglflexa . delete faglflext from table it_faglflext. commit work.
下面的没用:
data: it_faglflexa like table of faglflexa, it_faglflext like table of faglflext. "处理2015无利润中心数据 *SELECT * INTO CORRESPONDING FIELDS OF TABLE it_faglflext * FROM faglflext * WHERE ryear = '2015' AND rldnr = '0L'. * *SELECT * INTO CORRESPONDING FIELDS OF TABLE it_faglflexa * FROM faglflexa * WHERE ryear = '2015' AND rldnr = '0L'. * * *IF it_faglflexa IS NOT INITIAL . * DELETE faglflexa FROM TABLE it_faglflexa . * *ENDIF. *IF it_faglflext IS NOT INITIAL. * DELETE faglflext FROM TABLE it_faglflext. *ENDIF. * *CLEAR:it_faglflexa,it_faglflext. *COMMIT WORK. """"""""""""""""""""""""""""""""""""" "处理2016无利润中心数据 C087 *SELECT * INTO CORRESPONDING FIELDS OF TABLE it_faglflext * FROM faglflext * WHERE ryear = '2016' AND rldnr = '0L' AND rbukrs = 'C087'. * *SELECT * INTO CORRESPONDING FIELDS OF TABLE it_faglflexa * FROM faglflexa * WHERE ryear = '2016' AND rldnr = '0L' AND rbukrs = 'C087'. *IF it_faglflexa IS NOT INITIAL . * DELETE faglflexa FROM TABLE it_faglflexa . * *ENDIF. *IF it_faglflext IS NOT INITIAL. * DELETE faglflext FROM TABLE it_faglflext. *ENDIF. *CLEAR:it_faglflexa,it_faglflext. * *COMMIT WORK. """""""""""""""""""""""""""""""""""""""" "处理结转无利润中心 select * into corresponding fields of table it_faglflext from faglflext where ryear = '2016' and rldnr = '0L' and prctr not between 'C001000000' and 'C999999999'. if it_faglflext is not initial. delete faglflext from table it_faglflext. endif. clear:it_faglflexa,it_faglflext. commit work.