Create business partners, customers, and vendors in SAP ERP Central Component starting from SAP CRM. Then ensure that the data stays updated in both systems. The process involves the use of middleware and Customer/Vendor Integration functions. The combination of the two functions provides the total end-to-end solution.
Key Concept
In SAP ERP Central Component (SAP ECC), Customer/Vendor Integration (CVI ) facilitates the creation of customers and vendors from business partner records. The business partners created in SAP CRM are passed through to SAP ECC via middleware. On receipt of the data in SAP ECC, the business partners are created followed by the triggering of the CVI programs that subsequently create the customers and vendors. Any changes to the customers, vendors, or business partners are automatically updated across SAP CRM and SAP ECC to ensure that the data is consistent in all systems and all occurrences of the data.
Your new project has started and you are tasked with implementing SAP CRM and SAP ERP Central Component (SAP ECC). The main point of master data entry is SAP CRM, but you want to perform functions using customers and vendors in SAP ECC. For example, you might use the customers and vendors in SAP ECC to process agency business, such as invoice vendors, and pass on fees to the customers. Or you might use Internet Sales in SAP CRM and pass the sales order through to SAP ECC.
You need to get the business partners from SAP CRM to SAP ECC and concurrently create customer and vendor records. Standard middleware can handle most of this requirement, but you also need to implement Customer/Vendor Integration (CVI).
Business Logic
Say you want to enter the business partners using the new SAP CRM WebClient UI in SAP CRM 2007 user interface. You would also like to be able to:
- Use the master data in SAP ECC as customers and vendors
- Maintain the same business partner/customer number across SAP CRM and SAP ECC
- Maintain the master data in SAP ECC or SAP CRM with any changes to the business partner, customer, or vendor updated automatically in the other system.
Figure 1 shows the main logic of what is required. If you have these requirements, then you need CVI.

Figure 1
Diagram of business requirements for maintaining business partners, customers, and vendors in SAP CRM and SAP ECC
In this example, the flow starts with the master data being entered into SAP CRM. The middleware BDoc BUPA_MAIN sends the data to SAP ECC. The middleware then unpacks data in the BDoc and executes functions to create the business partners, customers, and vendors.
You might be thinking “Sounds too hard, I'm not a middleware person, and I probably won't need this.” If so, you might want to think again. Since implementing the process I'll describe, I have had numerous requests for assistance with CVI because my clients find the new SAP CRM WebClient UI appealing. They push for SAP CRM to be the main data entry point and see no reason to enter data into SAP ECC via the SAPGUI. That leaves the dilemma of ensuring that the master data is instantaneously replicated to business partners, customers, and vendors in SAP ECC.
I will attempt to tackle the “too hard” concern by focusing on the basics of getting the middleware and CVI up and running. A standard CVI implementation should suffice for most business needs. This ensures that the business partner, customer, and vendor data contains the same numbers and details in both SAP CRM and SAP ECC.
Prerequisite Middleware for CVI
To get a complete picture of the end-to-end configuration from SAP CRM to SAP ECC, the best place to start is with SAP CRM middleware. Only a small part of the configuration happens in CVI — you spend the majority of the time configuring the middleware. Figure 2 shows why middleware is so important. The end-to-end process is around 70% middleware and 30% CVI. Also, the middleware exists in both SAP CRM and SAP ECC whereas CVI is only in SAP ECC.

Figure 2
The shaded area depicts the complete process flow highlighting the importance and reach of the middleware portion
I've divided the middleware configuration into two sections. The first section highlights the initial middleware settings that you need to configure. The second section discusses getting the business partner through to SAP ECC.
Basic Middleware Settings
Before starting these steps, ensure that the Basis middleware configuration is complete, such as the connection between SAP CRM and SAP ECC (transaction SM59). This part of the process is outside the scope of this article, but you can read more about it at https://service.sap.com. In the SAP Support Portal follow menu path Release and Upgrade Info>Installation and Upgrade guides>SAP Business Suite Applications>SAP CRM>SAP CRM (version no.)>SAP CRM Product>Master Guide SAP CRM.
After the entire Basis middleware configuration is complete, the first configuration step is the middleware administration console (transaction SMOEAC). This transaction contains the settings for the distribution of business objects from SAP CRM to SAP ECC. The business objects to concentrate on for this article's purpose are replication object (Repl. Obj.) BUPA_MAIN, All Business Partners (MESG), and All Business Partner Relationships (MESG) BUPA_REL, as shown in Figure 3.

