Synchronize account data
  • 24 Sep 2024
  • 8 Minutes to read
  • Dark
    Light

Synchronize account data

  • Dark
    Light

Article summary

Zilliant CPQ supports account data synchronization from ERP, including:

  • Basic account data, such as customer ID and VATID
  • Corresponding addresses
  • Sales area information

To control the number of accounts available for synchronization from ERP to CPQ, you must create a database view in the ERP system. Using this view, you can filter on account ERP data. This reduces the number of customer accounts synced to CPQ.

CPQ uses a URI to uniquely identify each customer/account object. The URI includes the hostname of the ERP system, which is the source system. It also includes the customer/object ID to make it unique for each customer/object.

The host name is found from the destination ECC_RFC_DESTINATION and follows the pattern of host name and client.

Following is an example of an account URI:

http://imc.prod/800/Account#0000123456

Parts of the URI are defined as follows:

prod—ERP hostname. This comes from jco.client.ashost or jco.client.mshost.
800—Client. This comes from client.client.
Account—Name of the type of object in CPQ.
123456—Customer ID.

Note

In CPQ, Account and Customer are used interchangeably.

Select and filter data in ERP

CPQ uses database views in ERP to determine which objects should be synced to CPQ. This also applies to account synchronization. Zilliant recommends maintaining all of the views discussed in the following sections at one time.

Create database views by using transaction SE11.

Note

Because the ERP system does not support the concept of DISTINCT when creating views, database filters may return duplicated records. CPQ handles this by eliminating duplicates.

Sync an account

For synchronization to work, first create a database view named Z_ISS_CUSTOMER. If the account sales area needs to be synced from the view, use the following columns:

* MANDT
* KUNNR
* VKORG
* VTWEG
* SPART

If the account sales area information is not needed from the view, use the following columns:

*   MANDT
*   KUNNR

The view in the following images is based on standard ERP tables KNA1 and KNVV. Using this view, you can also pre-filter the accounts/customers in ERP that are to be synced to CPQ.

SAP ERP Display View 1

SAP ERP Display View 2

Depending on the filter conditions, the view may need to perform a join on different tables and a selected set of conditions. Filters should be applied depending on each customer's business case.

Zilliant recommends that you carefully determine the selections that should be available to the customer in CPQ as this impacts the performance of data synchronization. The larger the data set, the more time takes to complete the sync, resulting in increased database usage in CPQ.

Important

Enable the SettingERPAccountSyncWithSalesAreaFromView setting to synchronize sales area information from the ERP database view. If it is not enabled, CPQ will use BAPI to read this information more in product data sync.

The following sections describe what happens when the SettingERPAccountSyncWithSalesAreaFromView setting is on or off.

Selected Sales Area Information Setting: On

If SettingERPAccountSyncWithSalesAreaFromView is on, CPQ attempts to synchronize the sales area information from ERP. The following fields must be set to mandatory in the database view:

* KUNNR
* VKORG
* VTWEG
* SPART

SAP ERP database view mandatory fields

Any additional fields are ignored.

All Sales Area Information Setting: Off

If the implementation requires only account information, or if the SettingERPAccountSyncWithSalesAreaFromView setting is off, the only mandatory field in the database view is KUNNR.

However, CPQ still synchronizes the sales area for the customer. You have the option to maintain the sales area in the database view; otherwise, CPQ syncs all customer sales areas using alternate BAPI BAPI_CUSTOMER_GETSALESAREAS.

The following images provide examples:

View for account sync 1

View for account sync 2

Synchronize a customer

To explicitly synchronize a customer:

  1. Sign in to CPQ.
  2. In the left navigation area, select System Processes.
  3. From the top navigation bar, select ERP Synchronization.
  4. Select the Sync icon at the top right.
  5. In the Sync Specific pop-up, select Account and provide the full customer/account in the ERP ID field.

Run a background sync

Follow these steps to run sync in the background:

  1. Sign in to CPQ.
  2. In the left navigation area, select System Processes.
  3. From the top navigation bar, select ERP Synchronization.
  4. Select the Sync icon at the top right.
  5. Set Accounts switch to NO.
  6. Set the Run in background switch to NO.

