Showing results for 
Search instead for 
Did you mean: 

Sales Order replication for custom fields from CRM to ECC

Former Member
0 Kudos


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


I see the data flowing till BDOC, but not replicating to ECC

Code added in CRM BADI:


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.

* wa_bape_vbap-ZZCUSTOM1_I = 'ZZCUSTOM1_I'." Custom field.

* wa_bapiparex-valuepart1 = wa_bape_vbap.


Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks Guys,

The issue is solved

Active Contributor
0 Kudos

Dear Kiran,

Can you please review the notes 1053817 and 143580 which should help in this case?

Thank you

regards - Christophe