Source ERP · 95 of 105

CRMPro → Salesforce — SAP HANA: what the shipped templates set up

Read it in the terminal with "dlake skills show dlake-crmpro-salesforce/erps/sap-hana". It extends the dlake-crmpro-salesforce skill, which holds what is true whatever the source ERP.

CRMPro → Salesforce — SAP HANA: what the shipped templates set up

Keep this skill current. dlake ships updates often and this text is embedded in the CLI you have installed. Before relying on it, compare dlake --version with npm view @commercient/dlake version; if they differ, run npm install -g @commercient/dlake@latest and then dlake skills install, which overwrites the installed skill files with the current text.

dlake-crmpro is the parent skill and the authority for everything general: the crmpro_* tools, CRM_Configuration and CRM_FieldList, TimeStampRepository, the three kinds of source view, the NULL-cursor rule and the silent zero-record run. Read it first; this page does not repeat it. dlake-crmpro-salesforce is the destination skill this page is a child of, and the authority for the Salesforce conventions that hold across every ERP: read it first, then come back here for what this source’s own templates set. This page is dlake-crmpro-salesforce/erps/sap-hana.md, and that skill’s ERP table is what points at it. What follows is only what the shipped SAP HANA → Salesforce templates themselves set, read from their Insert_Query, CreateViewQuery and MappingJson. This page grows as the catalogue does.

1. What the templates deliver

GroupBusiness outcomeObjectsSource tables and views
Get_UsersThe templates push users to Salesforce. New records are created, existing ones updated, and records removed in the ERP are deleted.users
AccountIn addition to creating the Account record from your ERP customer records, Commercient syncs over the entire Accounting AR Customer record into a Commercient AR Customer object which is a Managed Custom Object (MCO). A lookup field is provided to lookup to the default AR Customer record MCO from the Account record. New records are created, existing ones updated, and records removed in the ERP are deleted.Account, Contact, CommercientSF16__KNA1__c, CommercientSF16__VBPA__cSF_ERP_Salesforce_Clone_KNA1, SF_ERP_Salesforce_Clone_ADRC, SF_ERP_Salesforce_Clone_KNVK, SF_ERP_Salesforce_Clone_ADR6, SF_ERP_Salesforce_Clone_VBPA
InvoiceBoth Open and Historical invoices are synchronized. Open invoice changes, such as a balance change, or a terms change are reflected in the CRM as they sync based on the frequency of the sync you have chosen (e.g. every hour for example). New records are created, existing ones updated, and records removed in the ERP are deleted.CommercientSF16__BKPF__c, CommercientSF16__ACDOCA__cSF_ERP_Salesforce_Clone_BKPF, CommercientFlags, SF_ERP_Salesforce_Clone_ACDOCA, TS_Inv_Hist
Invoice History HeadersThe Invoices from the ERP invoice module are synchronized to the Commercient Invoice Header (MCO) object in CRM. Customer service and sales people can visualize the status of the Invoice such as open, closed, as well as the balance remaining and the due date. New records are created, existing ones updated, and records removed in the ERP are deleted.CommercientSF16__VBRK__c, CommercientSF16__VBRP__cSF_ERP_Salesforce_Clone_VBRK, CommercientFlags, SF_ERP_Salesforce_Clone_VBRP
SalesorderCommercient will sync the Sales Orders from the ERP Sales Order Entry module to the Commercient Sales Order Header (MCO) objects in CRM. In the CRM, customer service and sales people can visualize the status of the order such as on hold, backorder, forward order, scheduled for delivery, whether it has shipped, and completion status. New records are created, existing ones updated, and records removed in the ERP are deleted.CommercientSF16__VBAK__c, CommercientSF16__VBAP__cSF_ERP_Salesforce_Clone_VBAK, CommercientFlags, SF_ERP_Salesforce_Clone_LIPS, SF_ERP_Salesforce_Clone_VBAP, SF_ERP_Salesforce_Clone_LIKP, PGI_Status

2. The process rows the templates create

Each template’s Insert_Query writes one CRM_Configuration row. These are the values it sets; a column the inserts never set is not listed.