image

You can also set up a system task to run the account sync in the background:

  1. In the CPQ left navigation area, select Administration.
  2. Select System Task.
  3. Create a task with a cron expression string. Use the task resource AccountSyncJob.
Note

There is delta sync in ERP account/customer synchronization because 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 prerequisites for account sync are:

  • 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 must be maintained in advance of account sync.

Sync partner function

In addition to account sync, CPQ enables you to synchronize partner functions defined for an account from ERP.

CPQ reads directly from the ERP table KNVP to get all the partner functions for the account. However, CPQ creates partner functions for the sales info/area (sales org, distribution channel, and division) that are maintained in the system.

Only two sales areas are maintained in CPQ, as shown in the following image:

image

The following image shows the contents of the KNVP table for account 1000 in the ERP system. Because only two sales areas are maintained in the system, partner functions that are maintained in these two sales areas are synced to CPQ, as highlighted in the following image:

SAP ERP account sync KNVP table

Only some partner functions are maintained in CPQ, providing customization functionality for only certain partner functions that can be synchronized into CPQ.

For example, the following image shows the partner function master data maintained in the system. In this case, notice that “RE” is not maintained as a partner function ERP ID.

image

SAP ERP Acct Partner Function 2

Manage partner function

During quote creation and quote copy, CPQ provides standard functionality to copy account partner functions of the same sales area as the quote partner functions. Achieve this by enabling *SettingAddAccountKeyPartnersToQuote.

If more than one partner function record is found for the same sales area, logic is applied to choose 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 is picked up as a partner.

If you do not want to use the standard implementation, define your own logic by choosing a default partner in the post-quote creation process.

If you want to use the standard implementation with a custom implementation, follow this sequence:

  1. Standard implementation—Add all partner functions from Account to Quote of the same sales area.
  2. Post Quote creation script—Additional defaulting. In this case, it important to check for duplicate partner records.
Note

The partner function sync is supported only for partner function type Account and User. It is not supported for other function types, such as Contact.

Account sync switch from BAPI to API

The JCo library that we use,

* BAPI_CUSTOMER_GETDETAIL2
* BAPI_CUSTOMER_GETSALESAREAS
* ISA_CUSTOMER_SALES_READ

returns an output structure as follows:

  • One or more structures, such as CUSTOMERADDRESS. The system may or may not use a particular structure.
  • Each structure consists of one or more values, such as NAME or NAME_2.

The following table shows examples.

