Hi,
I have a requirement to transfer custom fields data of Sales Order from CRM to ECC
in CRM I have created 5 fields in CRMD_ORDERADM_H using AET
in ECC I have added the same fields to VBAK table
I have also enhanced the structure BAPE_VBAK in both CRM and ECC
I have also enhanced the structure BAPE_VBAKX, VBAKOZ and VBAKOZX in ECC
in CRM I have enhanced the BADI CRM_DATAEXCHANGE_BADI and added my code to method
IF_EX_CRM_DATAEXCHG_BADI~CRM_DATAEXCH_AFTER_BAPI_FILL
I see the data flowing till BDOC, but not replicating to ECC
Code added in CRM BADI:
method IF_EX_CRM_DATAEXCHG_BADI~CRM_DATAEXCH_AFTER_BAPI_FILL.
DATA: wa_bape_vbap TYPE bape_vbap,*
*read table IT_BUS_TRANS_MSG into ls_bus_trans_msg
wa_bapiparex TYPE bapiparex.
data: ls_orderadm_h TYPE bad_orderadm_h_mess,
ls_orderadm_i type BAD_ORDERADM_I_MESS.
* wa_bapiparex-structure = 'BAPE_VBAPX'.
LOOP AT IT_BUS_TRANS_MSG-orderadm_h into ls_orderadm_h.
* loop at IT_BUS_TRANS_MSG-orderadm_i into ls_orderadm_i.
wa_bapiparex-structure = 'BAPE_VBAK'.
wa_bapiparex-valuepart1+0(10) = ls_orderadm_h-object_id.
wa_bapiparex-valuepart1+10(12) = ls_orderadm_h-zzcustom1.
* wa_bapiparex-valuepart1+10(8) = ls_orderadm_h-number_int+4(6).
* wa_bapiparex-valuepart1+16(12) = ls_orderadm_h-zzcustom1.
APPEND wa_bapiparex TO ct_bapiparex.
wa_bapiparex-structure = 'BAPE_VBAKX'.
wa_bapiparex-valuepart1+0(10) = ls_orderadm_h-object_id.
* wa_bapiparex-valuepart1+10(6) = ls_orderadm_i-number_int+4(6).
wa_bapiparex-valuepart1+10(1) = 'X'.
APPEND wa_bapiparex TO ct_bapiparex.
CLEAR wa_bapiparex.
* endloop.
ENDLOOP.
* wa_bape_vbap-ZZCUSTOM1_I = 'ZZCUSTOM1_I'." Custom field.
* wa_bapiparex-valuepart1 = wa_bape_vbap.
ENDMETHOD