
Now a days it is a quite common scenario to enhance the sales order with the additional custom fields which will have to flow from CRM to ECC and vice versa. There are different ways to achieve this scenario like applying the Business Transaction Events or intermediate FM calls etc.. But comparatively this will be the better approach. In this blog I am going to explain the scenario of the additional filed (AET/EEWB) flow from CRM to ECC. In next blog will publish the data flow from ECC to CRM.
Before the implementation better to check the all relevant settings of middle ware like sales document adapter object filter, SMOF tables and Administration Console.
Sales Order Container | Structure of the table |
Header | BAPE_VBAK |
Item | BAPE_VBAP |
Line Item | BAPE_VBEP |
Finding the relevant structure:
Please check the CRMD_ORDERADM_H and CRMD_ORDERADM_I to find the structure, you will find the DUMMY attribute, you will get this structure in the appending structure description.
Sales Order Container | Structure of the table | Update Structure of the table |
Header | VBAKOZ | VBAKOZX |
Item | VBAPOZ | VBAPOZX |
Line Item | VBEPOZ | VBEPOZX |
Finding the relevant structure:
Please check the VBAK,VBAP and VBEP to find the structure, you will find the DUMMY attribute, you will get this structure in the appending structure description.
Note : All the OZX structure has to be appended with Update flag with char 1.
METHOD if_ex_crm_dataexchg_badi~crm_dataexch_after_bapi_fill.
<lfs_bapishd1x> TYPE bapisdhd1x.
DATA : lwa_orderadm_h LIKE LINE OF it_bus_trans_msg-orderadm_h,
lwa_bapirex TYPE bapiparex,
w_data(240) TYPE c.
LOOP AT it_bus_trans_msg-orderadm_h INTO lwa_orderadm_h.
CLEAR lwa_bapirex.
lwa_bapirex-structure = 'BAPE_VBAK'.
lwa_bapirex-valuepart1+0(10) = lwa_orderadm_h-object_id.
lwa_bapirex-valuepart1+10( field length) = lwa_orderadm_h-XXXXXXXXXXXX.
APPEND lwa_bapirex TO ct_bapiparex.
CLEAR lwa_bapirex.
lwa_bapirex-structure = lc_bape_vbakx.
lwa_bapirex-valuepart1+0(10) = lwa_orderadm_h-object_id.
lwa_bapirex-valuepart1+10(1) = 'X'.
APPEND lwa_bapirex TO ct_bapiparex.
CLEAR lwa_bapirex.
ENDLOOP.
ENDMETHOD.
Checking the data :
Go to SMW01 and find the related sales order queue with name. Please check the data in extended structure, there e you will find the data in the segment.
Method : IF_BADI_SD_SALESDOCU_BAPI~MOVE_EXTENSIONIN
IF cs_vbakkom-vbkla(3) = 'CRM'. // better to use by sy-uname from the CRM0_READ_RFC_DEST
DATA : lwa_bapirex TYPE bapiparex.
CLEAR : lwa_bapirex.
READ TABLE it_extensionin INTO lwa_bapirex WITH KEY structure = ‘BAPE_VBAK'.
IF NOT lwa_bapirex IS INITIAL.
cs_vbakkom-XXXXXXXXX = lwa_bapirex-valuepart1+10(field length).
ENDIF.
CLEAR : lwa_bapirex.
READ TABLE it_extensionin INTO lwa_bapirex WITH KEY structure = ‘BAPE_VBAKX'.
IF NOT lwa_bapirex IS INITIAL.
cs_vbakkomx-XXXXXXXXX = lwa_bapirex-valuepart1+10(1).
ENDIF.
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
2 | |
2 | |
2 | |
1 | |
1 | |
1 |