I encountered an issue with the transfer of product master data from ECC to APO.
To clarify the situation:
On ERP side
1) In CIF settings (transaction CFC9) "Change Transfer for Material Master" is marked "2" (BTE transfer, immediately).
2) In Change Pointers for Message Types settings (transaction BD50) "CIFMAT" message type is activated.
3) Option of changing pointers generally is activated (transaction BD61).
On SCM side
1) There is an enhancement APOCF005, source code is provided below.
The issue is that if previously material had a deletion flag and later it was lifted on ECC side, this change is not reflected on APO side (i.e. material on APO side still is being considered as having deletion flag, whereas it was lifted on ECC side).
What am I missing? Does the problem have to do with incorrect settings or incorrect source code?
Looking forward to hearing from you, any reply will be deeply appreciated.
DATA: ls_sapo_matloc TYPE /sapapo/matloc. FIELD-SYMBOLS: <fs_cifmat> TYPE /sapapo/cif_matloc. FIELD-SYMBOLS: <fs_matlocx> TYPE /sapapo/cif_matlocx. IF ls_sapo_matloc-lvorm = 'X'. ** If deletion flag is set (/SAPAPO/MATLOC-LVORM = «X») IF ls_sapo_matloc-beskz = 'P' AND <fs_matlocx> IS ASSIGNED. ** If /SAPAPO/MATLOC-BESKZ = «P» CLEAR <fs_matlocx>-beskz. ELSE. ** If /SAPAPO/MATLOC-BESKZ <> «P» <fs_cifmat>-beskz = 'P'. IF <fs_matlocx> IS ASSIGNED. <fs_matlocx>-beskz = 'X'. ENDIF. ENDIF. ELSE. ** If deletion flag is not set(/SAPAPO/MATLOC-LVORM = « ») IF <fs_cifmat>-method = 'D' AND <fs_cifmat>-loctype = '1007'. ** If IT_MATLOC-METHOD = «D» & IT_MATLOC-LOCTYPE = «1007» <fs_cifmat>-beskz = 'P'. UNASSIGN <fs_matlocx>. READ TABLE it_matlocx ASSIGNING <fs_matlocx> WITH KEY ext_matnr = <fs_cifmat>-ext_matnr ext_locno = <fs_cifmat>-ext_locno. IF <fs_matlocx> IS ASSIGNED AND sy-subrc IS INITIAL. <fs_matlocx>-beskz = 'X'. ENDIF. ELSE. ** If IT_MATLOC-LOCTYPE <> «1007» or IT_MATLOC-METHOD <> «D» UNASSIGN <fs_matlocx>. READ TABLE it_matlocx ASSIGNING <fs_matlocx> WITH KEY ext_matnr = <fs_cifmat>-ext_matnr ext_locno = <fs_cifmat>-ext_locno. ENDIF. ENDIF. ENDIF.