Display nameCRM_Object_API_NameCRM_PK_API_NameSync_OrderTimeStamp_PrefixSQL_Query targetfield prefix / postfixSync_Operation_Type
GET USERusers0vw_SAPHANA_User1=0'' / ''1
SYNC SalespersonCommercientSF16__VBPA__cCommercientSF16__ExternalKey__c0vw_SAPHANA_SalesPersonvw_SAPHANA_SalesPersonCommercientSF16__ / __c1
SYNC ACCOUNTAccountCommercientSF__Commercient_ArCustomerCode__c1vw_SAPHANA_Accountvw_SAPHANA_Account'' / ''1
SYNC CUSTOMERCommercientSF16__KNA1__cCommercientSF16__ExternalKey__c2vw_SAPHANA_Customervw_SAPHANA_CustomerCommercientSF16__ / __c1
SYNC CUSTOMERTOACCOUNTLOOKUPAccountCommercientSF__Commercient_ArCustomerCode__c3vw_SAPHANA_AccountReverseLookupvw_SAPHANA_AccountReverseLookup'' / ''1
SYNC CONTACTSContactExternalKey__c4vw_SAPHANA_Contactvw_SAPHANA_Contact'' / ''1
SYNC SALESORDERHEADERCommercientSF16__VBAK__cCommercientSF16__ExternalKey__c5vw_SAPHANA_SalesOrdervw_SAPHANA_SalesOrderCommercientSF16__ / __c1
SYNC SALESORDERDETAILCommercientSF16__VBAP__cCommercientSF16__ExternalKey__c6vw_SAPHANA_SalesOrderLinevw_SAPHANA_SalesOrderLineCommercientSF16__ / __c1
SYNC OpenInvoiceCommercientSF16__BKPF__cCommercientSF16__ExternalKey__c7vw_SAPHANA_OpenInvoicevw_SAPHANA_OpenInvoiceCommercientSF16__ / __c1
SYNC InvoiceHistoryHeaderCommercientSF16__VBRK__cCommercientSF16__ExternalKey__c8vw_SAPHANA_InvoiceHistoryHeadervw_SAPHANA_InvoiceHistoryHeaderCommercientSF16__ / __c1
SYNC InvoiceHistoryLineCommercientSF16__VBRP__cCommercientSF16__ExternalKey__c9vw_SAPHANA_InvoiceHistoryLinevw_SAPHANA_InvoiceHistoryLineCommercientSF16__ / __c1
SYNC InvoicePaymentCommercientSF16__ACDOCA__cCommercientSF16__ExternalKey__c10vw_SAPHANA_InvoicePaymentvw_SAPHANA_InvoicePaymentCommercientSF16__ / __c1

Every one of these inserts Is_Active as 0, so an imported process is inactive until an operator activates it. Across the set they insert Is_Create_Entity 0, Is_Create_Fields 0, Is_Active_Get_Records 0, Is_Active_Delete_Records 0, IsAccountMatching False, Sync_Batch_Size 200. Text columns a template does not use are inserted as '' rather than left NULL. Get_SOQL_Query carries a query on GET USER, SYNC ACCOUNT, SYNC SALESORDERDETAIL — those rows read records back from Salesforce as well as pushing.

3. The views

Each template creates its view with CreateViewQuery, in the gateway dbo schema. “Change detection” names which of the three kinds dlake-crmpro defines the view’s own WHERE makes it; where a view’s shape is not one of those three the column is left empty and the view’s own WHERE is the authority.