Figure 3
The administration console is the cockpit for configuring which sites are to receive which pieces of information via the middleware
In my example, the site labeled R/3 has 10 subscriptions assigned. Each subscription contains the sites where the system sends the data as well as the replication object. The replication object contained in the subscription All Business Partners (MESG) is BUPA_MAIN.
Note
There must be no active subscriptions for the object VEND_MAIN. The process to create vendors using CVI does not require this business object. If VEND_MAIN exists, then the middleware creates the vendor as opposed to allowing the CVI functionality to create the vendor. Therefore, the features and benefits of using CVI, such as numbering and changes, are not integrated for vendors.
Pass the Business Partner to SAP ECC
The configuration in this section is simply the maintenance of tables used during the middleware process. It allows you to set the system up and get the functionality working, but if you want to understand how these tables are used, refer to the sidebar “What Happens When You Save the Business Partner in SAP CRM?”
Step 1. Maintain table SAP CRMC_BUT_CALL_FU. In SAP CRM use transaction SM30. Ensure that all the function modules listed in Table 1 are in the table. If they are not in the table then you need to add them. The exact numbering is not important, but the function modules must be kept in the sequence displayed below. Then activate the modules by setting the Call indicator as shown in Figure 4.
Event Object Item Function module
SAP CRMOU |
BUPA |
1000000 |
BUPA_OUTBOUND_BPS_FILL_CENTRAL |
|
|
1200000 |
SAP CRM_BUPA_OUTB_BPS_FILL_MD |
|
|
1300000 |
SAP CRM_BUPA_BDOC_BPS_FILL_DATA |
|
|
2000000 |
ABA_FSBP_OUTBOUND_BPS_FILL |
|
BUPR |
1000000 |
BUPA_OUTBOUND_BPR_FILL_CENTRAL |
|
|
1200000 |
SAP CRM_BUPA_OUTB_BPR_FILL_MD |
|
|
1300000 |
SAP CRM_BUPA_BDOC_BPR_FILL_DATA |
BPOUT |
BUPA |
200000 |
BUPA_MWX_BDOC_CREATE_MAIN |
|
BUPR |
100000 |
BUPA_MWX_BDOC_CREATE_REL |
CLEAR |
BUPA |
1000000 |
BUPA_OUTBOUND_CLEAR_FLAGS |
|
|
2000000 |
ABA_FSBP_OUTBOUND_CLEAR_FLAGS |
|
Table 1 |
Make sure these function modules appear in the SAP CRMC_BUT_CALL_FU table
|

Figure 4
Select the Call indicator to activate the function module
Next, deactivate the modules in Table 2 by de-selecting the Call indicator. Do not delete the lines. Just deactivate the call.
SAP CRMOU |
BUPA |
SAP CRM_BUPA_BDOC_BPS_FILL_VENDOR
|
|
|
ABA_FSBP_EMP_TO_ROLE_OUTBOUND
|
BPOUT |
BUPA |
VEND_MWX_CREATE_MAIN_BDOC |
|
|
BUPA_OUTBOUND_MAIN
|
|
|
BUPA_OUTBOUND_ALE_MAIN
|
BUPR |
|
UDM_OUTBOUND_ALE_REL |
|
|
BUPA_OUTBOUND_REL
|
|
|
BUPA_OUTBOUND_ALE_REL
|
BPOUT |
BUPA |
BUPX MDS_BUPA_OUTBOUND
|
R3AOU |
BUPA |
BUPA_MWX_BDOC_UP_CURRSTATE_SET
|
|
Table 2 |
Deactivate these function modules in table SAP CRMC_BUT_CALL_FU |
Step 2. Maintain table SAP CRMSUBTAB in SAP ECC. Execute transaction SM30, click on Maintain, and then set the filters as shown in Figure 5. Once that is done, the four lines in Table 3 are displayed. Ensure that the first three function modules in Table 3 are active and that VEND_MAIN is inactive.

