Skip to Content
Author's profile photo Former Member

Configuration for vendor master data exchange ECC CRM

Configuration for vendor master data exchange ECC <—> CRM

if you want to activate the data exchange between ERP vendor master data and CRM business partners than follow below mention step

In transaction SM31, table CRMC_BUT_CALL_FU for the Business Partner Outbound of Business Partner objects, the function VEND_MWX_CREATE_MAIN_BDOC must be active.


In transaction R3AC1 the adapter VENDOR_MAIN must be active.


In transaction SMOEAC shall be a subscription for the publication ‘All Vendors’ to the ERP system (Site). For example you can specify ‘All Vendors (MESG)’ as subscription’s name.


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 CRMSUBTAB for User CRM

The function COM_VEND_MAIN_INBOUND shall be active for object VEND_MAIN of class BUPA for upload

The function PI_BP_VENDOR_MAIN_EXTRACT shall be active for object VENDOR_MAIN of class VEND for download.


Define Number Ranges for Vendor

Tcode BUCF

Note * Identifying Relevant ERP Account Groups & To check which intervals are configured in ERP

Define Grouping and Assign Number Ranges for Vendor


In transaction PIDV please maintain the mapping between the CRM role categories for vendors (usually role category BBP000) and the corresponding ERP account group.

Note: the field ‘Grouping’ in transaction PIDV (ERP) shall be an existing grouping entry in the CRM-table TB001. The values for TB001 can be checked in CRM within transaction SM31 for the view V_TB001. Be aware that the ERP vendor numbers are in the interval of the grouping range assigned to the grouping ID you have selected from view V_TB001. To check which intervals are configured in ERP, please refer to the IMG activity: Logistics – General → Business Partner → Vendors → Control → Define Number Ranges for Vendor Master Records.


Delta load (ERP→CRM)

the function module PI_BP_VENDOR_BTE_1421 should be registered for the event 00001421 and the application BC-MID in the table TBE31 at the ERP-site. For this purpose, use transaction R3AC4.


Initial load (ERPCRM)

Start transaction R3AS.

Select VENDOR_MAIN as Adapter Object and press ENTER. Then run the application.


Use transaction SMW01 in order to check the BDoc transfer for BDoc type VEND_MAIN.

Check if the BDoc processing finalized with no errors (status is green) within transaction SMW01 for BDoc type VEND_MAIN. If this did not happen, check if errors have occurred in the inbound or outbound queues (transactions SMQR and SMQS).


A new corresponding entry is filled in table CRMLIFNR (you can get the parameter PARTNER_GUID from transaction CRMM_BUPA_MAP in CRM)


you can see the ERP vendor number
– in table BUT0ID (tab “Identification” of transaction BP in CRM 5.0 or assignment block “Identification Numbers” in CRM 5.1 and subsequent releases)




Test Execution

Start transaction XK01/XK02 (Create/Change Vendor Master)

On the access screen, mark corresponding Data Sets: Address, Control and Payment Transactions and press ENTER

Maintain any data for Address, Control or Payment Transactions


Check bdoc and then Txn BP





During download of vendor master records from the ERP system to the CRM

system , the BPs need to be differentiated from the customer master BPs

The ECC vendor number, would come across to CRM as the same number prefixed by ‘an identifier’

Example: ECC vendor number 0000500001 –> CRM number V000500001

Reason and Prerequisites

To differentiate easily between the vendor BPs and others in the CRM system

Implement a customer-specific function module for the CRM0_200 middleware user exit in the ERP system that determines the names for the business partners to be created:

     o  In Transaction SE37, create the Z_VENDOR_EXTERNAL_RANGES function group and in it, the Z_VENDOR_EXTERNAL_RANGES function module.

        –  Copy the existing SAMPLE_PROCESS_CRM0_200 example function module to a separate module with the name Z_VENDOR_EXTERNAL_RANGES. Save the module and activate it.

–  Implement the code present in the mention below You can   change it according to your own requirements. The example code suffixes ‘V’ before the first 9 digits of the vendor number before it is downloaded to CRM.

    –  In the transaction PIDV on the ERP system assign the relevant account group to be replicated into CRM BP with grouping which has the appropriate external number ranges settings.

