SORT IT_KMYE BY XH GKKMBH HKONT ERP_ZZFI02 ERP_ZZFI03 ERP_ZZFI04 ERP_ZZFI09 ERP_ZZFI10 ERP_ZDNLX ERP_ZRZLX ERP_ZYHZH ERP_ZZHSX. " SAP科目和管控科目存在多对一
DELETE ADJACENT DUPLICATES FROM IT_KMYE COMPARING XH GKKMBH HKONT ERP_ZZFI02 ERP_ZZFI03 ERP_ZZFI04 ERP_ZZFI09 ERP_ZZFI10 ERP_ZDNLX ERP_ZRZLX ERP_ZYHZH ERP_ZZHSX.
"获取所有带科目余额的SAP科目
REFRESH IT_GK_KMYE .
REFRESH IT_HKONT.
LOOP AT IT_KMYE .
IT_HKONT-HKONT = IT_KMYE-HKONT .
- "获取科目余额 it_kmye-sapqmye
CLEAR ITAB_WA .
READ TABLE ITAB INTO ITAB_WA WITH KEY SAKNR = IT_KMYE-HKONT
ZZFI09 = IT_KMYE-ERP_ZZFI09
ZZFI10 = IT_KMYE-ERP_ZZFI10
ZZFI02 = IT_KMYE-ERP_ZZFI02
ZZFI03 = IT_KMYE-ERP_ZZFI03
ZZFI04 = IT_KMYE-ERP_ZZFI04
ZYHZH = IT_KMYE-ERP_ZYHZH
ZZHSX = IT_KMYE-ERP_ZZHSX
ZZFIELD1 = IT_KMYE-ERP_ZDNLX
ZZFIELD2 = IT_KMYE-ERP_ZRZLX.
IT_KMYE-SAPQMYE = ITAB_WA-ENDINGBALANCE.
IT_KMYE-SAPQCYE = ITAB_WA-OPENINGBALANCE.
MODIFY IT_KMYE .
ENDLOOP.