Figure 5
Filter the SAP CRMSUBTAB table to find the required entries
BUPA_MAIN |
COM_BUPA_MAIN_INBOUND |
Not set |
BUAG_MAIN |
COM_BUAG_MAIN_INBOUND |
Not set |
BUPA_REL |
COM_BUPA_REL_INBOUND |
Not set |
VEND_MAIN |
COM_VEND_MAIN_INBOUND |
Set |
|
Table 3 |
Adjust the activation for these four function modules in table SAP CRMSUBTAB |
Next, change the function name COM_BUPA_MAIN_INBOUND to FSL_BUPA_MAIN_INBOUND. FSL at the beginning of the function module stands for “Full Service Leasing.” Whether you are using FSL or just want to maintain vendors in SAP ECC, change the function modules so that when you change the vendor record in SAP CRM you do not get a message back from SAP ECC stating that the business partner already exists. Leave the deactivation flag blank so that the system executes the function module.
Step 3. Receive the business partner in SAP ECC. The first function called in SAP ECC is SAP CRM_GENERIC_R3_IN. This performs the same task as in step 2 in which all the function modules in the SAP CRMSUBTAB table are retrieved in SAP CRM. If you want to debug into SAP ECC from SAP CRM, this is the function module in which you should place your breakpoint.
For example, to retrieve the FSL_BUPA_MAIN_INBOUND function, enter the parameters for the SAP CRMSUBTAB table as shown in Figure 6.

Figure 6
The SAP CRMSUBTAB table contains the function module used to create the business partner in SAP ECC
Note
Prior to implementing CVI, the process of creating business partners started with the function module SAP CRM_GENERIC_R3_IN reading the table SAP CRMSUBTAB to retrieve the next function module required to be executed. The standard function module found in the SAP CRMSUBTAB table is COM_BUPA_MAIN_INBOUND. This function module is no longer used because the required CVI code is included in FSL_BUPA_MAIN_INBOUND, which was swapped during configuration.
In the FSL_BUPA_MAIN_INBOUND function, one of the importing parameters is the BAPIMTS structure. This structure is where the business partner data resides waiting to be unpacked and saved in SAP ECC. This function calls the function module COM_BUPA_MWX_MAIN_INBOUND to retrieve the required function modules that unpack the data in the BAPIMTS structure. I configured the retrieved functions earlier in the COM_BUPA_CALL_FU table.
Note
If you do not have the FSL function module, then implement the ERP Value Pack SAP ECC Add On. Refer to SAP Note 1066666 “FSL: Partner distribution in the leasing scenario”.
The system reads the COM_BUPA_CALL_FU table with these parameters to retrieve the unpacking function modules:
ZTPKT : R3OBI
OBJAP : BUPA
The function modules retrieved from the table include FSL_BUPA_MAIN_BP_INBOUND. This is where CVI starts. CVI performs the creation of the customers and vendors. The next function to execute is COM_BUPA_MAIN_INBOUND, which calls CRS_SEND_TO_SERVER to send back an acknowledgement to SAP CRM.
What Happens When You Save the Business Partner in SAP CRM?
This section gives you more details than just the configuration. It explains why you have just made the changes in the configuration.
I have always found that I get the best idea of how something in an SAP system works by debugging the code. I don't think I am alone in this theory and have therefore decided to explain the middleware process by demonstrating what happens when you change a business partner and debug the code. You can download a chart that shows the main steps during the debug process at the bottom of this article. The main functions called in the flow are listed in Table 1.
Partner_Update |
BAdI |
BUPA_OUTBOUND_CREATE |
|
BUPA_OUTBOUND_SEND |
Loops through all the activate functions in table SAP CRMC_BUT_CALL_FU selecting on SAP CRMOU / BUPA |
BUPA_OUTBOUND_TRANSMIT_BP |
Loops through all the activate functions in table SAP CRMC_BUT_CALL_FU selecting on BPOUT / BUPA |
Calls:
Method: PROCESS_OUTBOUND
|
Called by function BUPA_MWX_BDOC_CREATE
and
BUPA_MWX_BDOC_CREATE_MAIN.
Export: Header, BDoc_type = “BUPA_MAIN”
|
BUPA_OUTBOUND_CLEAR |
|
AFTER_OUTBOUND |
BAdI |
SAP CRM_BUAG_MWX_BDOC_CREATE |
Creates the BDoc for the business agreement |
|
Table 1 |
The main functions of the process |
The BUPA_OUTBOUND_SEND function reads the SAP CRMC_BUT_CALL_FU table. The system reads the table using two parameters in the program:
- ZTPKT – Event (e.g., SAP CRMIN, BPOUT)
- OBJAP – Object (e.g., BUPA, BUPR)
The first time the system reads the table, it sends the parameters SAP CRMOU and BUPA. The second time the parameters are BPOUT and BUPA from the BUPA_OUTBOUND_TRANSMIT_BP function module.
The table returns the function modules that the system executes in the exchange process to build the data sent to SAP ECC in the BDoc (Figure 1). You can create custom function modules and add them to the end of the list if you have some extra business requirements. A simple example is when you have some business partner roles that you do not want to send to SAP ECC, such as Internet User. You can add a function module to check for the specific roles not required and remove the entry prior to sending the BDoc to SAP ECC.