–  Save the module and activate it.


*   System-defined Include-files.                                 *
*   User-defined Include-files (if necessary).                    *

FUNCTION z_vendor_external_ranges.
*"*"Local Interface:
*  Program Name: SAPLZ_VENDOR_EXTERNAL_RANGES                          *
*                                              *
*   Description: To avoid a possible number range overlap between      *
*                Customers and Vendors in the CRM system. We need to   *
*                implement a customer-specific function module to be   *
*                called by middleware during the vendor replication    *
*                process in ECC.                                       *
*             Cut                                                      *
* Programmer  Over                          *
* ----------  ---- -------- ------- -----------------------------------*
*                                                                      *
*                                                                      *
*                                                                      *
*                                                                      *
  DATA: ls_bapimtcs   TYPE bapimtcs,
          ls_v_crm_vend TYPE r3a_vend,
          ls_user_exit  TYPE bapibus1006_head,
          lt_user_exit  TYPE TABLE OF bapibus1006_head,
          ls_r3a_vend   TYPE r3a_vend,
          ls_bsc_maini  TYPE bsc_maini,
          lv_num(9)     TYPE n.
  DATA wa_bapimtcs TYPE bapimtcs .
  DATA: lv_index TYPE sy-tabix.
  FIELD-SYMBOLS: <fs_v_crm_vend>     TYPE r3a_vend.
  CASE i_obj_name.
      LOOP AT t_bapistruct
        WHERE segtype = 'DA' AND tabname = 'R3A_VEND'.
        ASSIGN  t_bapistruct-data        TO <fs_v_crm_vend> CASTING.
        MOVE-CORRESPONDING <fs_v_crm_vend> TO ls_v_crm_vend.
*   Set the key field, this has to be the WERKS of the PLANT
        ls_user_exit-extern_no = ls_v_crm_vend-vendor_no.
*   Set the partner number for external numbering
        SHIFT ls_v_crm_vend-vendor_no LEFT  DELETING LEADING '0'.
        IF STRLEN( ls_v_crm_vend-vendor_no ) <= 9.
          MOVE  ls_v_crm_vend-vendor_no TO lv_num.
          CONCATENATE 'V' lv_num INTO ls_user_exit-bpartner.
*    ls_user_exit-bpartner = ls_v_crm_cp-werks.
*   Set the grouping (leave empty for external standard)
          ls_user_exit-partn_grp  = 'VEND'.
          APPEND ls_user_exit TO lt_user_exit.
*     Update Vendor Partner Number for external numbering
      CLEAR wa_bapimtcs.
      LOOP AT t_bapistruct INTO wa_bapimtcs
        WHERE segtype = 'DA' AND tabname = 'BSC_MAINI'.
        lv_index = sy-tabix.
        wa_bapimtcs-data+0(1) = 'V' .
        MODIFY t_bapistruct FROM wa_bapimtcs INDEX lv_index TRANSPORTING data. " WHERE tabname = 'BSC_MAINI'.
      ENDLOOP .
      CLEAR wa_bapimtcs .
      LOOP AT t_bapistruct INTO wa_bapimtcs
              WHERE segtype = 'DA' AND tabname = 'R3A_VEND'.
        lv_index = sy-tabix.
        wa_bapimtcs-data+1(1) = 'V' .
        MODIFY t_bapistruct FROM wa_bapimtcs INDEX lv_index TRANSPORTING data. " WHERE tabname = 'R3A_VEND'.
* Append the BAPIMTCS structures for the external numbering
  ls_bapimtcs-segtype = 'DA'.
  ls_bapimtcs-tabname = 'BAPIBUS1006_HEAD'.
  LOOP AT lt_user_exit INTO ls_user_exit.
    CLEAR ls_bapimtcs-data.
    MOVE ls_user_exit TO ls_bapimtcs-data.
    APPEND ls_bapimtcs TO t_bapistruct.


Register this function module for the CRM0_200 exit user in the ERP system.

