In Mind Cloud Digital Sales Platform (DSP) supports Account Data Sync from ERP, which includes basic account data (Customer ID, VATID), its addresses, and sales area information.
To control the number of accounts available for synchronization from ERP to DSP, a Database view needs to be created in the ERP system. Using this view, one can filter on account ERP Data (more on this later in the document) and thus reduce the number of customers (accounts) synced to DSP.
Important: DSP uses a URI to uniquely identify each customer/account object. The URI includes the hostname of the ERP system (source system) plus the customer/object ID to make it unique per customer/object. The hostname is found from the destination ECC_RFC_DESTINATION and follows the pattern of hostname and client.
For example, an account URI would look like: http://imc.prod/800/Account#0000123456
where
- prod is the ERP hostname and comes from jco.client.ashost or jco.client.mshost
- 800 is the client and comes from client.client
- The account is the name of the type of the object in DSP
- 123456 is the customer ID.
Note: In DSP, "Account" and "Customer" are used interchangeably.
Data Selection/ Filtration in ERP
DSP uses database views in ERP to check which objects should be synced to DSP. This is also applicable to Account sync. We recommend maintaining all the views below at one time.
Database views in ERP can be created using transaction SE11
Tip: Database filters might return duplicated records since ERP does not support DISTINCT concept when creating views. This is currently handled on the DSP side where duplicates are eliminated.
Account Sync Procedure
For this sync to work first create database view “Z_ISS_CUSTOMER” with columns
- “MANDT”, “KUNNR”, “VKORG”, “VTWEG”,” SPART”.
In case the account sales area information is needed to be synced from the view.
Or
- “MANDT”, “KUNNR”
In case the account sales area information is not needed from the view.
This view is based on standard ERP tables “KNA1” and “KNVV”. Using this view one can also do the pre-filtering of accounts/customers in ERP which are to be synced to DSP.
Depending on the filter conditions the view might need to perform a join on different tables and a set of selection conditions.
Those filters need to be applied depending on the business case of the customer. In Mind recommends to carefully put in selection the customer that should be made available in DSP system as this impacts the performance of data sync. Larger the set of data more time it will take to complete the sync and more database usage on the DSP side.
Important: Enable setting SettingERPAccountSyncWithSalesAreaFromView, to sync sales area information from the ERP database view. Alternatively, DSP will use BAPI to read this information more in Product Data Sync.
With SELECTED Sales Area Information (Setting is ON)
If setting SettingERPAccountSyncWithSalesAreaFromView is ON, DSP will also try to sync the sales area information from ERP. The following fields need to be mandatory created in the database view: KUNNR, VKORG, VTWEG, SPART. Any additional fields are in general ignored. The database view preparation is already covered in the Product Hierarchy in ERP section of the Product Category Data Sync article.
With ALL Sales Area Info (Setting is OFF)
In case only account information is required or if the setting SettingERPAccountSyncWithSalesAreaFromView is OFF. The only mandatory field in the database view is KUNNR. The additional fields are in general ignored.
However, this does not mean that DSP will not synchronize the sales area for the customer. Users have the option to maintain the sales area in database view or DSP will sync ALL sales areas of the customer using alternate BAPI: BAPI_CUSTOMER_GETSALESAREAS.
Manual and Explicit Customer Synchronization
To explicitly synchronize a customer one can go to System processes→ ERP synchronization → Sync Specific object.
Select Account and provide the full customer/account ID. This is shown below:
Background Account Synchronization
One can also run background sync by going to System processes→ ERP synchronization clicking sync button and selecting the below option.
Background Account Synchronization System Task
One can also set up a system task to run the account sync in the background. This can be done from Administration→ System Task → create a new task with a cron expression string and using the task resource AccountSyncJob
Note that there is no delta sync in ERP Account/Customer synchronization. The reason being there is no correct way to know the last changed date on an account. In this case, setting up an account sync job may consume some system resources depending on the number of ERP customers to sync.
Prerequisites (Basic Data Points)
- Currency
- Language
- Country
- Country Region
- Sales Org
- Distribution Channel
- Division
- Sales Office
- Inco Terms
- Payment Terms
- Partner Function
Note: These data points with ERP IDs need to maintain in advance before account sync.
Partner Function Sync
Together with the account, DSP also provides functionality to synchronize partner functions defined for Account from ERP
DSP read directly from the ERP table “KNVP” to get all the partner functions of the account. However, DSP will create partner functions for the sales info/area (sales org, distribution channel, and division) that maintained in the system.
Only two sales areas maintained in DSP as per the below screenshot.
Below is the content of the KNVP table for account “1000” in the ERP system. Since only two sales areas are maintained in the system, partner functions that are maintained in these two sales areas will be synced into the DSP system as per highlighted within the orange box.
For example, the below screenshot is the partner function master data maintained in the system. In this case, you will notice that “RE” is not maintained as a partner function ERP ID. Only some partner functions are maintained in DSP. This provides the customization functionality of only certain partner functions that can be synchronized into DSP.
Usage of Partner Function
There is standard functionality provided to copy account partner functions of the same sales area as quote partner function during quote creation as well as quote copy. This can be done by enabling setting “SettingAddAccountKeyPartnersToQuote”. If more than one partner function records found for the same sales area, some logic is applied in choosing a key partner. The partner function set as “Default” is the highest priority, followed by the increasing order of position. If no “Default” is found, the partner function with the least position number will be picked up as a partner.
If the user does not want to use the standard implementation, he or she may define his/her own logic of choosing a default partner in the post quote creation groovy script.
In case, the user wants to use standard implementation together with a custom implementation, the sequencing should be as below:
- Standard implementation: adding all partner functions from Account to Quote of the same sales area.
- Post Quote creation script: additional defaulting.
But in this case, the user/consultant should be responsible to make sure of non-duplicate partner function records.
The partner function sync is only supported for partner function with partner function type “Account” and “User” and not supported for others such as “Contact”.
Account Synch switch from BAPI to API - Mapping
With the JCo library that we use, the BAPI_CUSTOMER_GETDETAIL2, BAPI_CUSTOMER_GETSALESAREAS, and ISA_CUSTOMER_SALES_READ returns an output structure in the following format:
- One or more “structures”, such as “CUSTOMERADDRESS” in the example below. The system may or may not use a particular structure.
- Each structure consists of one or more values, such as “NAME” or “NAME_2” in the example below.
The mappings for these BAPIs are as follows:
IMC Object Type |
IMC Field |
BAPI |
Structure |
Value |
Remarks |
Account |
objectName |
BAPI_CUSTOMER_GETDETAIL2 |
CUSTOMERADDRESS |
NAME + “ “ + NAME_2 + “ “ + NAME_3 + “ “ + NAME_4 |
The result is trimmed to remove trailing whitespace |
Account |
objectERPId |
BAPI_CUSTOMER_GETDETAIL2 |
CUSTOMERADDRESS |
CUSTOMER |
|
Account |
vatId |
BAPI_CUSTOMER_GETDETAIL2 |
CUSTOMERGENERALDETAIL |
VAT_REG_NO |
|
Account |
hasAccountStatus |
|
|
http://www.inmindcloud.com/application/schema.owl#ACTIVE |
Hardcoded value |
Account |
accountGroup |
BAPI_CUSTOMER_GETDETAIL2 |
CUSTOMERGENERALDETAIL |
ACCNT_GRP |
|
Account |
hasLanguage |
BAPI_CUSTOMER_GETDETAIL2 |
CUSTOMERADDRESS |
LANGU_ISO |
Value must be mapped to an existing Language’s ERP Id, or else it will be blank |
Account |
hasCurrency |
BAPI_CUSTOMER_GETDETAIL2 |
CUSTOMERGENERALDETAIL |
CURRENCY_ISO |
Value must be mapped to an existing Currency’s ERP Id, or else it will be blank |
|
|
|
|
|
|
Address |
addressStreet |
BAPI_CUSTOMER_GETDETAIL2 |
CUSTOMERADDRESS |
STREET |
|
Address |
addressZip |
BAPI_CUSTOMER_GETDETAIL2 |
CUSTOMERADDRESS |
POSTL_CODE |
|
Address |
addressCity |
BAPI_CUSTOMER_GETDETAIL2 |
CUSTOMERADDRESS |
CITY |
|
Address |
addressPhone |
BAPI_CUSTOMER_GETDETAIL2 |
CUSTOMERADDRESS |
TELEPHONE |
|
Address |
hasCountryRegion |
BAPI_CUSTOMER_GETDETAIL2 |
CUSTOMERADDRESS |
REGION |
Value must be mapped to an existing CountryRegion’s ERP Id, or else it will be blank |
Address |
hasCountry |
BAPI_CUSTOMER_GETDETAIL2 |
CUSTOMERADDRESS |
COUNTRYISO |
Value must be mapped to an existing Country’s ERP Id, or else it will be blank |
Address |
addressMain |
|
|
true |
Hardcoded value |
|
|
|
|
|
|
SalesInfo |
hasSalesOrg |
BAPI_CUSTOMER_GETSALESAREAS |
SALESAREAS |
SALESORG |
Value must be mapped to an existing SalesOrg’s ERP Id, or else the sales info will not be imported |
SalesInfo |
hasDistributionChannel |
BAPI_CUSTOMER_GETSALESAREAS |
SALESAREAS |
DISTRCHN |
Value must be mapped to an existing DistributionChannel’s ERP Id, or else the sales info will not be imported |
SalesInfo |
hasDivision |
BAPI_CUSTOMER_GETSALESAREAS |
SALESAREAS |
DIVISION |
Value must be mapped to an existing Division’s ERP Id, or else the sales info will not be imported |
SalesInfo |
hasPaymentTerms |
ISA_CUSTOMER_SALES_READ |
CUST_SALES_DATA |
ZTERM |
Value must be mapped to an existing PaymentTerms’ ERP Id, or else it will be blank |
SalesInfo |
hasIncoTerms |
ISA_CUSTOMER_SALES_READ |
CUST_SALES_DATA |
INCO1 |
Value must be mapped to an existing IncoTerms’ ERP Id, or else it will be blank |
SalesInfo |
quoteIncoTermsLocation |
ISA_CUSTOMER_SALES_READ |
CUST_SALES_DATA |
INCO2 |
|
SalesInfo |
accountPricingProcedureIndicator |
ISA_CUSTOMER_SALES_READ |
CUST_SALES_DATA |
KALKS |
|
SalesInfo |
hasShippingCondition |
ISA_CUSTOMER_SALES_READ |
CUST_SALES_DATA |
VSBED |
Value must be mapped to an existing ShippingCondition’s ERP Id, or else it will be blank |
SalesInfo |
hasPriceList |
ISA_CUSTOMER_SALES_READ |
CUST_SALES_DATA |
PLTYP |
Value must be mapped to an existing PriceList’s ERP Id, or else it will be blank |
SalesInfo |
hasPriceGroup |
ISA_CUSTOMER_SALES_READ |
CUST_SALES_DATA |
KONDA |
Value must be mapped to an existing PriceGroup’s ERP Id, or else it will be blank |
SalesInfo |
hasSalesOffice |
ISA_CUSTOMER_SALES_READ |
CUST_SALES_DATA |
VKBUR |
Value must be mapped to an existing SalesOffice’s ERP Id, or else it will be blank |
SalesInfo |
hasSalesGroup |
ISA_CUSTOMER_SALES_READ |
CUST_SALES_DATA |
VKGRP |
Value must be mapped to an existing SalesGroup’s ERP Id, or else it will be blank |
SalesInfo |
hasCurrency |
ISA_CUSTOMER_SALES_READ |
CUST_SALES_DATA |
WAERS |
The first 3 characters of Value must be mapped to an existing Currency’s ERP Id, or else it will be blank |
For Partner Function, it is not read from a BAPI, and is instead read directly from the table KNVP, filtered by KUNNR = accountERPID and clientColumn of MANDT. The resulting fields from the table are mapped as follows:
IMC Object Type |
IMC Field |
Column |
Remarks |
PartnerFunctionRecord |
linksPartner |
KUNN2 or PERNR |
Depending on the partner function below, this can be mapped to the ERP Id of either an Account (KUNN2) or an Employee (PERNR) |
PartnerFunctionRecord |
hasPartnerFunction |
PARVW |
Value must be mapped to an existing PartnerFunction’s ERP Id, or else the partner function record will not be imported |
PartnerFunctionRecord |
salesInfoPartnerFunctionRecordDefinedBy |
VKORG, VTWEG, SPART |
These values must be mapped to an existing SalesInfo of the Account. VKORG is the SalesOrg, VTWEG is the DistributionChannel, and SPART is the Division |
PartnerFunctionRecord |
partnerFunctionRecordDefault |
DEFPA |
True if value = “X” |
PartnerFunctionRecord |
sequenceID |
PARZA |
|