IMC Object TypeIMC FieldBAPIStructureValueRemarks
AccountobjectNameBAPI_CUSTOMER_GETDETAIL2CUSTOMERADDRESSNAME + “ “ + NAME_2 + “ “ + NAME_3 + “ “ + NAME_4The result is trimmed to remove trailing whitespace.
AccountobjectERPIdBAPI_CUSTOMER_GETDETAIL2CUSTOMERADDRESSCUSTOMER
AccountvatIdBAPI_CUSTOMER_GETDETAIL2CUSTOMERGENERALDETAILVAT_REG_NO
AccounthasAccountStatushttp://www.inmindcloud.com/application/schema.owl#ACTIVEHardcoded value
AccountaccountGroupBAPI_CUSTOMER_GETDETAIL2CUSTOMERGENERALDETAILACCNT_GRP
AccounthasLanguageBAPI_CUSTOMER_GETDETAIL2CUSTOMERADDRESSLANGU_ISOValue must be mapped to an existing Language’s ERP ID. Otherwise, it is blank.
AccounthasCurrencyBAPI_CUSTOMER_GETDETAIL2CUSTOMERGENERALDETAILCURRENCY_ISOValue must be mapped to an existing Currency’s ERP ID. Otherwise, it is blank.
AddressaddressStreetBAPI_CUSTOMER_GETDETAIL2CUSTOMERADDRESSSTREET
AddressaddressZipBAPI_CUSTOMER_GETDETAIL2CUSTOMERADDRESSPOSTL_CODE
AddressaddressCityBAPI_CUSTOMER_GETDETAIL2CUSTOMERADDRESSCITY
AddressaddressPhoneBAPI_CUSTOMER_GETDETAIL2CUSTOMERADDRESSTELEPHONE
AddresshasCountryRegionBAPI_CUSTOMER_GETDETAIL2CUSTOMERADDRESSREGIONValue must be mapped to an existing CountryRegion’s ERP ID. Otherwise, it is blank.
AddresshasCountryBAPI_CUSTOMER_GETDETAIL2CUSTOMERADDRESSCOUNTRYISOValue must be mapped to an existing Country’s ERP ID. Otherwise, it is blank.
AddressaddressMaintrueHardcoded value
SalesInfohasSalesOrgBAPI_CUSTOMER_GETSALESAREASSALESAREASSALESORGValue must be mapped to an existing SalesOrg’s ERP ID. Otherwise, the sales info is not imported.
SalesInfohasDistributionChannelBAPI_CUSTOMER_GETSALESAREASSALESAREASDISTRCHNValue must be mapped to an existing DistributionChannel’s ERP ID. Otherwise, the sales info is not imported.
SalesInfohasDivisionBAPI_CUSTOMER_GETSALESAREASSALESAREASDIVISIONValue must be mapped to an existing Division’s ERP ID. Otherwise, the sales info is not imported.
SalesInfohasPaymentTermsISA_CUSTOMER_SALES_READCUST_SALES_DATAZTERMValue must be mapped to an existing PaymentTerms’ ERP ID. Otherwise, it is blank.
SalesInfohasIncoTermsISA_CUSTOMER_SALES_READCUST_SALES_DATAINCO1Value must be mapped to an existing IncoTerms’ ERP ID. Otherwise, it is blank.
SalesInfoquoteIncoTermsLocationISA_CUSTOMER_SALES_READCUST_SALES_DATAINCO2
SalesInfoaccountPricingProcedureIndicatorISA_CUSTOMER_SALES_READCUST_SALES_DATAKALKS
SalesInfohasShippingConditionISA_CUSTOMER_SALES_READCUST_SALES_DATAVSBEDValue must be mapped to an existing ShippingCondition’s ERP ID. Otherwise, it is blank.
SalesInfohasPriceListISA_CUSTOMER_SALES_READCUST_SALES_DATAPLTYPValue must be mapped to an existing PriceList’s ERP ID. Otherwise, it is blank.
SalesInfohasPriceGroupISA_CUSTOMER_SALES_READCUST_SALES_DATAKONDAValue must be mapped to an existing PriceGroup’s ERP ID. Otherwise, it is blank.
SalesInfohasSalesOfficeISA_CUSTOMER_SALES_READCUST_SALES_DATAVKBURValue must be mapped to an existing SalesOffice’s ERP ID. Otherwise, it is blank.
SalesInfohasSalesGroupISA_CUSTOMER_SALES_READCUST_SALES_DATAVKGRPValue must be mapped to an existing SalesGroup’s ERP ID. Otherwise, it is blank.
SalesInfohasCurrencyISA_CUSTOMER_SALES_READCUST_SALES_DATAWAERSThe first 3 characters of Value must be mapped to an existing Currency’s ERP ID. Otherwise, it is blank.

For Partner Function, it is not read from a BAPI. It is instead read directly from the KNVP table, filtered by KUNNR = accountERPID and clientColumn of MANDT. The resulting fields from the table are mapped as shown in the following table.

IMC Object TypeIMC FieldColumnRemarks
PartnerFunctionRecordlinksPartnerKUNN2 or PERNRDepending on the partner function, this can be mapped to the ERP ID of an Account (KUNN2) or an Employee (PERNR).
PartnerFunctionRecordhasPartnerFunctionPARVWValue must be mapped to an existing PartnerFunction’s ERP ID. Otherwise, the partner function record is not imported.
PartnerFunctionRecordsalesInfoPartnerFunctionRecordDefinedByVKORG, VTWEG, SPARTThese values must be mapped to an existing SalesInfo of the Account. VKORG is the SalesOrg, VTWEG is the DistributionChannel, and SPART is the Division.
PartnerFunctionRecordpartnerFunctionRecordDefaultDEFPATrue if value = “X”
PartnerFunctionRecordsequenceIDPARZA

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.