– Use Transaction SM30, table TPS34, to go to the maintenance of the modules. Here, enter the Z_VENDOR_EXTERNAL_RANGES  module for the CRM0_200 process.


– Use Transaction SM30, table TBE24, to check whether the

application you have selected (Product column in TPS34) is active.


Note:- 1) The vendor account group should not be sent to crm as it is not possible to handle it in CRM and also it is not required in CRM classification Tab is not visible for vendor or plant in CRM

2)The most common standard value for this field is BBP000, but you can also configure other roles for vendors. E.g.: a customer has created a new role category ZVEND1,(created BP Role and BP Category=ZVEND1) and placed this role category in PIDV in order to map to a 2nd account group. He has created some new roles for this new category: ZVEN1 and ZVEN2. In addition, the customer still uses the role BBP000.


SAP Note 883162 – Configuration guidelines for vendor data exchange

SAP Note 1044637 – Customize Vendor Numbers (above mention code is bit different from SAP code )

SAP Note 942062 – Vendor account group incorrectly filled in R/3

Assigned tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Thanks for this post Vaibhav.

      I Manage to setup vendor master following your guide and note 883162.

      but I have problems with note 1044637 to get a prefix to the external number range.

      I have defined an external number range in CRM (A-ZZZZZZZZZZ).

      When I download a vendor record (for example ID 100000), I expect to get VEND1000000 to CRM.

      But Bdoc complains that partner ID is not in the number range A-ZZZZZZZZZZ.

      PIDV settings are aligned with the right grouping.

      help appreciated.

      Author's profile photo Former Member
      Former Member
      Blog Post Author


      that note have some issue that why i add few modification to code.

      check code mention in blog.



      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Debugging of the R/3 back-end processing of Request download

      • Ensure that a dialog user has been assigned to the RFC destination used for the R/3 back-end connection.
      • On the initial screen of the Request load (transaction R3AR2), you must enter '/h' in the command field in order to change to debugging mode, then you can execute the transaction.
      • Then activate the 'Settings -> Display and change all' function in the debugging mode and set the "In background task: Do not process" flag.
      • Then choose 'Continue' (F8) to exit the debugging mode start the Request Load.
      • The system now displays queue R3AR_REQ_VENDOR_1 in transaction SMQ1 ('Outbound Queue'). Select this queue. On the following screen, position the cursor on the queue name and choose 'Select' again. Then position the cursor on function module CRS_FIRST_DOWNLOAD_TRIGGER and execute 'Edit -> Debug LUW'
      • Now you should be in the debugging mode of the R/3 back-end system.
        Technical background information:
        Here, function module CRS_FIRST_DOWNLOAD_TRIGGER calls function module xxx which makes the Vendor selection. This function module in turn calls function module CRS_SEND_TO_SERVER which transfers the data to CRM Middleware. Afterwards, the customer exit of CRM Middleware is called.
      • For example, execute 'Breakpoint -> Breakpoint at -> Function module' now and enter the name of the corresponding function module (for example,Z_VENDOR_EXTERNAL_RANGES ). Then the program should stop in the first line of this module.


      Vaibhav Shah

      Author's profile photo Former Member
      Former Member

      Thanks for your such detailed tutorial. It's wonderful.

      Author's profile photo Former Member
      Former Member

      very in depth. Great one!

      Author's profile photo Former Member
      Former Member

      Great Job..Vaibhav

      Author's profile photo zafar karnalkar
      zafar karnalkar


        Nice document, I try in our system its working proeprly, just wanted to change one thing our ECC number are 0001000000 to 0001999999, now when I am adding the suffic 'F' in my CRM Number range it is coming as 'F001000000', which is right as per the details you have given but i want to save the details as 'F1000000' for this at run time I am deleting the leading zero but system is not saving the BP in CRM with proper no. as ''F001000000' it is adding some additional no. as 'E3' which is first two digits of GUID.


      See the 3rd and 4th record, first 2 records are Ok as per this document.



      Author's profile photo Neha Gupta
      Neha Gupta

      Great Job. It was helpful

      Author's profile photo Former Member
      Former Member

      Very detailed and wholesome... Looking forward to more such post 🙂