ViewChange detectionRepository keyReads other prefixesIdentity columnSource tables
vw_SAPHANA_SalesPersoninsert-onlyvw_SAPHANA_SalesPerson:SF_ERP_Salesforce_Clone_VBPA
vw_SAPHANA_Accountinsert + updatevw_SAPHANA_Account:vw_SAPHANA_Salesperson:, vw_SAPHANA_ARTerms:, vw_SAPHANA_User:CommercientSF__Commercient_ArCustomerCode__cSF_ERP_Salesforce_Clone_KNA1, SF_ERP_Salesforce_Clone_ADRC
vw_SAPHANA_Customerinsert-onlyvw_SAPHANA_Customer:vw_SAPHANA_Account:, vw_SAPHANA_Salesperson:, vw_SAPHANA_Terms:ExternalKeySF_ERP_Salesforce_Clone_KNA1
vw_SAPHANA_AccountReverseLookupinsert + updatevw_SAPHANA_AccountReverseLookup:vw_SAPHANA_Customer:, vw_SAPHANA_Account:SF_ERP_Salesforce_Clone_KNA1
vw_SAPHANA_Contactinsert + updatevw_SAPHANA_Contact:vw_SAPHANA_Account:SF_ERP_Salesforce_Clone_KNVK, SF_ERP_Salesforce_Clone_KNA1, SF_ERP_Salesforce_Clone_ADR6
vw_SAPHANA_SalesOrderinsert-onlyvw_SAPHANA_SalesOrder:vw_SAPHANA_Account:, vw_SAPHANA_Customer:ExternalKeySF_ERP_Salesforce_Clone_VBAK, CommercientFlags
vw_SAPHANA_SalesOrderLineinsert-onlyvw_SAPHANA_SalesOrderLine:vw_SAPHANA_SalesOrder:ExternalKeySF_ERP_Salesforce_Clone_VBAK, SF_ERP_Salesforce_Clone_LIPS, SF_ERP_Salesforce_Clone_VBAP, SF_ERP_Salesforce_Clone_LIKP, PGI_Status
vw_SAPHANA_OpenInvoiceinsert-onlyvw_SAPHANA_OpenInvoice:vw_SAPHANA_Account:, vw_SAPHANA_Customer:ExternalKeySF_ERP_Salesforce_Clone_BKPF, CommercientFlags
vw_SAPHANA_InvoiceHistoryHeaderinsert-onlyvw_SAPHANA_InvoiceHistoryHeader:vw_SAPHANA_Account:, vw_SAPHANA_Customer:ExternalKeySF_ERP_Salesforce_Clone_VBRK, CommercientFlags
vw_SAPHANA_InvoiceHistoryLineinsert-onlyvw_SAPHANA_InvoiceHistoryLine:vw_SAPHANA_InvoiceHistoryHeader:ExternalKeySF_ERP_Salesforce_Clone_VBRP
vw_SAPHANA_InvoicePaymentinsert-onlyvw_SAPHANA_InvoicePayment:vw_SAPHANA_Account:, vw_SAPHANA_Customer:, vw_SAPHANA_InvoiceHistoryHeader:ExternalKeySF_ERP_Salesforce_Clone_ACDOCA, TS_Inv_Hist

The repository key these templates build is <TimeStamp_Prefix>:<key>. The literal in the view and the TimeStamp_Prefix on the configuration row have to be the same string, case included.

4. Order of work

The templates set Sync_Order from 0 to 10. A run processes active rows in ascending Sync_Order, which is the order the templates put them in:

  • 0 — GET USER, SYNC Salesperson
  • 1 — SYNC ACCOUNT
  • 2 — SYNC CUSTOMER
  • 3 — SYNC CUSTOMERTOACCOUNTLOOKUP
  • 4 — SYNC CONTACTS
  • 5 — SYNC SALESORDERHEADER
  • 6 — SYNC SALESORDERDETAIL
  • 7 — SYNC OpenInvoice
  • 8 — SYNC InvoiceHistoryHeader
  • 9 — SYNC InvoiceHistoryLine
  • 10 — SYNC InvoicePayment

Several of these rows share a Sync_Order value: each template group carries its own numbering, so give the imported processes an order across the whole set rather than taking the template values as one.

