+*CRM Business Partner Replication*+   *•1.    *CRM Middleware Overview

CRM uses Middleware to transfer data to/from CRM server to other systems . The transfer is performed using Business Documents commonly known as bdocs . BDOC’s are structured documents with contents of the entire business object ( e.g business partner ) stored in them . The bdocs are transferred using Qrfc technology .

*•2.    **_Business Partner Replication Overview_* The current blog series discusses the configuration settings required for the             Replication of  business partner data ( customers and vendors ). Part 1 discusses the steps involved in setting up a Delta upload ( CRM -> ECC ) Part 2 discusses the steps involved in setting up a Delta download ( ECC -> CRM )   Part 3 discusses the key middleware transactions & debugging the middleware . Customer( Sold to Party ) and Vendors Roles are transferred .   BP is created in CRM via transaction *‘BP’. *The Business Partner can be a Person or Organization. The bdoc created is *BUPA_MAIN* for the customer role and *VEND_MAIN* for the vendor role. I was working with ECC 6.0 and CRM 5.0 . Vendor replication is possible in ECC 6.0 but not available in versions like 4.6 I think . Please refer to the reference material at the end of the blog and service.sap.com to identify whether you can perform vendor replication in your environment .   *•3.    **_Business Partner  Replication ( CRM to R/3 )_* The process of BP replication from CRM to ECC is called Upload.Initial uploads are performed as part of the data migration process ( Creates only ) . Delta Uploads are performed whenever a new bp is created or changed . When the application is saved the BP data is stored in the application tables in CRM and also a message BDOC (mBDOC) is created ( BUPA_MAIN( customer role) and VEND_MAIN ( vendor role ) ) . This is done for all customers with *classification Customer, Consumer , Competitor , Prospective Customer  and for all bp with vendor roles* . *A>Message Flow * *CRM* This BDOC is sent to the outbound flow via qRFC  .The Flow context MO1 and MOA is called . Each Flow context has a set of services ( function modules ). ** For each receiver the _Outbound Adapter_ is called . Here the mBDOC is converted to BAPIMTCS data structure ** The receiving system receives the BAPIMTCS data container via qRFC . Queue ( Outbound ) is R3AU* *ECC* Receiving system ( ECC ) 0.1. Function Module CRM_UPLOAD_TRIGGER is called which calls the corresponding function modules for the object ( table CRMSUBTAB ) . This stores the data in the ECC tables ( Vendor/Customer record created ) .The function module IDOC_INPUT_CREDITOR/DEBITOR is called which performs a BDC to load the vendor/customer 0.2. Finally a synchronous confirmation callback  to CRM is made  . The bdoc involved is CUSTOMER_MAIN .The return call can be held in a RFC outbound queue in ECC and it is manually released ( based on the configuration of the CRMRFCPAR in ECC )   *CRM ( CONFIRMATION)*   0.1. The confirmation is executed in CRM which verifies that the initial message was received by ECC . A link table is maintained in both systems so that the Customer number in ECC and the BP object GUID are linked. *B>Customer Replication* *  i>Functional Setup*   0.1. *Defining the Number range ( CRM )*For the business partners created in the CRM system you have to define number ranges. You can define one number range for all classifications or define for example a separate number range for each classification.   | | *Transaction code* | BUCF | | | *SAP CRM IMG menu* | | +Cross Application Components+ ® +SAP++Business Partner+ ® +Business++Partner+ ® +Basic++Settings+ ® +Number++Ranges and Groupings+ ® +Define Number Ranges+   0.1. *Create the following groupings(CRM)*            | | *Transaction code* | SPRO | | | *SAP CRM IMG menu* | | +Cross Application Components+ à +SAP++Business Partner+ à +Business++Partner+à +Basic++Settings+ à +Number++Ranges+ +and Groupings+ à +Define Grouping and Assign Number Ranges+               For each of the classifications you can keep a different number range group     0.1. *Create the Number ranges in ECC *

*Transaction code* OVZC
*SAP ECC IMG menu* +Logistics – General+ ® +Business Partner+ ® +Customers +® +Control+ ® +Define and assign customer number ranges+

!https://weblogs.sdn.sap.com/cs/blank/edit/wlg/|height=1|alt=|width=1|src=https://weblogs.sdn.sap.com/cs/blank/edit/wlg/|border=0!Image006 Acc Grp C 2 52669 5259519