Figure 1
The function modules you use to build the BDoc to send to SAP ECC
After you create the BDoc, send it to SAP ECC. The important part is the code that determines where to send the BDOC. The piece of code that does this is BUPA_MWX_BDOC_CREATE_MAIN, which calls the process outbound method. This in turn calls CL_SMW_MFLOW => PROCESS_OUTBOUND. This method triggers the outbound flow context for the messaging BDocs.
At this point, the system checks which sites to send the message to, based on the information in the SMOEAC transaction. The function SMW3_OUTBOUNDADP_CALLADAPTERS performs the sending. It includes the determination of the type of site followed by the last function BUPA_MWX_BDOC_UPLOAD_MAIN_R3A , which maps the message structure (BDoc structure) into the flat BAPI structure BAPIMTCS. You configure BUPA_MWX_BDOC_UPLOAD_MAIN_R3A as part of the business object setup in transaction R3AC1 for BUPA_MAIN.
These steps create the BDoc and send it out of SAP CRM. You can view the BDoc by using transaction SMW01 and clicking on the appropriate icons in the tool bar.
CVI Configuration
Next I'll show you the seven CVI configuration steps. If you want to know more about the logic behind these steps, refer to the sidebar “What Happens When You Save the Business Partner in SAP ECC?”
Step 1. Set up the COM_BUPA_CALL_FU table in SAP ECC. Use transaction SM30 and ensure that all the function modules listed in Table 4 are in the table. If they are not in the table, you need to add them. The exact numbering is not important, but the function modules must be kept in the sequence displayed below. Activate the modules by setting the Call indicator.
R3OBI |
BUPA |
1000100 |
FSL_BUPA_MAIN_BP_INBOUND |
|
BUPR |
1000000 |
COM_BUPA_REL_BP_INBOUND |
R3IN |
BUPA |
800 |
FSL_BUPA_INBOUND_FILTER_IDENT |
|
|
900 |
FSL_BUPA_INBOUND_MWX_ADD_ROLES |
|
|
1000 |
FSC_BUPA_MWX_FILTER_MAIN |
|
|
10000 |
COM_BUPA_MWX_FILTER_MAIN |
|
BUPR |
1000 |
COM_BUPA_MWX_FILTER_REL
|
|
|
10000 |
COM_BUPA_MWX_MAP_REL_CENTRAL |
|
Table 4 |
Function module settings for business partner distribution in SAP ECC
|
Then add the function module highlighted in Figure 7 to ensure that the same partner numbers are used for the general business partners in SAP CRM and SAP ECC. Activate the function module by clicking on the Call field in the table.