These views read another process’s repository prefix, which is what makes the order a dependency order: the row appears in the view only once the process that writes that prefix has run, so a parent flows on one run and its children on the next.

  • vw_SAPHANA_Account reads vw_SAPHANA_Salesperson:, vw_SAPHANA_ARTerms:, vw_SAPHANA_User:; no template in this set writes vw_SAPHANA_ARTerms:
  • vw_SAPHANA_AccountReverseLookup reads vw_SAPHANA_Customer:, vw_SAPHANA_Account:
  • vw_SAPHANA_Contact reads vw_SAPHANA_Account:
  • vw_SAPHANA_Customer reads vw_SAPHANA_Account:, vw_SAPHANA_Salesperson:, vw_SAPHANA_Terms:; no template in this set writes vw_SAPHANA_Terms:
  • vw_SAPHANA_OpenInvoice reads vw_SAPHANA_Account:, vw_SAPHANA_Customer:
  • vw_SAPHANA_InvoicePayment reads vw_SAPHANA_Account:, vw_SAPHANA_Customer:, vw_SAPHANA_InvoiceHistoryHeader:
  • vw_SAPHANA_InvoiceHistoryHeader reads vw_SAPHANA_Account:, vw_SAPHANA_Customer:
  • vw_SAPHANA_InvoiceHistoryLine reads vw_SAPHANA_InvoiceHistoryHeader:
  • vw_SAPHANA_SalesOrder reads vw_SAPHANA_Account:, vw_SAPHANA_Customer:
  • vw_SAPHANA_SalesOrderLine reads vw_SAPHANA_SalesOrder:

5. Field mapping

CRM_FieldList carries one row per pushed column, with Object_Name equal to the CRM_Object_API_Name value — as dlake-crmpro puts it, an object with no CRM_FieldList rows pushes nothing and records no error. Each template carries its intended mapping in MappingJson. Read that with dlake admin crmpro_templates, then check crmpro_field_mapping on the created process before activating it.

TemplateObjectMapped fieldsFirst ERP → Salesforce pairs
SYNC SalespersonCommercientSF16__VBPA__c23MANDTCommercientSF16__MANDT__c, VBELNCommercientSF16__VBELN__c, POSNRCommercientSF16__POSNR__c, PARVWCommercientSF16__PARVW__c, LIFNRCommercientSF16__LIFNR__c
SYNC ACCOUNTAccount15CommercientSFommercient_ArCustomerCodeCommercientSF__Commercient_ArCustomerCode__c, CommercientSF16__SAP_HANA_SalespersonCommercientSF16__SAP_HANA_Salesperson__c, CommercientSF16__SAP_HANA_TermsCommercientSF16__SAP_HANA_Terms__c, TypeType, BillingStreetBillingStreet
SYNC CUSTOMERCommercientSF16__KNA1__c232AccountAccount, SAP_HANA_SalespersonCommercientSF16__SAP_HANA_Salesperson__c, SAP_HANA_TermsCommercientSF16__SAP_HANA_Terms__c, RULE_EXCLUSIONRULE_EXCLUSION, KNRZACommercientSF16__KNRZA__c
SYNC CUSTOMERTOACCOUNTLOOKUPAccount2CommercientSFommercient_ArCustomerCodeCommercientSF__Commercient_ArCustomerCode__c, CommercientSF16__SAP_HANA_CustomerCommercientSF16__SAP_HANA_Customer__c
SYNC CONTACTSContact12FirstNameFirstName, LastNameLastName, EmailEmail, PhonePhone, TitleTitle
SYNC SALESORDERHEADERCommercientSF16__VBAK__c210AccountCommercientSF16__account__c, KNA1CommercientSF16__kna1__c, MANDTCommercientSF16__mandt__c, VBELNCommercientSF16__vbeln__c, ERDATCommercientSF16__erdat__c
SYNC SALESORDERDETAILCommercientSF16__VBAP__c355VBAKCommercientSF16__vbak__c, MANDTCommercientSF16__mandt__c, VBELNCommercientSF16__vbeln__c, POSNRCommercientSF16__posnr__c, MATWACommercientSF16__matwa__c
SYNC OpenInvoiceCommercientSF16__BKPF__c112AccountCommercientSF16__account__c, KNA1CommercientSF16__kna1__c, MANDTCommercientSF16__mandt__c, BUKRSCommercientSF16__bukrs__c, BELNRCommercientSF16__belnr__c
SYNC InvoiceHistoryHeaderCommercientSF16__VBRK__c116AccountCommercientSF16__account__c, KNA1CommercientSF16__kna1__c, KALSMCommercientSF16__kalsm__c, KNUMVCommercientSF16__knumv__c, VSBEDCommercientSF16__vsbed__c
SYNC InvoiceHistoryLineCommercientSF16__VBRP__c279VBRKCommercientSF16__vbrk__c, KOWRRCommercientSF16__kowrr__c, PRSFDCommercientSF16__prsfd__c, SKTOFCommercientSF16__sktof__c, SKFBPCommercientSF16__skfbp__c
SYNC InvoicePaymentCommercientSF16__ACDOCA__c415VBRKvbrk__c, AccountIDaccountid__c, KNA1kna1__c, BELNRCommercientSF16__belnr__c, DOCLNCommercientSF16__docln__c

