Skip to Content
0

Sales Order replication for custom fields from CRM to ECC

Sep 21, 2017 at 05:54 AM

151

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member
Oct 17, 2017 at 09:55 PM
0

Dear Kiran,

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

Thank you

regards - Christophe

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Apr 27 at 09:53 AM
0

Thanks Guys,

The issue is solved

Share
10 |10000 characters needed characters left characters exceeded