The external flag needs to be selected

  • *Create the account groups and assign the number range to the account group.*

*             *  Every customer created in ECC will have an account group . The account group is key to detailing the field statuses , number range and a whole lot of other details                                           Image008 52672 3750101                     For each of the classifications you can keep a different account group if they have a different number range group in CRM. Account Groups will be set to external in ECC.   _** Need to make sure that the customers created in CRM and transferred to ECC are set in a different number range to customers created in ECC. This will avoid confusion regarding where the customer is created._     0.1. *Define the Partner functions* *and connect to the account group created*   Please do the following account group assignments:  Image012 52674 5793904   Please note that a partner function can be connected to multiple account groups .     0.1. *Mapping the CRM Classifications to ECC Account Groups ( ECC )( ( transaction PIDE )*  | | *Classification* | | *Account Group* | | *Name**Synchronizing Field Settings for Customers ( SAP ECC ) with Business Partners in CRM *

For testing purposes set all mandatory fields in the account group to optional in ECC. In productive systems all fields must be synchronized with the CRM system.

In order to replicate business partners from the OLTP ECC to the CRM system and vice versa you have to synchronize the field settings for business partner, i.e. if a master data record field in the receiving system has the setting +Required Entry+ an upload is only successful if this field maintained in the master data record of the sending system.

*Transaction code* OVT0
*SAP ECC IMG menu* | +Logistics General +à +Logistics Basic Data: Business partners+ | à +Customers +à Control à+ Define account groups and field selection for customer+     0.1. 1. Choose an account group that is relevant for the mapping. 0.2. 2. Choose +Details+.0.1. 3. Double-click the text +General Data+ in the screen area +Field status+.0.1. 4. Double-click on each of the different entries in the +Select Group+ area, for example, +Address+. The corresponding field list is displayed.0.1. 5. Repeat these steps for all field status areas (Company code data, Sales data). 0.2. 6. In the *CRM system* choose the IMG activity: +Cross-Application Components+ à +SAP Business Partner+ à +Business Partner+ à +Basic Settings+ à +Field Groupings+ à +Configure Field Attributes per BP Role+0.1. 7. Choose the business partner roles that correspond to the account group and check if the required entries are identical. In order to check if the replication of business partners works in general without regarding problems caused by incomplete master record fields you can set all fields for the relevant account groups to status +Optional+. After a successful test replication for a single business partner you have to reset these fields to status +Required+ in order to avoid data inconsistencies.   Sometimes some the fields do not get passed across to ECC , in which some of the BTE events need to be tweaked to fill the field . The BTE is a function module which gets called during the inbound process in ECC and the field can be filled based on various criteria.   For e.g if the country field needs to be filled construct the function module with the following code *******sample code

FUNCTION ZFILLBP.

*”———————————————————————

*”*”Local Interface:

*” IMPORTING

*” VALUE(IS_COMPLEX_STRUCTURE) TYPE BUSEI_COM_EXTERN

*” VALUE(IS_COMPLEX_STRUCTURE_RELATIONS) TYPE BUSEI_RCOM_EXTERN

*” TABLES

*” CT_IDOC_CONTROL STRUCTURE EDIDC

*” CT_IDOC_DATA STRUCTURE EDIDD

*” IT_BAPIMTCS STRUCTURE BAPIMTCS

*”——————————————————————— DATA : E_GEN_DATA TYPE E1KNA1M . loop at ct_idoc_data where segnam eq ‘E1KNA1M’. clear e_gen_data . e_gen_data = ct_idoc_data-sdata . e_gen_data-spras = ‘DE’. e_gen_data-land1 = ‘GB’. ct_idoc_data-sdata = e_gen_data . modify ct_idoc_data . endloop. loop at ct_idoc_data where segnam eq ‘E1KNA1M’. clear e_gen_data . e_gen_data = ct_idoc_data-sdata . ENDLOOP. loop at ct_idoc_data where segnam eq ‘E1KNA1M’. clear e_gen_data . e_gen_data = ct_idoc_data-sdata . ENDLOOP. ENDFUNCTION.   *******end sample code                             This is called when the Idoc structure for updating the Customer is called . Then attach the function module to the BTE event *DE_BALE . *This is done via transaction FIBF

BTE events are events called at various points in the application . It is possible to attach exits ( function modules ) to these events and write custom code . The interface of the event defines what fields are accessible and what can be modified .

Image020 52676 6912772

*_ii>Pre-requisites _*

It may be required that an Account Group customizing load is performed into CRM from ECC before the replication is performed. This is because the CUST_MAIN status idoc fails if there is no account group in CRM. This is held in the table T077d table .There may be other objects as mentioned in the Configuration guide

There are some prerequisite configuration objects before you load business partners. Make sure the necessary configuration objects are loaded successfully (transaction R3AM1+)+.
The essential 12 configuration objects are the following:
DNL_CUST_ACGRPB, DNL_CUST_BNKA, DNL_CUST_ADDR, DNL_CUST_KTOKD, DNL_CUST_TVPV, DNL_CUST_TVLS, DNL_CUST_TVIP, DNL_CUST_TVGF, DNL_CUST_TVKN, DNL_CUST_TKUKL, DNL_CUST_TVFS, DNL_CUST_TVAST, DNL_CUST_TSAB, DNL_CUST_TPFK, DNL_CUST_T502T, DNL_CUST_TBRC.

If you are working with consumers you have to replicate the reference customer before.Based on current requirements Consumers were not being used .

*Procedure*

  • 1. To replicate the customers, either as specified in the filter or all customers, into the CRM system, access the activity using one of the following navigation options:
*Transaction code* R3AS
*SAP CRM menu* +Architecture and Technology +® +Middleware +® Data Exchange ®+ Initial Load +® +Start+
  • 2. In the +Load Object+ field, enter +CUSTOMER_MAIN+.
  • 3. In the +Source Site+ field enter +OLTP+ and in the +Destination Site+ field enter +CRM+.
  • 4. To run the replication, choose +Execute (F8)+.

The Customer status updates ( CUSTOMER_MAIN ) was erroring out .The reason was that the table CRMC_T077D was not populated . This is loaded in the Account group customizing download

Image024 52678 7485982

* iii>_Technical Setup_*

  • Make sure the highest available Plug-In (PI) Support Packages plus Core Support Packages are installed in the OLTP(ECC) in the same way as on the CRM/EBP server.
  • Check the setting for ECC table CRMRFCPAR (see chapter +Maintaining Table CRMRFCPAR+).The CUSTOMER_MAIN bdoc entry must be present in the table.

Image002 52680 1472950

Hold Data holds the data in ECC before sending to CRM ( useful to set for debugging as it is held in the outbound queue )

  • Check the RFC connections from CRM to ECC and vice versa. ( Transaction SM59 )

Image033 52682 7027115

  • Create the Sites and link them to the RFC destination ( transaction SMOEAC ) . CRM & ECC are the sites in our case .

  • Create Subscriptions which connects the publication to the site

Image037 52684 6760620

  • Make sure that the Function modules connected to the Flow contexts are active.
  • In transaction R3AC1 the adapter objects BUPA_MAIN and CUSTOMER_MAIN must be active. A filter for each role of role category customer can be set for object BUPA_MAIN so that only relevant business partners are transferred.

  • In table CRMSUBTAB ( in ECC ) the entries for BUPA_MAIN and CUSTOMER_MAIN should be active .

*iv>Actual Transfer*

  • *Create a Business Partner ( transaction BP )*

Bp1 52686 4188633

*             * 

  • *Check the BDOC log (SMW01 )*

*This shows that the bdoc BUPA_MAIN has been transferred to the ECC system and is awaiting confirmation .*

  • *Check the Customer master in ECC ( transaction xd03 )*

Image047 52688 9005162

  • Check the outbound queue in ECC ( smq1 ) and the confirmation is waiting in the queue . Reason is the setting in CRMRFCPAR . Execute LUW. This will send the confirmation back . In productive environment this will be automatic .

  • *Check the logs in CRM *

Image051 52690 6160541

* C> *Vendor Replication

*_         i>Functional Setup_*

  • *Defining the Number range *

Same as for customer

  • *Create the following groupings*

Same as for customer

  • *Create the Number ranges in ECC *

External number range for CRM BP Vendor roles .

  • *Create the vendor account groups and assign the number range to the account group*

Image057 52692 9479504

Image062 52694 4174331

**                    Need to make sure that the vendors created in CRM and transferred to ECC are set in a different number range to vendors created in ECC. This will avoid confusion regarding where the vendor is created.     0.1. connecting the BP vendor role to the account group*( transaction PIDV )*        0.1. *Synchronizing Field Settings for Vendors ( SAP ECC ) with Business Partners in CRM *

 

For testing purposes set all mandatory fields in the account group to optional in ECC. In productive systems all fields must be synchronized with the CRM system.

 

In order to replicate business partners from the OLTP ECC to the CRM system and vice versa you have to synchronize the field settings for business partner, i.e. if a master data record field in the receiving system has the setting +Required Entry+ an upload is only successful if this field maintained in the master data record of the sending system.

Image066 52696 7814332

 

 

 

+Define Account Groups and Field Selection ({code:html}*Vendor*{code})+: select the group (or groups) you have defined for exchange in transaction PIDV. Press the button +Details+. Double-click on the corresponding data groups (on the text) listed in the frame +Field Status+, for example double-click on +General Data+ and then on the data group +Address+

and

+Define Transaction-Dependent Screen Layout+: select the activity type and press the button +Details+. Double-click on the corresponding data groups (on the text) listed in the frame +Field Status+, for example double-click on +General Data+ and then on the data group +Address+.

Sometimes some the fields do not get passed across to ECC , in which some of the BTE events need to be tweaked to fill the field . The BTE is a function module which gets called during the inbound process in ECC and the field can be filled based on various criteria. Check the example for Customer Load.

Image070 52698 6325241

*_     ii>Pre-requisites _*

It may be required that an Account Group customizing needed are performed . There was none needed in the systems where the demo was done .

*Procedure*

  • 5. To replicate the customers, either as specified in the filter or all customers, into the CRM system, access the activity using one of the following navigation options:
*Transaction code* R3AS
*SAP CRM menu* +Architecture and Technology +® +Middleware +® Data Exchange ®+ Initial Load +® +Start+
  • 6. In the +Load Object+ field, enter +VENDOR_MAIN+.
  • 7. In the +Source Site+ field enter +OLTP+ and in the +Destination Site+ field enter +CRM+.
  • 8. To run the replication, choose +Execute (F8)+.

*       iii>_Technical Setup_*   0.1. Make sure the highest available Plug-In (PI) Support Packages plus Core Support Packages are installed in the OLTP(ECC) in the same way as on the CRM/EBP server. 0.2. Check the setting for ECC table CRMRFCPAR (see chapter +Maintaining Table CRMRFCPAR+).The VENDOR_MAIN bdoc entry must be present in the table.              0.1. Check the RFC connections from CRM to ECC and vice versa and linking to site & Check the subscriptions / publications for CRM upload .                                     Same as customer   0.1. Create the Sites and link them to the RFC destination ( transaction SMOEAC ) . CRM & ECC .                                     Same as customer   0.1. Create Subscriptions which connects the publication to the site Image074 52700 6159243     0.1. Make sure that the Function modules connected to the Flow contexts are active. 0.2. In transaction R3AC1 the adapter objects VENDOR_MAIN and VEND_MAIN must be active. A filter for each role of role category customer must be set for object VEND_MAIN so that only relevant vendors are transferred.   0.1. In ECC , Within transaction SM31, in the table *COM_BUPA_CALL_FU* for R/3 object inbound processing (time R3OBI) of vendor records (object VEND), the function PI_BP_PROXY_BAPI_VENDOR must be active, and the function PI_BP_PROXY_BAPI_CUST_VEND must not be active. In transaction SM31, table CRMC_BUT_CALL_FU for the Business Partner            Outbound of Business Partner objects, the function MWX_CREATE_MAIN_BDOC             must be active ( CRM outbound )   Bp2 52702 8989906                               0.1. In transaction SM31, table *CRMSUBTAB* for User CRM the function *COM_VEND_MAIN_INBOUND* shall be active for object VEND_MAIN of class BUPA for upload*             PI_BP_VENDOR_MAIN_EXTRACT* shall be active for object VENDOR_MAIN of    class VEND for download.       *iv>Actual Transfer ( CRM to R/3 )*   0.1. Create a Business Partner ( transaction BP ) in vendor role   *             * 

  • Check the BDOC log (SMW01 )

Image082 52704 3927979

New NetWeaver Information at SAP.com

Very Helpfull

 

 

User Rating: Be the first one !