6. Community templates

The catalogue carries 50 community templates for this pair. A community template is authored in a tenant rather than shipped with the product, and it imports the same way as any other. Its own names, notes, field mapping and SQL are tenant content, so what this section states is what the set amounts to: how many templates there are, what they default to doing, which destination objects they write and which groups they fall in. They are not part of the shipped set described above.

  • Templates: 50
  • Default operations: insert on 50, update on 50, delete on 50
  • Marked circular-sync: 0
  • Licence groups they span: 12
  • Destination objects: Account, Product2, CommercientSF16__KNA1__c, CommercientSF16__VBAP__c, Contact, CommercientSF16__BKPF__c, CommercientSF16__VBAK__c, CommercientSF16__VBPA__c, CommercientSF16__VBRK__c, CommercientSF16__VBRP__c, CommercientSF16_SAPHANA_ADDRESS__c, CommercientSF16__ACDOCA__c and 11 custom objects
  • Object display names: SYNC ACCOUNT, SYNC CONTACTS, SYNC CUSTOMER, SYNC CUSTOMERTOACCOUNTLOOKUP, SAP HANA SerialNumber, SAPHANA Customer Address, SYNC ArTerms, SYNC InvoiceHistoryHeader, SYNC InvoiceHistoryLine, SYNC ITEMS, SYNC ITEMTOPRODUCTLOOKUP, SYNC OpenInvoice, 17 more and a further template
  • Template groups: Account, Product, Salesorder, Invoice, Invoice History Headers, Customer Multi Ship Addresses

A community template is imported the way a shipped one is, and the same rules apply to what it creates: read the process it creates with crmpro_get_process, its mapping with crmpro_field_mapping, and the view it selects from, before activating it.

7. Verifying

# per-prefix counts; every synced record carries its destination id
dlake tool query --profile <tenant> --sql "SELECT LEFT([Key], CHARINDEX(':',[Key])-1) AS prefix, COUNT(*) n, COUNT(NULLIF(SFDCID,'')) withId FROM dbo.TimeStampRepository WHERE CHARINDEX(':',[Key])>0 GROUP BY LEFT([Key], CHARINDEX(':',[Key])-1)"

withId = n for every prefix is the success condition dlake-crmpro defines. The split is on the first colon, which is the prefix boundary whether the key separator is : or ::.

The prefixes these templates set:

  • vw_SAPHANA_User
  • vw_SAPHANA_Account
  • vw_SAPHANA_AccountReverseLookup
  • vw_SAPHANA_Contact
  • vw_SAPHANA_Customer
  • vw_SAPHANA_OpenInvoice
  • vw_SAPHANA_InvoicePayment
  • vw_SAPHANA_InvoiceHistoryHeader
  • vw_SAPHANA_InvoiceHistoryLine
  • vw_SAPHANA_SalesOrder
  • vw_SAPHANA_SalesOrderLine
  • vw_SAPHANA_SalesPerson

8. Where this sits

dlake-crmpro is the general operating surface — the crmpro_* tools, the setup and transaction tables, field mapping, and the source-view contract that applies to every destination. This page adds what the shipped SAP HANA → Salesforce templates set up. dlake-crmpro-salesforce is the destination skill this page sits under: its own text is the authority for the Salesforce conventions that hold across every ERP, and its ERP table lists this page alongside every sibling ERP page for this destination. For the extract leg that fills the clone tables, see dlake-normalsync; for the on-premises agent that runs it, dlake-syncagent; for the writeback leg, dlake-txdownloaderpro; for standing an integration up, dlake-integration-setup.