Figure 7
Contents of the COM_BUPA_CALL_FU table
Next, deactivate the following function modules in Table 5 by de-selecting the Call indicator.
R3IN |
BUPA |
1000000
|
COM_BUPA_MWX_MAP_MAIN_CENTRAL
|
|
|
2000000
|
FSL_BUPA_MWX_MAP_MAIN_CENTRAL
|
R3OBI |
BUPA |
1000000 |
COM_BUPA_MAIN_BP_INBOUND |
|
|
1000000
|
PI_BP_PROXY_BAPI_CUSTOMER
|
|
BUPR |
1000000
|
PI_BP_PROXY_BAPI_CUSTOMER
|
|
VEND |
1000000 |
PI_BP_PROXY_BAPI_VENDOR |
|
Table 5 |
Deactivate the function modules |
If an entry exists for event R3IN, object BUPA, module FSL_BUPA_MWX_MAP_MAIN_CENTRAL, then delete it. The module is obsolete and must not be activated.
Step 2. In SAP ECC, set up the V_BUT_CALL_FU table in transaction SM30. Ensure that all the function modules listed in Table 6 are in the table in the sequence listed. If they are not in the table then you need to add and activate them. Deactivate the listing for event SAP CRMIN, object BUPR, module FS_BPREL_DIST_CRITERIA_ROLE.
SAP CRMIN |
BUPA |
1000000
|
BUPA_INBOUND_MAIN_CENTRAL
|
|
|
2000000
|
ABA_FSBP_INBOUND_MAIN
|
|
BUPR |
1000000 |
BUPA_INBOUND_REL_CENTRAL |
SAP CRMOU |
BUPA |
1000000
|
BUPA_OUTBOUND_BPS_FILL_CENTRAL
|
|
BUPR |
1000000
|
BUPA_OUTBOUND_BPR_FILL_CENTRAL
|
BPOUT |
BUPX |
1000000 |
MDS_BUPA_OUTBOUND |
|
Table 6 |
Contents of the V_BUT_CALL_FU table in SAP ECC |
Step 3. Set up the CVI tables. Here are the basics to get the data from the business partner into the KNA1 and LFA1 tables. In SAP ECC, using transaction SM30, ensure that the entries in Table 7 appear in the MDSV_CTRL_OBJ table. Then set up the entries in Table 8 in the MDSV_CTRL_ OPT table. Finally, make sure that the entries in Figure 8 exist in the MDSV_CTRL_OPT_A table.
BP |
1 |
CVI_BP_EXTRACTOR
|
'X' |
50 |
CUSTOMER |
1 |
CMD_EI_API_EXTRACTR
|
' ' |
50 |
VENDOR |
1 |
VMD_EI_API_EXTRACT |
' ' |
50 |
|
Table 7 |
Required contents of MDSV_CTRL_OBJ table |
BP |
CUSTOMER |
CVI_STRATEGY_BP_CUSTOMER
|
MDS_BUPA_CUST |
BP |
VENDOR |
CVI_STRATEGY_BP_VENDOR
|
MDS_BUPA_VEND |
CUSTOMER |
BP |
CVI_STRATEGY_CUSTOMER_BP |
MDS_CUST_BUPA |
VENDOR |
BP |
CVI_STRATEGY_VENDOR_BP |
MDS_VEND_BUPA |
|
Table 8 |
Required contents of MDSV_CTRL_OPT table |

Figure 8
Required contents of MDSV_CTRL_OPT_A table
Note
When you use CVI, the entries that you otherwise make for the middleware distribution of the customers in transactions PIDE and PIDV are not relevant.
Step 4. Assign the business partner group to the customer account group in table V_TBD001. View V_TBD001 creates a relationship between the customer account group and the general business partner grouping characteristic. The Same Num… (same numbers) indicator ensures that the general business partner numbers in SAP ECC and the customer and vendor numbers from SAP CRM are the same. This indicator is only set for the KUNA account group list in Figure 9.

Figure 9
Setting the same number indicator in view V_TBD001
Step 5. Set up the role categories for business partners. In view V_TBD002 (setup of business partner roles for customers) make sure you have two role categories listed. In my example in Figure 10 I list FLCU00 (business partner FI customers) and FLCU01 (business partner customers).

Figure 10
Role categories in view V_TBD002
Step 6. Set up the relationship between the vendor account group and the general business partner grouping. In table V_TBC001 (assignment of business partner grouping to vendor account group) make sure that the Same Num… indicator is selected for account group 0002 (LIEF).
Step 7. Set up business partner roles for vendors. In table V_TBC002 make sure you have two role categories listed. In my example, I have FLVN00 (business partner FI vendor) and FLVN01 (business partner vendors).
Figures 11, 12, and 13 show the final result. Notice the roles in SAP CRM and how they are mapped to the business partners in SAP ECC as per the configuration. Also note that the business partner numbers and the customer number are the same in both systems.

Figure 11
Final result in SAP CRM

Figure 12
Final result in SAP ECC

Figure 13
The customer has a single business partner number in SAP CRM and SAP ECC
What Happens When You Save the Business Partner in SAP ECC?
After you have created the business partner, it is time to create the customer and vendor records based on the roles of the business partner. You can download a chart from the Downloads section at the bottom of this article that displays the program flow. It starts from the point where the data has been received into SAP ECC.
The CVI processing really starts in function module FSL_BUPA_MAIN_INBOUND. Remember this is the one that took the place of the standard function so that the system calls CVI. Without this change, you cannot use CVI.
The next bit of code is CVI_SAP CRM_MAPPING, which checks for updates or inserts. It then calls the subsequent function module that moves the fields from the BAPIMTS table to the customer tables. The system checks the CVI partner and vendor mapping tables to see if it is an insert or an update. The table names are CVI_VEND_LINK and CVI_CUST_LINK.
The function module COM_BUPA_BAPIMTCS_TO_MAIN copies the data into the format that CVI requires — such as moving the BAPIMTCS data to BP_CONTROL, BP_CENTRALDATA, and BP_PERSON. The FSL_BUPA_MAIN_BP_INBOUND function checks if the business partner is also a vendor.
After the data has been formatted, the next function module the system calls is DO_START_INBOUND_MAIN. This program contains the logic for processing the business partner, relationship, customer and vendor data that was sent through from SAP CRM. In other words this is where it all happens. The function calls include:
- Process partner data: PROCESS_PARTNER_DATA
- Process relationship data: PROCESS_RELATION_DATA
- Process customer data: PROCESS_CUSTOMER_DATA
- Process vendor data: PROCESS_VENDOR_DATA
After the system has processed these functions modules, it checks the messages in case there were any errors during the processing of the data. If there were errors, then the system saves them and uses them in the post processing office for viewing. Also, if errors exist, the data is not committed.
Finally the function module FSL_BUPA_MAIN_INBOUND calls CRS_SEND_TO_SERVER to send back an acknowledgement to SAP CRM.
The steps I provided should be enough to assist in the implementation of middleware and CVI. However, here are a few items you should note:
- If you have existing customers or vendors that you need to convert to business partners, then use SAP ECC transactions FLBPD1 (for customers) and FLBPC1 (for vendors)
- If the business partners and customers are both created, but not linked, then you can link them using SAP ECC transactions FLBPD2 (for customers) and FLBPC2 (for vendors). This applies when there are exceptions to the data entry rule for the business. All data should go via the SAP CRM WebClient UI through middleware and CVI. In situations in which you changed existing systems to use CVI you can use these transactions, but the numbering does not change. If the numbers for the customer and business partner were initially different then they stay different.
- The synchronization cockpit (transaction MDS_LOAD_COCKPIT) is great for the initial load of data
- There are many CVI Business Add-Ins (BAdIs) that you can use to enhance the data mapping, if required. You can find them by following SAP ECC configuration path IMG>Cross Application components>Master Data Synchronization>Customer/Vendor Integration>Business Add-Ins (BAdIs).
Mitchell Faiman
Mitchell Faiman is a senior consultant for SAP in Australia. He has more than 14 years of experience with SAP, gaining extensive knowledge in SD and SAP CRM. Mitchell has worked in Singapore, India , and Australia on projects in many industries such as consumer products, retail, manufacturing, banking, mining, and now leasing. His years of project experience has also found him taking on various project roles spanning from project manager and team lead to SAP SD/SAP CRM architect and configurer. His last few projects have been SAP CRM focused, concentrating on the integration of Internet Sales, Groupware, 1-to-1 email, middleware, and CVI.
You may contact the author at mitchell.faiman@sap.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.