Sie sind auf Seite 1von 99

3/5/2020

Integrations and Data Management


Generated on: 2020-03-05

SAP Commerce | 1905

PUBLIC

Original content: https://help.sap.com/viewer/50c996852b32456c96d3161a95544cdb/1905/en-US

Warning

This document has been generated from the SAP Help Portal and is an incomplete version of the official SAP product documentation. The information included in
custom documentation may not re ect the arrangement of topics in the SAP Help Portal, and may be missing important aspects and/or correlations to other
topics. For this reason, it is not for productive use.

For more information, please visit the https://help.sap.com/viewer/disclaimer.

SAP Cloud for Customer Integration Module


The SAP Commerce integration with SAP Cloud for Customer enables large enterprises to provide best-in-class service and sales support to their customers and
assist them in the best way possible throughout their buying journey, regardless of channel or touchpoint.

Features Architecture Implementation

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d75… 1/99
3/5/2020

Customer Replication SAP Cloud for Customer Integration Architecture SAP Cloud for Customer Integration Implementation

Quote Replication

Ticket Replication

Assisted Service Module Integration

Data Privacy Management

SAP Cloud for Customer Integration Features


The SAP Commerce and SAP Cloud for Customer integration provides a standard integration between the market leading omni-channel commerce and customer
support solutions in the SAP product portfolio.

The integration focuses on the following features:

Customer Replication
The integration synchronizes customer data from SAP Commerce to SAP Cloud for Customer to connect customers with customer support agents.
Quote Replication
The integration replicates a B2B commerce quote created by the customer in SAP Commerce to SAP Cloud for Customer, for further processing and
actions.
Ticket Replication
The integration synchronizes customer service tickets from SAP Commerce to SAP Cloud for Customer.
Assisted Service Module Integration
An agent can click a link in the SAP Cloud for Customer system that quickly and seamlessly, using single sign-on, opens the Assisted Service Module on top
of the SAP Commerce storefront to allow the agent to provide seamless omni-commerce interactive sales and service support to the customer in real-time,
or off-line.
Data Privacy Management
Data privacy mechanisms for SAP Cloud for Customer integration help ensure that customers' personal data is handled appropriately.

Customer Replication
The integration synchronizes customer data from SAP Commerce to SAP Cloud for Customer to connect customers with customer support agents.

Once connected, agents can communicate with customers and resolve their needs using various communication channels.

Quote Replication
The integration replicates a B2B commerce quote created by the customer in SAP Commerce to SAP Cloud for Customer, for further processing and actions.

The sales representative can update and accept the quote in SAP Cloud for Customer. The updates in SAP Cloud for Customer gets replicated to SAP Commerce.
The customer can then edit, accept, or reject the quote in the SAP Commerce storefront.

Quote Replication Using SAP Cloud Platform Integration

 Note
This content is only relevant if you have the latest Commerce Cloud Extension Pack, see Commerce Cloud Extension Pack. The Commerce Cloud Extension Pack
can only be used with SAP Commerce Cloud in the Public Cloud.

The replication of quote between the two systems can also be achieved using SAP Cloud Platform Integration and Integration Objects. For more information, see
Replicating Quote Between SAP Commerce and SAP Cloud for Customer.

Con guring Data Hub Parameters


https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d75… 2/99
3/5/2020
Con gure the Data Hub parameters to set up the quote replication from SAP Commerce to SAP C4C. Further updates are replicated between the two systems.

Procedure
Override the following properties in the local.properties le, if required:

#Outbound properties:
c4c.quote.actioncode=04
c4c.quote.partner.defschemecode=918
c4c.quote.prod.schedulelineid=0001
c4c.quote.prod.schedulelinetypecode=1
c4c.quote.text.header.typecode
c4c.quote.erp.logicalsystemid
c4c.quote.cancelcode=04
c4c.quote.order.typecode
c4c.quote.btdreference.typecode
c4c.quote.header.text.actioncode
c4c.quote.header.itemcompletetransmissionindicator=true
c4c.quote.header.businesstransactiondocumentreferencecompletetransmissionindicator=true
c4c.quote.header.otherpartylistcompletetransmissionindicator=true
c4c.quote.header.salesemployeepartylistcompletetransmissionindicator=true
c4c.quote.header.predecessorindicator=true
c4c.quote.header.textlistcompletetransmissionindicator=false
c4c.quote.item.itemcustomdefinedpartylistcompletetransmissionindicator=true
c4c.quote.item.create.schedulelinecompletetransmissionindicator=true
c4c.quote.item.update.schedulelinecompletetransmissionindicator=false
c4c.quote.item.actioncode=04
datahub.c4c.quote.exportURL=<quote replication webservice endpoint of c4c>
datahub.c4c.quote.userName=
datahub.c4c.quote.password=
datahub.c4c.quote.approval.exportURL=<quote approval notification webservice endpoint of c4c>
datahub.c4c.senderParty.schemeID.SAPC4CQUOTE_OUTBOUND_POOL= senderPartyID
datahub.c4c.senderParty.internalID.SAPC4CQUOTE_OUTBOUND_POOL= senderInternalID
datahub.c4c.senderParty.schemeAgencyID.SAPC4CQUOTE_OUTBOUND_POOL=310 (change as per your system)
datahub.c4c.recipientParty.schemeID.SAPC4CQUOTE_OUTBOUND_POOL=recipientSchemeID
datahub.c4c.recipientParty.internalID.SAPC4CQUOTE_OUTBOUND_POOL=recipientInternalID
datahub.c4c.recipientParty.schemeAgencyID.SAPC4CQUOTE_OUTBOUND_POOL=310(change as per your system)

#Inbound properties:
c4cQuote.range
c4cquote.state=BUYER_OFFER
c4cquote.baseStoreUid=powertools
c4cquote.baseSiteUid=powertools
c4cquote.confirmation.state=SELLER_REQUEST
c4cquote.sellerTypeCode
c4cquote.priceTypeCode
c4cquote.salesgroup
c4cquote.commentTypes

Con guring Backoffice Parameters


Con gure the Backoffice parameters to set up quote replication from SAP Commerce to SAP C4C. Further updates are replicated between the two systems.

Procedure
1. Create an SAP Base Store Con guration. See Creating an SAP Base Store Con guration.

2. Select the created SAP Base Store Con guration.

3. On the Common Settings tab, con gure Sales Organization, Distribution Channel, and Division.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d75… 3/99
3/5/2020

4. On the Administration tab, con gure Base Store.

5. On the C4C tab, con gure C4C Quote Type.

6. On the Asynchronous Order Management tab, con gure Item Price.

7. Push the con gurations to Data Hub (execute this step after Data Hub setup is done).

Ticket Replication
The integration synchronizes customer service tickets from SAP Commerce to SAP Cloud for Customer.

Once the tickets are synchronized, agents can communicate with customers and resolve their needs via the SAP Commerce Customer Ticketing System, or in real-
time by contacting over the phone.

Assisted Service Module Integration


An agent can click a link in the SAP Cloud for Customer system that quickly and seamlessly, using single sign-on, opens the Assisted Service Module on top of the
SAP Commerce storefront to allow the agent to provide seamless omni-commerce interactive sales and service support to the customer in real-time, or off-line.

Sales agents using the SAP Commerce storefront can search and browse the online catalog to look up product information, con gure product bundles, add
products to carts, create quotes, or even check carts out for customers on their behalf. They can also help a customer with their account information, such as their
payment details, existing orders, delivery address and so on. This enables your sales force and service team to provide interactive selling and service to your
customers on the spot, improves the customer relationship, and makes the service and sales process more efficient.

Data Privacy Management


Data privacy mechanisms for SAP Cloud for Customer integration help ensure that customers' personal data is handled appropriately.

Personal Data Erasure

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d75… 4/99
3/5/2020
Users can ask for deletion of their personal data. In addition, data can also automatically be deleted after a certain retention period to accommodate the user's
right to be forgotten.

SAP Commerce integration with SAP Cloud for Customer uses the pool data management structure to automatically delete the stale data from your Data Hub data
pools. For more information, seeCon guring Data Pools for Automatic Data Deletion.

As part of SAP Cloud for Customer integration, a deletable ag is added to the c4cquote-canonical extension and the following pools:

SAPC4CQUOTE_INBOUND_POOL

SAPC4CQUOTE_OUTBOUND_POOL

Master and transactional data replicated to SAP C4C is stored in SAP Commerce. When such master and transactional data is deleted from SAP Commerce,
manual deletion of any corresponding data in SAP C4C is required.

SAP Cloud for Customer Integration Architecture


The integration with C4C enables large enterprises to provide best-in-class service and sales support to their customers and assist them in the best way possible
throughout their buying journey, regardless of channel or touchpoint.

Dependencies
The module structure along with the dependencies looks as follows:

Dependency Diagram for Customer

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d75… 5/99
3/5/2020

Dependency Diagram for Customer Ticketing System

Recipes
The following recipes contain the SAP Cloud for Customer integration module:

b2c_c4c

b2b_c4c

 Note
These recipes are relevant only for replication scenarios involving Data Hub.

Extensions
The SAP Cloud for Customer integration consists of the following extensions:

c4ccustomer Extension
The c4ccustomer extension handles sending customer data from the Commerce Platform to Data Hub.
c4cquote Extension
The c4cquote extension sends quote data from SAP Commerce to C4C and vice versa.
sapc4ccustomerb2c Extension
The sapc4ccustomerb2c extension automatically replicates B2C customer data to SAP Cloud Platform Integration when customers register in the
online store.
customerticketingc4cb2bintegration Extension
The customerticketingc4cb2bintegration extension allows to expose the functionality of the Customer Ticketing Module's C4C integration to
the B2B Accelerator.
customerticketingc4cintegration Extension
The customerticketingc4cintegration extension allows for the integration of Customer Ticketing System with the SAP Cloud for Customer
system.
c4c-integration Data Hub Extensions
The c4c-integration Data Hub extensions integrate customer data from the Commerce Platform to the SAP Cloud for Customer system via Data Hub.
c4ccpiquote Extension

c4ccustomer Extension
The c4ccustomer extension handles sending customer data from the Commerce Platform to Data Hub.

 Note

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d75… 6/99
3/5/2020
An SAP Commerce extension may provide functionality that is licensed through different SAP Commerce modules. Make sure to limit your implementation to
the features de ned in your contract license. In case of doubt, please contact your sales representative.

General
The c4ccustomer extension provides the services used to transfer customer-related data from the Commerce Platform to the datahubadapter extension. For
more information, see The Data Hub Adapter. The module changes the following DTOs:

AddressData with the following properties: integrationKey, customer, isocode

CustomerData with the following properties: integrationKey, customerId.

For more details, you can check the c4ccustomer/resources/c4ccustomer-beans.xml le.

SAP Cloud for Customer Requirements

1. Always put Action Code as 04 and save the action:

If customer exists in SAP Cloud for Customer, their record is updated.

If customer does not exist in SAP Cloud for Customer, a new record is created.

2. Always send the complete customer record from SAP Commerce, not just the changed data of a customers record.

The dataSetup bean is de ned in c4ccustomer/resources/c4ccustomer-spring.xml le. This class is marked with @SystemSetup annotation as
installing essential data. For ATDD tests, there is also c4cIntegrationServer bean de ned in
c4ccustomeratddtests/resources/c4ccustomeratddtests-spring.xml and it runs war le with c4c-integration.

Example of Commerce Platform- SAP Cloud for Customer Communication

You can send a request to synchronize customers. The request triggers synchronization on SAP Cloud for Customer side.

Headers

X-tenantId:single
Content-Type:application/json
Accept:application/json

Request Body

{
"syncExecutionId": "dc49aa81-0eec-49ca-8c51-7438dcabe0df",
"dataStreams" : [
{
"itemType": "Customer",
"columns": "uid;customerId;firstName",
"urls": [
"http://localhost:9001/medias/Customer-5ffdf3cb-0272-4988-9b2a-ffe6efd1d7d5?context=anVuaXR8cm9vdHw5MHx0ZXh0L3BsYWlufGh\
hYy9oOTUvODc5NjA5MzMxNzE1MC50eHR8MGRkMzJjMmZmNmU1MDk5Y2I5YzcxZDZjYjdlMmJlYjQ4MjllMzcxYTRhZDk3ZGI1YTcwMTkxNGU2MWZhZTI3OQ"
]
}
]
}

Where:

syncExecutionId is a job execution ID

dataStreams is a list of streams to be synchronized. Streams for c4ccustomer are de ned in c4ccustomer/resources/impex/c4cdata-
streams.impex:

itemType is a type of objects to be synchronized

columns is a header line for csv les and it de nes the order of attributes

urls is a list of urls for medias. These medias are CSV les for items/objects to be updated/synchronized

Customization and Con guration Options


Spring beans are de ned in c4ccustomer/resources/c4ccustomer-spring.xml. There is only one bean there called dataSetup. It is used to
import essential data for the extension.

Required information for c4ccustomer are de ned in c4ccustomer/resources/impex/c4cdata-streams.impex.

Some mandatory options are de ned in c4ccustomer/project.properties and for ATDD tests:
c4ccustomeratddtests/project.properties.

y2y sync
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d75… 7/99
3/5/2020
To start the synchronization process, you have to trigger c4cSyncToDataHubCustomersCronJob and c4cSyncToDataHubAddressesCronJob or run a
script c4cSync via Backoffice. For more information about synchronization process, see Synchronization Between SAP Commerce Installations. All changes made
in customer and customer's address models since the last synchronization or since model creation, if synchronization is being called for the rst time, are split in
chunks and stored in media models. All the chunks are sent to Data Hub as a URL to appropriate media models.

The RemoveVersionMarker script erases information about current synchronization state. After calling it, next synchronization session counts all existing
customers and addresses as newly created and loses information about model removal.

Data Synchronization
When the customer or address is created, updated, or deleted, the following action is performed.

The similar to Y2YSyncMasterJobPerformable class is created. The class is called C4CSyncJobPerformable and handles the customer and address models. You
can con gure this class via impex le, but it can work only with composed type Customer and Address. The main task of this class is to provide to Data Hub full
set of data, customer with related addresses, when the data in any of the models is updated. The helper collector class DefaultC4CAggregatingCollector fetches
related models and passes them to batching collectors with a respect to the model types. The changes are received immediately and the data is not resent, which
means that the information can be lost in case of network issues. If an address is deleted, the system sends owner customer with remaining addresses. If a
customer is deleted, the system skips it as well as related addresses, so the customer remains unchanged on SAP Cloud for Customer side. If an address changes,
the implementation sends its parent customer. If a customer item changes, the implementation sends the customer and all their addresses.

Implementation Details

The system stores owner customer's primary key in info eld of address ItemChangeDTO.

The duplicated change records can occur and it is related to trade-off batching. This issue is constrained by using a DefaultC4CAggregatingCollector. Data Hub
handles duplicated items correctly, it can only stress a network.

Component diagram

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d75… 8/99
3/5/2020

Related Information
c4c-integration-raw Extension
c4c-integration-canonical Extension
c4c-integration-target Extension
c4c-integration-soap-adapter Extension
Data Hub
Synchronization Between SAP Commerce Installations

c4c-integration Mapping
The SAP Commerce c4ccustomer extension handles sending customer data from the Commerce Platform to the SAP Commerce Data Hub.

 Note
An SAP Commerce extension may provide functionality that is licensed through different SAP Commerce modules. Make sure to limit your implementation to
the features de ned in your contract license. In case of doubt, please contact your sales representative.

General

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d75… 9/99
3/5/2020

c4ccustomer c4c-integration
Custom er Custom erRawItem Custom erCanonicalItem Custom erlItem
c ustomerID c ustomerId c ustomerId c ustomerId

uid email email email

name name firstname name

addresses lastname lastname


def aultPay mentAddress addresses
addresses addresses
billingAddressId
def aultShipmenttAddress billingAddressId “CRM000” roleCode
shippingAddressId AddressItem
shippingAddressId null formOfAddress
isBillingAddress
defaultAddressId “0” gender
isShippingAddress

isDefaultAddress
Address AddresRawItem AddressCanonicalItem
pk addressId addressId addressId

owner c ustomerId c ustomerId c ustomerId

email email email email

postalc ode postalCode postalCode postalCode

streetname streetName streetName streetName

streetnumber streetNumber streetNumber streetNumber

pobox pobox pobox pobox

distric t distric t distric t distric t

town town c ity c ity

c ountry c ountry c ountry c ountry

phone1 phone1 phones phones

phone2 phone2 fax fax

fax fax c ellphone c ellphone

c ellphone c ellphone

Customer: Address

Platform Side

One column mapping is added to y2ysync:

Customer:

addresses -> addresses

Data Hub Side

One attribute is added to CustomerRawItem

addresses

This is comma- separated list.

For example

customerId,name,email,billingAddressId,shippingAddressId,addresses
jd8,JohnDoe,john.doe@email.com,A1,A2,"A1,A2,A3"

One attribute is added to CustomerCanonicalItem

addresses

This is comma-separated list.

Mappings from CustomerRawItem to CustomerCanonicalItem:

addresses -> addresses

One attribute us added to AddressItem target item

addresses

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 10/99
3/5/2020
This is a comma-separated list of addresses IDs. It is only used during DefaultC4cSoapPublisher preprocessing and to compute complete sets of customers
and addresses.

Customer: name

Platform Side

One column mapping is added to y2ysync:

Customer:

name -> name

Data Hub Side

One attribute is added to CustomerRawItem:

name

Two attributes are added to CustomerCanonicalItem

rstname

lastname

Mappings from CustomerRawItem to CustomerCanonicalItem

Multiple scenarios are implemented because the SAP Commerce handles only one eld for a name, and SAP Cloud for Customer handles two elds: rstName and
lastName. The following scenarios are possible:

Scenario 1

Scenario 1:
- firstName: John
- lastName: Doe

Result:
- firstname: John (if there is a lastName, use the whole firstName)
- lastname: Doe (if there is a lastName, use the lastName)

Scenario 2

Scenario 2:
- firstName: John Doe
- lastName:

Result:
- fistname: John (if there is no lastName, then use the whole firstName, but without the last word)
- lastname: Doe (if there is no lastName, then use the last word of firstName)

Scenario 3

Scenario 3: "worst case scenario"

- fisrtName: John
- lastName:

Result:
- firstname: John (if there is no lastName and if there is no whitespace in fisrtName, then use the whole firstName)
- lastname: (if there is no lastName and if there is no whitespace in firstName, then assign a null value)

Two attributes are added to CustomerItem target item

name

lastname

Mappings between CustomerCanonicalItem and CustomerItem

rstname -> name

lastname -> lastname

For more information on mapping, see the c4c-integration-target/src/main/resources/META-INF/c4c-integration-target-datahub-


extension.xml.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 11/99
3/5/2020
For the c4c-soap-adater extension, these SAP Cloud for Customer tags are created out of the target items:

c4c-soap-adatper

<BusinessPartner actionCode="04"
addressInformationListCompleteTransmissionIndicator="true"
roleListCompleteTransmissionIndicator="true"
identificationListCompleteTransmissionIndicator="true"
industrySectorListCompleteTransmissionIndicator="true"
commonListCompleteTransmissionIndicator="true">

... some other tags... related to addresses ...

<Common actionCode="04">
<ReleasedIndicator>true</ReleasedIndicator>
<BlockedIndicator>false</BlockedIndicator>
<DeletedIndicator>false</DeletedIndicator>
<Person>
<Name>
<GivenName>John</GivenName> <--- CustomerItem.name
<FamilyName>Doe</FamilyName> <--- CustomerItem.lastname
</Name>
</Person>
</Common>

... some other tags ...

</BusinessPartner>

Customer: defaultShipmentAddress, defaultPaymentAddress

Platform Side

Two column mappings are added to y2ysync.

Customer:

defaultShipmentAddress -> shippingAddressId

defaultPaymentAddress -> billingAddressId

Data Hub Side

Two attributes are added to CustomerRawItem:

shippingAddressId

billingAddressId

Three attributes are added to CustomerCanonicalItem:

shippingAddressId

billingAddressId

defaultAddressId

Mappings from CustomerRawItem to CustomerCanonicalItem:

shippingAddressId -> shippingAddressId

billingAddressId -> billingAddressId

shippingAddressId -> defaultAddressId (take a look at the warning)

 Note
The mapping between shippingAddressId and defaultAddressId is made because the platform y2ysync con g is not able to handle a mapping between a
platform column and multiple Data Hub columns.

Three attributes are added to AddressItem target item:

isShippingAddress

isBillingAddress

isDefaultAddress

The way the information between CustomerCanonicalItem and AddressItem are mapped:

isShippingAddress: compares the value between AddressItem.addressId against CustomerCanonicalItem.shippingAddressId

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 12/99
3/5/2020
isBillingAddress: compares the value between AddressItem.addressId against CustomerCanonicalItem.billingAddressId

isDefaultAddress: compares the value between AddressItem.addressId against CustomerCanonicalItem.defaultAddressId

For more information about mapping, see the c4c-integration-target/src/main/resources/META-INF/c4c-integration-target-


datahub-extension.xml.

For the c4c-soap-adater extension, the following SAP Cloud for Customer tags are created out of the target items:

Depending on the ags, an Address can be marked with one, two, or three ags:

isDefaultAddress = true

<AddressInformation actionCode="04" addressUsageListCompleteTransmissionIndicator="true">


<AddressUsage actionCode="04">
<AddressUsageCode>XXDEFAULT</AddressUsageCode> <-- static value that marks an address as default address
</AddressUsage>

...
</<AddressInformation>

isShippingAddress = true

<AddressInformation actionCode="04" addressUsageListCompleteTransmissionIndicator="true">


<AddressUsage actionCode="04">
<AddressUsageCode>SHIP_TO</AddressUsageCode> <-- static value that marks an address as shipping address
</AddressUsage>

...
</<AddressInformation>

isBillingAddress = true

<AddressInformation actionCode="04" addressUsageListCompleteTransmissionIndicator="true">


<AddressUsage actionCode="04">
<AddressUsageCode>BILL_TO</AddressUsageCode> <-- static value that marks an address as billing address
</AddressUsage>

...
</<AddressInformation>

isBillingAddress = isShippingAddress = isDefaultAddress = true

<AddressInformation actionCode="04" addressUsageListCompleteTransmissionIndicator="true">


<AddressUsage actionCode="04">
<AddressUsageCode>XXDEFAULT</AddressUsageCode>
</AddressUsage>
<AddressUsage actionCode="04">
<AddressUsageCode>SHIP_TO</AddressUsageCode>
</AddressUsage>
<AddressUsage actionCode="04">
<AddressUsageCode>BILL_TO</AddressUsageCode>
</AddressUsage>

...
</<AddressInformation>

Customer and Address: email

Platform Side

One column mapping is added to y2ysync

Customer:

uid -> email

Address:

email -> email

Data Hub Side

Customer:

One attribute is added to CustomerRawItem:

email -> email

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 13/99
3/5/2020
Address:

One attribute is added to AddressRawItem:

email -> email

Customer:

One attribute is added to CustomerCanonicalItem:

email -> email

Address:

One attribute is added to AddressCanonicalItem:

email -> email

Customer:

One attribute is added to CustomerItem target item:

email -> email

Address:

One attribute is added to AddressItem target item:

email -> email

There are possible scenarios:

Scenario 1

Endpoint email address is taken from AddressItem target item, if it is populated by email Address, otherwise it is taken from CustomerItem target item if exists.
Email address and postal address is a part of the Address information. If there is no email address on AddressItem or CustomerItem target item, email xml tag is
not created.

CustomerRawItem

customerId,name,email,billingAddressId,shippingAddressId,addresses
id1,John Doe,john.doe@email.com,,A1,"A1"

AddressRawItem

addressId,town,country,postalCode,streetName,streetNumber,phone1,phone2,cellphone,fax,email,customerId
A1,MUNICH,DE,80636,Nymphenburgerstr.,86,089898989,,017676767676,,john.doe@sap.com,id1

<AddressInformation actionCode="04"
addressUsageListCompleteTransmissionIndicator="true">
<AddressUsage actionCode="04">
<AddressUsageCode>BILL_TO</AddressUsageCode>
</AddressUsage>
<Address emailListCompleteTransmissionIndicator="true"
facsimileListCompleteTransmissionIndicator="true"
postalAddressListCompleteTransmissionIndicator="true"
webListCompleteTransmissionIndicator="true"
organisationNameListCompleteTransmissionIndicator="true">
<Email actionCode="04"
eMailUsageListCompleteTransmissionIndicator="true">
<URI>john.doe@sap.com</URI>
<EmailUsage actionCode="04">
<Usage>
<Code>AD_DEFAULT</Code>
</Usage>
</EmailUsage>
</Email>
<PostalAddress actionCode="04">
<CountryCode>DE</CountryCode>
<CityName>MUNICH</CityName>
<StreetPostalCode>80636</StreetPostalCode>
<StreetName>Nymphenburgerstr.</StreetName>
<HouseID>86</HouseID>
</PostalAddress>
</Address>
</AddressInformation>

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 14/99
3/5/2020
Scenario 2

In the case that there is no Addresses assigned to the Customer, additional Address Information is created containing information only about the email address, if it
exists. Customer Raw item looks like:

CustomerRawItem

customerId,name,email,billingAddressId,shippingAddressId,addresses
id1,John Doe,john.doe@email.com,,,

<AddressInformation actionCode="04"
addressUsageListCompleteTransmissionIndicator="true">
<Address emailListCompleteTransmissionIndicator="true"
facsimileListCompleteTransmissionIndicator="true"
postalAddressListCompleteTransmissionIndicator="true"
webListCompleteTransmissionIndicator="true"
organisationNameListCompleteTransmissionIndicator="true">
<Email actionCode="04"
eMailUsageListCompleteTransmissionIndicator="true">
<URI>john.doe@email.com</URI>
<EmailUsage actionCode="04">
<Usage>
<Code>AD_DEFAULT</Code>
</Usage>
</EmailUsage>
</Email>
</Address>
</AddressInformation>

Scenario 3

In the case that Customer email address is different than any of the Address email address, additional Address Information is created containing information only
about the email address. Customer and Address Raw items look like:

CustomerRawItem

customerId,name,email,billingAddressId,shippingAddressId,addresses
id1,John Doe,john.doe@email.com,A1,A2,"A1,A2"

AddressRawItem

addressId,town,country,postalCode,streetName,streetNumber,phone1,phone2,cellphone,fax,email,customerId
A1,MUNICH,DE,80636,Nymphenburgerstr.,86,089898989,,017676767676,,john.doe@sap.com,id1
A2,BERLIN,DE,10245,Berliner.,87,033333333,,017575757575,,john.doe@hybris.com,id1

<AddressInformation actionCode="04"
addressUsageListCompleteTransmissionIndicator="true">
<Address emailListCompleteTransmissionIndicator="true"
facsimileListCompleteTransmissionIndicator="true"
postalAddressListCompleteTransmissionIndicator="true"
webListCompleteTransmissionIndicator="true"
organisationNameListCompleteTransmissionIndicator="true">
<Email actionCode="04"
eMailUsageListCompleteTransmissionIndicator="true">
<URI>john.doe@email.com</URI>
<EmailUsage actionCode="04">
<Usage>
<Code>AD_DEFAULT</Code>
</Usage>
</EmailUsage>
</Email>
</Address>
</AddressInformation>
<AddressInformation actionCode="04"
addressUsageListCompleteTransmissionIndicator="true">
<AddressUsage actionCode="04">
<AddressUsageCode>BILL_TO</AddressUsageCode>
</AddressUsage>
<Address emailListCompleteTransmissionIndicator="true"
facsimileListCompleteTransmissionIndicator="true"
postalAddressListCompleteTransmissionIndicator="true"
webListCompleteTransmissionIndicator="true"
organisationNameListCompleteTransmissionIndicator="true">
<Email actionCode="04"
eMailUsageListCompleteTransmissionIndicator="true">
<URI>john.doe@sap.com</URI>
<EmailUsage actionCode="04">
<Usage>
<Code>AD_DEFAULT</Code>
</Usage>
</EmailUsage>
</Email>
<PostalAddress actionCode="04">
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 15/99
3/5/2020
<CountryCode>DE</CountryCode>
<CityName>MUNICH</CityName>
<StreetPostalCode>80636</StreetPostalCode>
<StreetName>Nymphenburgerstr.</StreetName>
<HouseID>86</HouseID>
</PostalAddress>
</Address>
</AddressInformation>
<AddressInformation actionCode="04"
addressUsageListCompleteTransmissionIndicator="true">
<AddressUsage actionCode="04">
<AddressUsageCode>XXDEFAULT</AddressUsageCode>
</AddressUsage>
<AddressUsage actionCode="04">
<AddressUsageCode>SHIP_TO</AddressUsageCode>
</AddressUsage>
<Address emailListCompleteTransmissionIndicator="true"
facsimileListCompleteTransmissionIndicator="true"
postalAddressListCompleteTransmissionIndicator="true"
webListCompleteTransmissionIndicator="true"
organisationNameListCompleteTransmissionIndicator="true">
<Email actionCode="04"
eMailUsageListCompleteTransmissionIndicator="true">
<URI>john.doe@hybris.com</URI>
<EmailUsage actionCode="04">
<Usage>
<Code>AD_DEFAULT</Code>
</Usage>
</EmailUsage>
</Email>
<PostalAddress actionCode="04">
<CountryCode>DE</CountryCode>
<CityName>BERLIN</CityName>
<StreetPostalCode>10245</StreetPostalCode>
<StreetName>Berliner.</StreetName>
<HouseID>87</HouseID>
</PostalAddress>
</Address>
</AddressInformation>

Populating Email when Email Address is Empty

Scenario 1: There are no physical addresses.

hybris Platform:
Customer1:
email: customer@hybris.com

C4C:
Customer1:
A0: <-- this is the empty AddressInformation tag.
email: customer@hybris.com

Scenario 2a: One or more physical addresses with email addresses.

hybris Platform:
Customer1:
email: customer@hybris.com
Address1:
email: customer_a1@hybris.com
city: MUC
Address2:
email: customer_a2@hybris.com
city: BER

C4C:
Customer1:
Address0: <-- this is empty AddressInformation tag.
email: customer@hybris.com
Address1:
city: MUC
email: customer_a1@hybris.com
Address2:
city: BER
email: customer_a2@hybris.com

Scenario 2b: One or more physical addresses with email addresses, with the customer email being present in at least one physical address.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 16/99
3/5/2020

hybris Platform:
Customer1:
email: customer@hybris.com
Address1:
email: customer@hybris.com
city: MUC
Address2:
email: customer_a2@hybris.com
city: BER

C4C:
Customer1:
Address1:
city: MUC
email: customer@hybris.com
Address2:
city: BER
email: customer_a2@hybris.com

Scenario 2c: One or more physical addresses with no email addresses.

hybris Platform:
Customer1:
email: customer@hybris.com
Address1:
email:
city: MUC
Address2:
email:
city: BER

C4C:
Customer1:
Address1:
city: MUC
email: customer@hybris.com
Address2:
city: BER
email: customer@hybris.com

Address: phone1, phone2, cellphone, fax

Platform Side

Four column mappings are added to y2ysync

Address:

phone1 -> phone1

phone2 -> phone2

cellphone -> cellphone

fax -> fax

Data Hub Side

Four attributes are added to AddressRawItem:

phone1

phone2

cellphone

fax

Three attributes are added to AddressCanonicalItem:

phones

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 17/99
3/5/2020
cellphone

fax

AddressPhonesCompositionHandler composition handler is added. The composition handler takes phone1 and phone 2 from AddressRawItem and creates a
comma-separated list in AddressCanonicalItem.phones, for example: 123456,789076. This composition handler is con gured in the following spring le: c4c-
integration-raw/src/main/resources/META-INF/c4c-integration-raw-datahub-extension-spring.xml.

Three attributes are added to AddressItem target item:

phones

cellphone

fax

For the c4c-soap-adater extension, these SAP Cloud for Customer tags are created out of the target items:

Number of <Telephone> tags depends on the quantity of items in AddressItem.phones:

<Telephone actionCode="04" telephoneUsageListCompleteTransmissionIndicator="true">


<Number>
<SubscriberID>08980808080</SubscriberID> <--- here comes the phone number
</Number>
<MobilePhoneNumberIndicator>false</MobilePhoneNumberIndicator> <-- it is NOT a cellphone
<TelephoneUsage actionCode="04">
<Usage>
<Code>AD_DEFAULT</Code> <-- static value added to the <Telephone> tag, used only for land line phones.
</Usage>
</TelephoneUsage>
</Telephone>

One or zero <Telephone> tag with MobilePhoneIndicator=true for the AddressItem.cellphone attribute

<Telephone actionCode="04" telephoneUsageListCompleteTransmissionIndicator="true">


<Number>
<SubscriberID>017660606060</SubscriberID> <--- here comes the cellphone number
</Number>
<MobilePhoneNumberIndicator>true</MobilePhoneNumberIndicator> <-- it IS a cellphone
<TelephoneUsage actionCode="04">
<Usage>
<Code>AD_MBDEFAU</Code> <-- static value added to the <Telephone> tag, used only for cellphones.
</Usage>
</TelephoneUsage>
</Telephone>

One or zero <Facsimile> tag for AddressItem.fax attribute

<Facsimile actionCode="04" facsimileUsageListCompleteTransmissionIndicator="true">


<Number>
<SubscriberID>08990909090</SubscriberID> <--- here comes the fax number
</Number>
<FacsimileUsage actionCode="04">
<Usage>
<Code>AD_DEFAULT</Code> <-- static value added to the <Facsimile> tag, used only for faxes.
</Usage>
</FacsimileUsage>
</Facsimile>

c4cquote Extension
The c4cquote extension sends quote data from SAP Commerce to C4C and vice versa.

The c4cquote extension provides the action, listener, helper, and contributors used to transfer quote data from the SAP Commerce to the datahubadapter
extension and vice versa. The datahubadapter extension is responsible for the communication between the SAP Commerce platform and Data Hub.

Dependencies
The c4cquote extension depends on the following extensions:

commerceservices

saporderexchange

b2bcommerce

Outbound Processing

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 18/99
3/5/2020
The outbound functions are split into the following parts:

C4CQuoteBuyerSubmitEvent is created when customer submits a quote in B2B storefront.

C4CQuoteBuyerSubmitEventListener is red when a quote is created in B2B storefront. The quote is saved in the database (DB) and then C4C
quote process is initiated.

C4CQuoteCancelEvent is created when customer cancels a quote in B2B storefront.

C4CQuoteCancelEventListener is red when a quote is canceled in B2B storefront. The quote is saved in the database (DB) and then C4C quote
cancel process is initiated.

C4CQuoteBuyerOrderPlacedEvent is created when customer accepts and creates order from a processed quote in B2B storefront.

C4CQuoteBuyerOrderPlacedEventListener is red when a quote is accepted and ordered in B2B storefront. The quote is saved in the database
(DB) and then C4C quote ordered process is initiated.

C4CCheckQuoteAction fetches the quote from the DB and initiate the process of sending QuoteModel to
DefaultSendQuoteToDataHubHelper.

<alias name="defaultC4CCheckQuoteAction" alias="c4cCheckQuoteAction"/>


<bean id="defaultC4CCheckQuoteAction"
class="de.hybris.platform.sap.c4c.quote.actions.C4CCheckQuoteAction"
parent="abstractAction">
<property name="quoteService" ref="quoteService" />
<property name="sendQuoteToDataHubHelper" ref="c4cSendQuoteToDataHubHelper" />
</bean>

CheckC4CQuoteIDAction fetches the quote from the DB and checks if C4C Quote ID is available in QuoteModel.

<alias name="defaultCheckC4CQuoteIDAction" alias="checkC4CQuoteIDAction"/>


<bean id="defaultCheckC4CQuoteIDAction"
class="de.hybris.platform.sap.c4c.quote.actions.CheckC4CQuoteIDAction"
parent="abstractAction">
<property name="quoteService" ref="quoteService" />
</bean>

SendQuoteToDataHubAction fetches the quote from the DB and initiates the process of sending QuoteModel to
DefaultSendQuoteToDataHubHelper.

<alias name="defaultSendQuoteToDatahubAction" alias="sendQuoteToDatahubAction"/>


<bean id="defaultSendQuoteToDatahubAction" class="de.hybris.platform.sap.c4c.quote.actions.SendQuoteToDatahubAction" paren
<property name="quoteService" ref="quoteService" />
<property name="sendQuoteToDataHubHelper" ref="c4cSendQuoteToDataHubHelper" />
</bean>

The orchestration of raw item creation and handover to Data Hub adapter is done by the SendToDataHubHelper interface implemented by
AbstractSendToDataHubHelper. For c4cquote outbound , AbstractSendToDataHubHelper is DefaultSendQuoteToDataHubHelper.

<alias name="c4cDefaultSendQuoteToDataHubHelper" alias="c4cSendQuoteToDataHubHelper" />


<bean id="c4cDefaultSendQuoteToDataHubHelper" class="de.hybris.platform.sap.c4c.quote.outbound.impl.Defaul
parent="sapAbstractSendToDataHubHelper">
<property name="feed" value="${c4cquote.quoteoutbound.datahub.feed}"></property>
<property name="rawItemBuilder" ref="c4cRawQuoteBuilder" />
<property name="rawItemType" value="${c4cquote.quoteoutbound.datahub.rawQuoteItemType}" />
</bean>

The creation of a Data Hub raw item is offered by the RawItemBuilder interface provided by saporderexchange extension. In the provided
implementation, this is implemented by AbstractRawItemBuilder. The AbstractRawItemBuilder is the super class of all raw item speci c
builders. For the c4cquote outbound, the AbstractRawItemBuilder is DefaultRawQuoteBuilder (which creates raw data for c4cquote
replication and c4cquote approval noti cation to the SAP back-end).

<alias name="defaultc4cRawQuoteBuilder" alias="c4cRawQuoteBuilder" />


<bean id="defaultc4cRawQuoteBuilder"
class="de.hybris.platform.sap.c4c.quote.outbound.impl.DefaultRawQuoteBuilder"
parent="sapAbstractRawItemBuilder">
<property name="contributors">
<list>
<ref bean="c4cQuoteContributor"></ref>
<ref bean="c4cQuotePartnerContributor"></ref>
<ref bean="c4cQuoteEntryContributor"></ref>

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 19/99
3/5/2020
<ref bean="c4cQuoteCommentContributor"></ref>
</list> </property>
</bean>

<alias name="defaultc4cRawQuoteApprovalBuilder" alias="c4cRawQuoteApprovalBuilder" />


<bean id="defaultc4cRawQuoteApprovalBuilder"
class="de.hybris.platform.sap.c4c.quote.outbound.impl.DefaultRawQuoteBuilder"
parent="sapAbstractRawItemBuilder">
<property name="contributors">
<list>
<ref bean="c4cQuoteApprovalContributor"></ref>
</list>
</property>
</bean>

The AbstractRawItemBuilder has a list of references to RawItemContributor instances. A RawItemContributor provides a speci c part of a
Data Hub raw item as a list of name and value pairs. The list of contributors to a raw item is injected via Spring into the corresponding raw item builder.
Following are the contributors for quote and quote approval noti cation:

DefaultQuoteContributor: Provides quote information.

DefaultQuoteEntryContributor: Provides item entry information of quote.

DefaultQuotePartnerContributor: Provides partner-related information (role and address).

DefaultQuoteCommentContributor: Provides comment information (mentioned by customer).

DefaultQuoteApprovalContributor: Provides quote information required for sending approval noti cation.

DefaultSapC4cSalesConditionContributor: Overrides DefaultSalesConditionContributor, provides price condition


information, when quote is accepted and order is placed.

The DefaultC4CQuoteService overrides existing submitQuote and cancelQuote functionality of DefaultCommerceQuoteService. The
submitQuote creates C4CQuoteBuyerSubmitEvent and cancelQuote creates C4CQuoteCancelEvent instead of default commerce events.

The C4CPlaceQuoteOrderMethodHook overrides afterPlaceOrder functionality of CommercePlaceQuoteOrderMethodHook. The


afterPlaceOrder method creates C4CQuoteBuyerOrderPlacedEvent when order is placed from a quote.

The DefaultC4cCommerceCartCalculationStrategy overrides calculateCart functionality of


DefaultCommerceCartCalculationStrategy. The calculateCart method skips recalculation if quote is processed from C4C.

Inbound Processing
The inbound functions are split into the following parts:

Updated quote is replicated to SAP Commerce from C4C . CSVCellDecorator is used to update the CSV input of c4cquote from Data Hub. For
C4Cquote, following cell decorators are used.

QuoteCommentCellDecorator: This decorator fetches the comment row from the ImpEx and creates header comment for an existing quote.

QuoteVersionCellDecorator: This decorator adds the quote version to the quote. Version 1 is added if the quote does not exist, otherwise
incremental quote version is used.

QuoteVersionResolutionCellDecorator: This decorator adds the quote version to the quote entry.

UpdateQuoteCellDecorator: This decorator adds the latest quote version while updating the quote.

PreviousQuoteCommentCellDecorator: This decorator fetches comments information from previous quote version for a quote.

QuoteConfirmationVersionCellDecorator: This decorator is used for creating a snapshot of quote and returns version of created quote.

QuoteEntryNumberCellDecorator: This decorator is used for adding leading zeros if required in quote code.

QuoteEntryProductCellDecorator: This decorator is used for resolving product catalog.

QuoteEntryResolutionCellDecorator: This decorator is used for decorating order entry information.

QuoteGuidCellDecorator: This decorator is used for setting the GUID of the quote from previous quote version.

QuoteNameCellDecorator: This decorator is used for setting the name of the quote coming from C4C.

QuotePkCellDecorator: This decorator is used for returning quote primary key (PK).

QuotePreviousEstimatedTotalDecorator: This decorator is used for decorating the quote previous estimated totals.

Helpers are used by CSVCellDecorators for interacting with services to get data from the database. For C4C, the following helpers are used.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 20/99
3/5/2020
InboundQuoteVersionControlHelper: To get quote details such as version.

InboundQuoteCommentConversionHelper: To update comment.

InboundQuoteHelper: For basic operations related to quote.

InboundQuoteStateHelper: For getting state for code of quote.

C4CQuoteBuyerSubmitEventListener is red when a buyer accepts the quote and an order is created. This listener updates the status of the quote.

sapc4ccustomerb2c Extension
The sapc4ccustomerb2c extension automatically replicates B2C customer data to SAP Cloud Platform Integration when customers register in the online store.

 Note
You can preferably, use outboundsync cron jobs to schedule automatic replication of customer data. If you choose to implement this method, ensure that the
ag sapc4ccustomerb2c.customer.cpi.replicate is set to false. This disables the method documented below and avoids con ict. See Con gure
SAP Commerce Backoffice.

Replicating the Customer

Registering a New Customer

When a customer registers in the online store, a registration event is caught, and the sapC4cPublishProcess business process is started in the
sapC4cCustomerRegistrationEventListener to control the data transfer.

The de nition is as follows:

<alias alias="sapC4cCustomerRegistrationEventListener" name="defaultSapC4cCustomerRegistrationEventListener" />


<bean id="defaultSapC4cCustomerRegistrationEventListener" parent="abstractEventListener"
class="com.sap.hybris.c4c.customer.listener.SapC4cCustomerRegistrationEventListener">
<property name="modelService" ref="modelService" />
<property name="baseStoreService" ref="baseStoreService" />
<property name="businessProcessService" ref="businessProcessService" />
</bean>

While starting a new business process, you must de ne it. This allows you to manage the process in Backoffice by checking the status or re-sending the data.

The business process with Action is de ned as follows:

<alias alias="sapC4cCustomerRegisterProcess" name="defaultSapC4cCustomerRegisterProcess" />


<bean id="defaultSapC4cCustomerRegisterProcess"
class="de.hybris.platform.processengine.definition.ProcessDefinitionResource">
<property name="resource" value="classpath:/process/c4c-customer-process.xml" />
</bean>

<alias alias="c4cCustomerPublishAction" name="defaultC4cCustomerPublishAction" />


<bean id="defaultC4cCustomerPublishAction"
class="com.sap.hybris.c4c.customer.action.SapC4cCustomerPublishAction"
parent="abstractAction">
<property name="c4cCustomerPublicationService" ref="sapC4cCustomerPublicationService" />
<property name="customerUtil" ref="sapC4cCustomerUtils" />
</bean>

Updating the Customer

To allow customers to change their own data, two interceptors send the changed data to publication service which further sends it to SAP Cloud Platform
Integration: one for the customer update, and another for the address create, update and delete.

The interceptors are registered as follows:

<bean id="sapC4cCustomerInterceptorMapping"
class="de.hybris.platform.servicelayer.interceptor.impl.InterceptorMapping">
<property name="interceptor" ref="sapC4cCustomerInterceptor" />
<property name="typeCode" value="Customer" />
<property name="order" value="5000" />

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 21/99
3/5/2020
</bean>

<alias alias="sapC4cCustomerInterceptor" name="defaultSapC4cCustomerInterceptor" />


<bean id="defaultSapC4cCustomerInterceptor"
class="com.sap.hybris.c4c.customer.interceptor.DefaultSapC4cCustomerInterceptor">
<property name="eventService" ref="eventService" />
<property name="customerUtil" ref="sapC4cCustomerUtils" />
</bean>

<bean id="sapC4cAddressInterceptorMapping"
class="de.hybris.platform.servicelayer.interceptor.impl.InterceptorMapping">
<property name="interceptor" ref="sapC4cAddressInterceptor" />
<property name="typeCode" value="Address" />
<property name="order" value="5000" />
</bean>

<alias alias="sapC4cAddressInterceptor" name="defaultSapC4cAddressInterceptor" />


<bean id="defaultSapC4cAddressInterceptor"
class="com.sap.hybris.c4c.customer.interceptor.DefaultSapC4cAddressInterceptor">
<property name="eventService" ref="eventService" />
<property name="customerUtil" ref="sapC4cCustomerUtils" />
</bean>

The customer interceptor is called after a customer attribute is changed. This interceptor checks the following:

Whether a replication-relevant eld of the customer has changed

If criteria is ful lled, the customer and all customer addresses are replicated.

The address interceptor is called after any change in customer’s addresses. This interceptor checks the following:

Whether the address is a new address

Whether a relevant address eld has changed

Whether the address is deleted

If all three criteria are ful lled, the customer and all customer addresses are replicated.

The data is sent to SAP Cloud Platform Integration in JSON format. The following Data Transfer Objects are created for generating JSON data:

C4CCustomerData

C4CHeaderData

C4CAddressData

C4CAddressPhoneData

If there are any changes in customer and address, both interceptors create C4CCustomerData object with the help of two populators and triggers
SapC4cCustomerUpdateEvent event. The SapC4cCustomerUpdateEventListener handles update events created and sends to the publication
service.

The populators and a utility class are de ned as follows:

<alias alias="sapC4cCustomerPopulator" name="defaultSapC4cCustomerPopulator" />


<bean id="defaultSapC4cCustomerPopulator"
class="com.sap.hybris.c4c.customer.populator.DefaultSapC4cCustomerPopulator">
<property name="customerNameStrategy" ref="customerNameStrategy" />
<property name="configurationService" ref="configurationService" />
</bean>

<alias alias="sapC4cAddressPopulator" name="defaultSapC4cAddressPopulator" />


<bean id="defaultSapC4cAddressPopulator"
class="com.sap.hybris.c4c.customer.populator.DefaultSapC4cAddressPopulator">
<property name="configurationService" ref="configurationService" />
</bean>

<alias alias="sapC4cCustomerUtils" name="defaultSapC4cCustomerUtils" />


<bean id="defaultSapC4cCustomerUtils"

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 22/99
3/5/2020
class="com.sap.hybris.c4c.customer.util.SapC4cCustomerUtils">
<property name="addressPopulator" ref="sapC4cAddressPopulator" />
<property name="customerPopulator" ref="sapC4cCustomerPopulator" />
<property name="configurationService" ref="configurationService" />
</bean>

The SapC4cCustomerUpdateEventListener is de ned as follows:

<alias alias="sapC4cCustomerUpdateEventListener" name="defaultSapC4cCustomerUpdateEventListener" />


<bean id="defaultSapC4cCustomerUpdateEventListener" parent="abstractEventListener"
class="com.sap.hybris.c4c.customer.listener.SapC4cCustomerUpdateEventListener">
<property name="c4cCustomerPublicationService" ref="sapC4cCustomerPublicationService" />
</bean>

The publication service is de ned as follows:

<alias alias="sapC4cCustomerPublicationService" name="defaultSapC4cCustomerPublicationService" />


<bean id="defaultSapC4cCustomerPublicationService"
class="com.sap.hybris.c4c.customer.service.impl.DefaultSapC4cCustomerPublicationService">
<property name="cloudPlatformIntegrationConnection" ref="cloudPlatformIntegrationConnection" />
<property name="configurationService" ref="configurationService" />
</bean>

Con guration
For more information on con gurations, see Integration Using SAP Cloud Platform Integration.

customerticketingc4cb2bintegration Extension
The customerticketingc4cb2bintegration extension allows to expose the functionality of the Customer Ticketing Module's C4C integration to the B2B
Accelerator.

 Note
An SAP Commerce extension may provide functionality that is licensed through different SAP Commerce modules. Make sure to limit your implementation to
the features de ned in your contract license. In case of doubt, please contact your sales representative.

General
The customerticketingc4cb2bintegration extension contains only one element - the Y2C4CB2BTicketPopulator class. When the
customerticketingc4cb2bintegration extension is present in the localextensions.xml le, the system adds the Y2C4CB2BTicketPopulator
to the list of populators.

The populator Spring bean is de ned in the /customerticketingc4cb2bintegration/resources/customerticketingc4cb2bintegration-


spring.xml le. Adding the populator to the populator list causes the Y2C4CB2BTicketPopulator to be called after the Y2C4CTicketPopulator,
allowing to properly map hybris elds to C4C elds.

Populators and Data Transfer Objects


The SAP Commerce customerticketingc4cb2bintegration extension contains the following populator:

Name Description

Y2C4CB2BTicketPopulator <SOURCE extends TicketData, TARGET This populator is used for populating the ServiceRequestData objects with
extends ServiceRequestData> information upon sending requests to the C4C system:

C4C Object Field SAP Commerce Object Field

ExternalContactID customerId

ExternalCustomerID businessUnitId

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 23/99
3/5/2020

project.properties
Property Description

customerticketingc4cb2bintegration.siteId.{siteid} A unique ID necessary for the C4C integration.

 Note
Site ID as present in your hosts le, for example:

customerticketingc4cintegration.siteId.electronics

customerticketingc4cintegration.siteId.powertools

customerticketingc4cb2bintegration.siteId.{siteid}.type Type of the storefront, either b2c or b2b, for example:


customerticketingc4cintegration.siteId.electronics.b2c.

 Note
Type

Depending whether a storefront is b2c or b2b, different parameters are sent to the
C4C system.

Type Parameters Sent

b2c
customerId

b2b
businessUnit

customerId

For more information about the different properties used to integrate SAP Commerce with the C4C system, see customerticketingc4cintegration Extension.

Related Information
customerticketingc4cintegration Extension
customerticketingfacades Extension
http://help.sap.com/cloud4customer
customerticketingaddon AddOn

customerticketingc4cintegration Extension
The customerticketingc4cintegration extension allows for the integration of Customer Ticketing System with the SAP Cloud for Customer system.

 Note
An SAP Commerce extension may provide functionality that is licensed through different SAP Commerce modules. Make sure to limit your implementation to
the features de ned in your contract license. In case of doubt, please contact your sales representative.

Prerequisites

URL
For all the REST calls described in this section, use the following URL pattern: https://{<HOSTNAME}>:
{<PORT}>/sap/byd/odata/v1/yserviceticket/ServiceTicketCollection, for example: https://{HOSTNAME}:
{PORT}/sap/byd/odata/v1/yserviceticket/ServiceTicketCollection

 Note
In this document, the REST call URLs are provided starting from the /yserviceticket/ section of the entire URL. Make sure to modify the URL in your REST
client.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 24/99
3/5/2020

REST Headers
Before invoking the REST APIs you need to provide proper HTTP header parameters. The following table describes the parameter names and the values associated
to them.

 Note
All header parameters have static values with the exception of the x-csrf-token parameter, which has a dynamic value. For information on how to con gure
headers, see the Con guring Headers section of this document.

Header Parameter Name Header Parameter Value Comments

x-csrf-token The x-csrf-token returned from an initial REST call. In order to nd out how to obtain this token, see the x-
csrf-token section of this document.

 Note
Even though the token may be valid for some period
of time, it is advisable to issue a GET request fetching
the token prior to sending create/display/update
requests.

c4c-odata-businessSystemID The c4c-odata-businessSystemID header is a


logical identi er for an external system in SAP Cloud for
Customer. The solution can exchange data with different
systems and it identi es these systems using this
header. External systems are created as communication
systems in SAP Cloud for Customer and are assigned
logical IDs (BusinessSystemID). Each message
exchange with the external system carries this
BusinessSystemID for SAP Cloud for Customer to
identify which external system is involved in the
message exchange.

The c4c-odata-businessSystemID header may be


any alphanumeric string, 1-32 characters long, for
example: Q5ECLNT004 (SAP system with ID Q5E and
tenant 004)

Basic Authentication Your username/Your password

set-cookie sap-usercontext
 Note
This header is returned as a part of the response to
the initial REST call.

These headers are used to authenticate further calls.


Use the values returned from the initial REST call.

set-cookie SAP_SESSIONID_<<host>>_<<tenant>>

Accept Application/json This parameter is case sensitive.

Content-Type Application/json This parameter is case sensitive.

x-csrf-token
To obtain the x-csrf-token, do the following:

1. Send a GET request to the following URL: /yserviceticket/ServiceTicketCollection?$top=1. Make sure to include the following header:

Header Parameter Name Header Parameter Value

x-csrf-token fetch

2. In the response header, locate the following entry:

x-csrf-token:YourToken

That is your token. Make sure that is it included in the header of the remaining REST calls present in this document.

Con guring Headers


https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 25/99
3/5/2020
You can con gure the REST calls using the properties found in the project.properties le:

customerticketingc4cintegration.c4c-url=https://{HOSTNAME}:{PORT}/sap/byd/odata/v1/yserviceticket/ServiceTicketCollection
customerticketingc4cintegration.c4c-token-url-suffix=?$top=1
customerticketingc4cintegration.c4c-accept=Application/json
customerticketingc4cintegration.c4c-username-naming=Username
customerticketingc4cintegration.c4c-password-naming=Password
customerticketingc4cintegration.c4c-username=YOUR_USERNAME
customerticketingc4cintegration.c4c-password=YOUR_PASSWORD
customerticketingc4cintegration.c4c-token-naming=x-csrf-token
customerticketingc4cintegration.c4c-site-header=c4c-odata-businessSystemID
customerticketingc4cintegration.c4c-token-empty=fetch
customerticketingc4cintegration.c4c-expand-suffix=$expand=Notes,RelatedTransactions
customerticketingc4cintegration.c4c-update-message-suffix=/ServiceRequestTextCollection

For more information on the properties, see the project.properties section below.

project.properties
The following table provides a description of each property:

Property Description

customerticketingc4cintegration.c4c-accept Value of the Accept header

customerticketingc4cintegration.c4c-password Value of the Basic Authentication header - Password

customerticketingc4cintegration.c4c-token-empty Value of the x-csrf-token header

customerticketingc4cintegration.c4c-token-naming Name of the x-csrf-token header

customerticketingc4cintegration.c4c-token-url-suffix String used to generate the token.

 Note
Default Value

?$top=1

customerticketingc4cintegration.c4c-url URL to the SAP Cloud for Customer REST service, for example:
https://somehostname/sap/byd/odata/v1/yserviceticket

 Note
C4C-speci c Information

For more C4C-related technical information about your integration, contact an SAP
representative.

customerticketingc4cintegration.c4c-username Value of the Basic Authentication header - User Name

customerticketingc4cintegration.c4c-username-naming Username header name in SAP Cloud for Customer

customerticketingc4cintegration.c4c-password-naming Password header name in SAP Cloud for Customer

customerticketingc4cintegration.c4c-update-message-suffix Suffix of the update ticket message REST call.

 Note
Default Value

/ServiceRequestTextCollection

customerticketingc4cintegration.c4c-expand-suffix Suffix used to construct an URL to the SAP Cloud for Customer server.

 Note
Default Value

$expand=Notes,RelatedTransactions

customerticketingc4cintegration.siteId.{siteid} A unique ID necessary for the SAP Cloud for Customer integration.

 Note
Site ID as present in your hosts le, for example:

customerticketingc4cintegration.siteId.electronics

customerticketingc4cintegration.siteId.powertools

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 26/99
3/5/2020

Property Description

customerticketingc4cintegration.siteId.{siteid}.type Type of the storefront, either b2c or b2b, for example:


customerticketingc4cintegration.siteId.electronics.b2c.

 Note
Type

Depending whether a storefront is b2c or b2b, different parameters are sent to the
SAP Cloud for Customer solution.

Type Parameters Sent

b2c
customerId

b2b
businessUnit

customerId

customerticketingc4cintegration.c4c-batch-suffix The URL used to send the batch calls to.

 Note
Default Value

/$batch

customerticketingc4cintegration.c4c-ticket-suffix Suffix used to construct an ticket-related call to the SAP Cloud for Customer server.

 Note
Default Value

/ServiceTicketCollection

http.proxy.host Proxy host name. This property is optional.

http.proxy.port Proxy port number. This property is optional.

customerticketingc4cintegration.displayname The value of of the created-by eld of a Note object.

 Note
Note that in order for these properties to be used, you need to copy them to the local.properties le.

Data Transfer Objects

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 27/99
3/5/2020

Populators
The following table describes the populators:

Name Description

C4C2YTicketPopulator<SOURCE extends ServiceRequestData, TARGET Part of the ticketConverter Spring bean used to map data elds from an SAP
extends TicketData> ServiceRequestData object to an SAP Commerce TicketData object. For more
information on the mappings, see the C4C - SAP Commerce Object Parameter
Mappings section below.

Y2C4CTicketPopulator<SOURCE extends TicketData, TARGET extends Part of the c4cTicketConverter Spring bean used to map data elds from an SAP
ServiceRequestData> Commerce TicketData object to an SAP ServiceRequestData object. For more
information on the mappings, see the SAP Cloud for Customer - SAP Commerce
Object Parameter Mappings section below.

Y2TicketMessageUpdatePopulator <SOURCE extends TicketData, Part of the messageUpdatePopulator Spring bean used to convert a
TARGET extends ServiceRequestTextData> hybrisDataObject (TicketData) to a TicketMessageUpdateRequest object
(Note).

C4CCustomerPopulator Part of the c4cCustomerPopulator Spring bean used to populate the


customerId eld of the CustomerData object.

C4C2YTicketEventsPopulator Part of the c4cTicketEventPopulator Spring bean used to populate the elds of
SAP Commerce ticket objects.

SAP Cloud for Customer - SAP Commerce Object Parameter Mappings

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 28/99
3/5/2020

SAP Cloud for Customer ServiceRequestData Object Parameter SAP Commerce C4CTicketData Object Parameter

ExternalCustomerID customerId

 Note
This parameter is passed in b2c calls.

ExternalContactId customerId

 Note
This parameter is passed in b2b calls.

ExternalCustomerId businessUnitId

 Note
This parameter is only passed in b2b calls.

Name subject

ObjectID id

StatusCode statusId

CreationDateTime creationDate

LastChangeDateTime lastModi cationDate

Note messageHistory

 Note
Upon retrieving a ticket from SAP Cloud for Customer, all notes are concatenated
into a message history.

RelatedTransaction.Id cartId

Facades
There are two facades implemented in the customerticketingc4cintegration extension. You can choose to use a mock implementation of the SAP Cloud
for Customer ticket facade, or the integration facade which sends actual calls to SAP Cloud for Customer. You can con gure which facade to use by changing the
value of the customerticketingc4cintegration.facade.mock property. Setting this property to true results in using the mock implementation and
setting it to false results in using the SAP Cloud for Customer integration facade.

 Note
If no customerticketingc4cintegration.facade.mock property is found in the local.properties le, the getTicketFacade() method of
the TicketFacadeFactory class returns the mock implementation as the default facade.

C4CTicketFacadeImpl
This class overrides all the methods from the TicketFacade interface. For more information on the interface, see customerticketingfacades Extension. This class
is responsible for the actual communication with the SAP C4C system. For more information on the calls to SAP Cloud for Customer, see the SAP Cloud for
Customer Request and Response Templates section of this document.

C4CTicketFacadeMock
This class also overrides all the methods from the TicketFacade interface, but unlike the C4CTicketFacadeImpl, this class does not communicate with the
SAP Cloud for Customer. Instead, the C4CTicketFacadeMock class returns mock data taken from the following les located in the
resources/customerticketingc4cintegration/c4cjson/response directory:

create.json

details.json

listing.json

update.json

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 29/99
3/5/2020
Upon calling any of the methods relating to operations on tickets, the data taken from the les above is converted from JSON to TicketData objects understood
by SAP Commerce.

Available Status Transitions for an SAP Cloud for Customer CS Agent


Current Status Reachable Statuses

Open (1) In Process (2) or Completed (5)

In Process (2) Completed (5)

Completed (5) In Process (2) or Closed (6)

Closed (6) NONE

Available Status Transitions for an SAP Commerce Customer


Current Status Reachable Statuses

Open (1) Completed (5)

In Process (2) Completed (5)

Completed (5) Open (1)

SAP Cloud for Customer Request and Response Templates


In order for SAP Cloud for Customer to understand SAP Commerce requests, they must follow a pattern. Below, you can nd the examples of requests and
responses for each method of the TicketFacade interface. For more information, see customerticketingfacades Extension.

 Note
Make sure to send the REST calls to the proper URLs and with the proper headers. For more information, see the Prerequisites section of this document.

createTicket()

Request Body
URL: /yserviceticket/ServiceTicketCollection

HTTP Method: POST

{
"ExternalCustomerID": "RK1",
"ExternalContactID":"RKCONT1",// only in b2b case
"Name": "Test Ticket Name",
"RelatedTransactions": [{
"ID": "1111111111111111",
"TypeCode": "2085",
"RoleCode" : "1",
"BusinessSystemID": "HYBRISINT"
}],
"Notes": [{
"LanguageCode": "EN",
"Text": "Test Ticket Message",
"TypeCode": "10004"
}]
}

Response Body
{"d": { "results": {
...
"CreationDateTime": "\/Date(1436955740981)\/",
"CustomerID": "1170962",
"DataOriginTypeCode": "4",
"ExternalContactID": "",
"ExternalCustomerID": "",

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 30/99
3/5/2020
"ID": "2364",
"LastChangeDateTime": "\/Date(1436955740981)\/",
"Name": "Test Tikcet Name",
"ObjectID": "00163E0830221EE58ADB6B677EFC3606",
"StatusCode": "1",
"Notes": {
"__deferred": {
"uri": "https://{HOSTNAME}:{PORT}/sap/byd/odata/v1/yserviceticket/ServiceTicketCollection('00163E0830221EE58ADB6B677EFC3606
}
},
"RelatedTransactions": {
"__deferred": {
"uri": "https://{HOSTNAME}:{PORT}/sap/byd/odata/v1/yserviceticket/ServiceTicketCollection('00163E0830221EE58ADB6B677EFC3606
}
}
}
}
}

getTickets()

Request Body
URL: /yserviceticket/ServiceTicketCollection?
$filter=ExternalCustomerID%20eq%20%27755557%27&$orderby=CreationDateTime%20desc&$expand=Notes,RelatedTransactions

 Note
In case of b2b, you need to use the ExternalContactId parameter instead of the ExternalCustomerID parameter.

HTTP Method: GET

No request body.

Response Body
{"d":{"results":[
{ ...
"Name": "Test Ticket Name",
"StatusCode": "3",
"Notes": [{
"__metadata": {
"uri": "https://{HOSTNAME}:{PORT}/sap/byd/odata/v1/yserviceticket/NotesCollection('00163E0830221EE58AC45220B97DC396')",
"type": "yserviceTICKET.Notes"
},
"AuthorName": "",
"AuthorUUID": null,
"CreatedBy": "User",
"CreatedOn": "\/Date(1436876366737)\/",
"LanguageCode": "",
"LastUpdatedBy": "User",
"ObjectID": "00163E0830221EE58AC45220B97DC396",
"ParentObjectID": "00163E0830221EE58AC451D9FFA1E396",
"ServiceRequestExternalKey": "",
"Text": "Creation description 20150714_03",
"TypeCode": "10004",
"UpdatedOn": "\/Date(1436876366737)\/"
}]
}
]}}

 Note
Order

The returned results are ordered by the CreationDate parameter.

getTicket()

Request Body
URL: /yserviceticket/ServiceTicketCollection?
$filter=ExternalCustomerID%20eq%20%27755557%27&$ObjectID%20eq%20%2700163E0D020A1EE584B874CA135B1FA8%27&

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 31/99
3/5/2020
$expand=Notes,RelatedTransactions

 Note
In case of b2b, you need to use the ExternalContactId parameter instead of the ExternalCustomerID parameter.

The 00163E0D020A1EE584B874CA135B1FA8 string is the ID of the ticket you want to display the details of.

This is an ObjectID parameter and is returned in the response body of the create ticket request.

HTTP Method: GET

No request body.

Response Body
{
"d": {
"results": [{
.......
"CreationDateTime": "\/Date(1436876366737)\/",
"CustomerID": "1170962",
"DataOriginTypeCode": "4",
"ExternalContactID": "",
"ExternalCustomerID": "",
"ExternalKey": "",
"ID": "2363",
"IncidentCategoryID": "",
"LastChangeDateTime": "\/Date(1436881502537)\/",
"Name": "Test By Rakesh 20150714_03",
"ObjectID": "00163E0830221EE58AC451D9FFA1E396",
"StatusCode": "2",
"Notes": [{
{
..............
"CreatedBy": "User",
"CreatedOn": "\/Date(1436881502537)\/",
"LanguageCode": "",
"LastUpdatedBy": "User",
"ObjectID": "00163E0B52E21ED58AC5D0DA9132ACEE",
"ParentObjectID": "00163E0830221EE58AC451D9FFA1E396",
"ServiceRequestExternalKey": "",
"Text": "Test Ticket Update Message to status completed",
"TypeCode": "10008",
"UpdatedOn": "\/Date(1436881502537)\/"
}],
"RelatedTransactions": [{
.........
"BusinessSystemID": "HYBRISINT",
"ExternalKey": "",
"ID": "201507143",
"ObjectID": "00163E0830221EE58AC45220B97B2396",
"ParentObjectID": "00163E0830221EE58AC451D9FFA1E396",
"RoleCode": "1",
"TypeCode": "2085",
"ServiceTicket": {
"__deferred": {
"uri": "https://{HOSTNAME}:{PORT}/sap/byd/odata/v1/yserviceticket/RelatedTransactionsCollection('00163E0830221EE58AC45220B
}
}
}]
}]
}
}

updateTicket()

Request Body
URL: /yserviceticket/$batch

A batch call updates the message and the status at the same time.

HTTP Method: POST

--batch_123
Content-Type: multipart/mixed; boundary=changeset_456
--changeset_456

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 32/99
3/5/2020
Content-Type: application/http
Content-Transfer-Encoding: binary
POST ServiceTicketCollection('00163E060DF91EE587E5362B1E006DD8')/Notes HTTP/1.1
Content-Type: application/json
Content-ID: SRQ_TXT_ID
Content-Length: 10000
{
"LanguageCode": "EN",
"ParentObjectID": "00163E060DF91EE587E5362B1E006DD8",
"Text": "Test Ticket Update Message",
"TypeCode": "10007"
}

--changeset_456
Content-Type: application/http
Content-Transfer-Encoding: binary

PATCH ServiceTicketCollection('00163E060DF91EE587E5362B1E006DD8') HTTP/1.1


Content-Type: application/json
Content-ID: SRQ_ID
Content-Length: 10000

{
"StatusCode": "5"
}

--changeset_456--
--batch_123--

Response Body
--ejjeeffe0
Content-Type: multipart/mixed; boundary=ejjeeffe1
Content-Length: 1851

--ejjeeffe1
Content-Type: application/http
Content-Length: 879
Content-Transfer-Encoding: binary

HTTP/1.1 201 Created


Content-Type: application/json
Content-Length: 607
location: https://{HOSTNAME}:{PORT}/sap/byd/odata/v1/yserviceticket/NotesCollection('00163E0B52E21EE58AF7C3ADEB0CBB02')
dataserviceversion: 2.0
cache-control: no-cache, no-store

--ejjeeffe1
Content-Type: application/http
Content-Length: 747
Content-Transfer-Encoding: binary

HTTP/1.1 204 No Content


Content-Type: application/json
Content-Length: 607
dataserviceversion: 2.0
cache-control: no-cache, no-store

--ejjeeffe1--

--ejjeeffe0--

c4c-integration Data Hub Extensions


The c4c-integration Data Hub extensions integrate customer data from the Commerce Platform to the SAP Cloud for Customer system via Data Hub.

General
To integrate data between Commerce Platform and SAP Cloud for Customer via Data Hub, the following extensions and module are created:

c4ccustomer Extension

Handles Commerce Platform data that is sent to Data Hub.

c4cquote Extension

Sends quote data from SAP Commerce to C4C.

SAP Cloud for Customer integration:

c4c-integration-raw Extension

Models data and passes it to the c4c-integration-canonical extension.


https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 33/99
3/5/2020
c4c-integration-canonical Extension

Receives data from the c4c-integration-raw extension. The extension is used to have a data representation that is independent from source systems
and target systems.

c4c-integration-target Extension

Holds customer information that is transmitted to the SAP Cloud for Customer.

c4c-integration-soap-adapter Extension

Creates a soap request that can be processed by the SAP Cloud for Customer.

c4c-integration-soap-schema Extension

Compiles the C4C generated WSDL le and produces JAXB classes that can be used by other extensions.

sapsoapinboundadapter Data Hub Extension

Provides a Spring integration end point to receive SOAP XMLs from any external system. It also provides the Spring integration ow de nition to route
incoming SOAP XML to raw models in Data Hub.

c4cquote Data Hub Extensions

Provides the integration content to connect a SAP Commerce core installation with an SAP C4C system for quote ful llment.

c4cquote-soap-schema Extension

Compiles the C4C generated WSDL le and produces JAXB classes that can be used by other extensions.

c4cquote-soap-adapter Extension

Creates a quote SOAP request that can be processed by SAP Cloud for Customer.

The c4c-integration module ships with a c4c-endpoint mock-webapp that can be used for local testing and development.

 Note
It is required to con gure a Data Hub user account as most of requests need authorization. For more information about how to con gure a user account, see the
Securing Your Data Hub Application document.

Related Information
SAP Framework Core Module
Data Hub
Preparing Data Hub for a Production Environment
Synchronization Between SAP Commerce Installations

c4c-integration-raw Extension
The c4c-integration-raw extension holds customer information.

 Note
An SAP Commerce extension may provide functionality that is licensed through different SAP Commerce modules. Make sure to limit your implementation to
the features de ned in your contract license. In case of doubt, please contact your sales representative.

 Note
Make sure that:

1. The user is con gured as described in the Application Security document.

2. The publication is con gured as described in the The PartyResolvingStrategy section of the c4c-integration-soap-adapter Extension document.

General
The c4c-integration-raw models information that comes from the source systems, in this case Commerce Platform. The following Raw Items are de ned:

CustomerRawItem

AddressRawItem

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 34/99
3/5/2020

The Items are de ned in the following way:

<extension xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.hybris.com/schema/"


xsi:schemaLocation="http://www.hybris.com/schema/datahub-metadata-schema-1.1.1.xsd" name="c4c-integration-raw">
<rawItems>
<item>
<type>CustomerRawItem</type></extension>
<attributes>
... attributes ...
</attributes>
</item>
<item>
<type>AddressRawItem</type></extension>
<attributes>
... attributes ...
</attributes>
</item>
</rawItems>
</extension>

Dependency with c4c-integration-canonical Extension


There is a dependency with c4c-integration-canonical extension because a mapping between Raw Items and Canonical Items is de ned inside the same
le. For more information about c4c-integration-canonical extension, see the c4c-integration-canonical Extension page.

Dependency de nition

<extension xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.hybris.com/schema/"


xsi:schemaLocation="http://www.hybris.com/schema/datahub-metadata-schema-1.1.1.xsd" name="c4c-integration-raw">

<dependencies>
<dependency>
<extension>c4c-integration-canonical</extension>
</dependency>
</dependencies>

... rest of definitions...


</extension>

Mapping de nition

<extension xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.hybris.com/schema/"


xsi:schemaLocation="http://www.hybris.com/schema/datahub-metadata-schema-1.1.1.xsd" name="c4c-integration-raw">

<dependencies>
... dependencies between datahub extensions ...
</dependencies>

<rawItems>
<item>
<type>CustomerRawItem</type></extension>
<attributes>
... attributes ...
</attributes>
</item>
<item>
<type>AddressRawItem</type></extension>
<attributes>
... attributes ...
</attributes>
</item>
</rawItems>

<canonicalItems>
<item>
<type>CanonicalParty</type>
<attributes>
<attribute>
<name>partyId</name>
<transformations>
<transformation>
<rawSource>CustomerRawItem</rawSource>

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 35/99
3/5/2020
<expression>customerId</expression>
</transformation>
</transformations>
</attribute>
... more attributes ...
</attributes>
</item>
<item>
<type>CanonicalAddress</type>
<attributes>
<attribute>
<name>addressId</name>
<transformations>
<transformation>
<rawSource>AddressRawItem</rawSource>
<expression>addressId</expression>
</transformation>
</transformations>
</attribute>
... more attributes ...
</attributes>
</item>
<item>
<type>CanonicalPartyAddress</type>
<attributes>
<attribute>
<name>partyId</name>
<transformations>
<transformation>
<rawSource>AddressRawItem</rawSource>
<expression>customerId</expression>
</transformation>
</transformations>
</attribute>
<attribute>
<name>addressId</name>
<transformations>
<transformation>
<rawSource>AddressRawItem</rawSource>
<expression>addressId</expression>
</transformation>
</transformations>
</attribute>
</attributes>
</item>
</canonicalItems>
</extension>

Adding this extension in a Data Hub environment creates some interfaces that allows to query for either CustomerRawItem or AddressRawItem.

Checking the Attributes De ned for CustomerRawItem and AddressRawItem

GET: http://localhost:8080/datahub-webap/v1/item-classes/raw/item-types/CustomerRawItem/attributes

GET: http://localhost:8080/datahub-webap/v1/item-classes/raw/item-types/AddressRawItem/attributes

Checking Already Uploaded Raw Items

GET: http://localhost:8080/datahub-webap/v1/pools/C4CCUSTOMER_POOL/items/CustomerRawItem

GET: http://localhost:8080/datahub-webap/v1/pools/C4CCUSTOMER_POOL/items/AddressRawItem

Uploading Data

POST: http://localhost:8080/datahub-webap/v1/data-feeds/C4CCUSTOMER_FEED/items/CustomerRawItem

Sample data format:

customerId,name,email
c1,John Doe,john_doe@email.com

POST: http://localhost:8080/datahub-webap/v1/data-feeds/C4CCUSTOMER_FEED/items/AddressRawItem

Sample data format:

addressId,town,country,postalCode,streetName,streetNumber,customerId
A1,MUNICH,DE,80636,Nymphenburger-Str.,86,c1

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 36/99
3/5/2020
A2,BERLIN,DE,10245,Strasse,78,c1

Related Information
c4c-integration-canonical Extension
c4c-integration-target Extension
c4c-integration-soap-adapter Extension
Data Hub
y2ySync Extension - Technical Guide
c4c-integration Mapping

c4c-integration-canonical Extension
The c4c-integration-canonical extension holds customer information.

 Note
An SAP Commerce extension may provide functionality that is licensed through different SAP Commerce modules. Make sure to limit your implementation to
the features de ned in your contract license. In case of doubt, please contact your sales representative.

 Note
Make sure that:

1. The user is con gured as described in the Application Security document.

2. The publication is con gured as described in the The PartyResolvingStrategy section of the c4c-integration-soap-adapter Extension document.

General
The c4c-integration-canonical models information that comes from the source systems, in this case from the c4c-integration-raw extension. The generic
de nition is used to have a data representation that is independent from source systems and target systems.

The c4c-integration-canonical has a dependency with the party-canonical Data Hub extension.

<dependencies>
<dependency>
<extension>party-canonical</extension>
</dependency>
</dependencies>

The following canonical items are reused from the party-canonical Data Hub extension:

CanonicalParty

CanonicalAddress

CanonicalPartyAddress

Also, the CanonicalParty item is extended from the party-canonical Data Hub extension.

Items de nitions

<extension xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.hybris.com/schema/"


xsi:schemaLocation="http://www.hybris.com/schema/datahub-metadata-schema-1.1.1.xsd" name="c4c-integration-canonical">
<canonicalItems>
<item>
<type>CanonicalParty</type>
<description>Canonical representation of Customer</description>
<status>ACTIVE</status>
<attributes>
<attribute>
<name>email</name>
<model>
<type>String</type>
</model>
</attribute>
<attribute>
<name>shippingAddressId</name>
<model>
<type>String</type>

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 37/99
3/5/2020
</model>
</attribute>
<attribute>
<name>billingAddressId</name>
<model>
<type>String</type>
</model>
</attribute>
<attribute>
<name>defaultAddressId</name>
<model>
<type>String</type>
</model>
</attribute>
<attribute>
<name>addresses</name>
<model>
<type>String</type>
</model>
</attribute>
</attributes>
</item>
</canonicalItems>
</extension>

On the other hand, the following extensions depend on the c4c-integration-canonical extension:

c4c-integration-raw

c4c-integration-target

Creating a Canonical Item


A canonical item is only created after triggering the InitiateCompositionEvent event. To trigger this composition, call the following REST address:

POST: http://localhost:8080/datahub-webap/v1/pools/C4CCUSTOMER_POOL/compositions

Checking the Attributes De ned for CanonicalParty and CanonicalAddress


To check the attributes de ned for CanonicalParty and CanonicalAddress, call the following REST addresses:

GET: http://localhost:8080/datahub-webap/v1/item-classes/canonical/item-types/CanonicalParty/attributes

GET: http://localhost:8080/datahub-webap/v1/item-classes/canonical/item-types/CanonicalAddress/attributes

Checking Already Composed Canonical Items


To check already composed canonical items, call the following REST addresses:

GET: http://localhost:8080/datahub-webap/v1/pools/C4CCUSTOMER_POOL/items/CanonicalParty

GET: http://localhost:8080//datahub-webap/v1/pools/C4CCUSTOMER_POOL/items/CanonicalAddress

Related Information
party-canonical Data Hub Extension
c4c-integration-raw Extension
c4c-integration-target Extension
c4c-integration-soap-adapter Extension
Data Hub
y2ySync Extension - Technical Guide

c4c-integration-target Extension
The c4c-integration-target extension holds customer information that is transmitted to SAP Cloud for Customer.

 Note

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 38/99
3/5/2020
An SAP Commerce extension may provide functionality that is licensed through different SAP Commerce modules. Make sure to limit your implementation to
the features de ned in your contract license. In case of doubt, please contact your sales representative.

 Note
Make sure that:

1. The user is con gured as described in the Application Security document.

2. The publication is con gured as described in the The PartyResolvingStrategy section of the c4c-integration-soap-adapter Extension document.

General
The c4c-integration-target models information that comes from the source systems, in this case from the c4c-integration-canonical Extension. The
following target items are de ned:

CanonicalParty

CanonicalAddress

The items are de ned in the following way:

<extension xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.hybris.com/schema/"


xsi:schemaLocation="http://www.hybris.com/schema/datahub-metadata-schema-1.1.1.xsd" name="c4c-integration-target">

<dependencies>
<dependency>
<extension>c4c-integration-canonical</extension>
</dependency>
</dependencies>

... rest of definitions...


</extension>

De nitions of the Target Item

<extension xmlns="http://www.hybris.com/schema/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"


xsi:schemaLocation="http://www.hybris.com/schema/datahub-metadata-schema-1.1.1.xsd" name="c4c-integration-target">

<dependencies>
... dependencies between Data Hub extensions ...
</dependencies>

<targetSystems>
<targetSystem>
... some info for the target system ...
<targetItems>
<item>
<type>CustomerItem</type>
<canonicalItemSource>CanonicalParty</canonicalItemSource>
<attributes>
... attributes ...
</attributes>
</item>
<item>
<type>AddressItem</type>
<canonicalItemSource>CanonicalPartyAddress</canonicalItemSource>
<attributes>
... attributes ...
</attributes>
</item>
</targetItems>
</targetSystem>
</targetSystems>

</extension>

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 39/99
3/5/2020
Target System

<extension xmlns="http://www.hybris.com/schema/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"


xsi:schemaLocation="http://www.hybris.com/schema/datahub-metadata-schema-1.1.1.xsd" name="c4c-integration-target">

<dependencies>
... dependencies between Data Hub extensions ...
</dependencies>

<targetSystems>
<targetSystem>
<name>C4CSoapTargetSystem</name>
<type>C4C_CLIENT_SOAP_JAXWS</type>
<exportURL>${datahub.c4c.exportURL}</exportURL>
<userName>${datahub.c4c.userName}</userName>
<password>${datahub.c4c.password}</password>
<targetItems>
... some target item definitions ...
</targetItems>
</targetSystem>
</targetSystems>

</extension>

The idea behind this is to de ne this C4C_CLIENT_SOAP_JAXWS target system. The system is mapped against an existing adapter implementation and the
adapter maps against this value. For more information, see the c4c-integration-soap-adapter Extension. The c4c-integration-target extension does not
depend on c4c-soap-adapter, the implementation can be based on other extensions which understands the same de nition.

Publication
You can create a target item only by triggering the InitiatePublicationEvent event. A simple way to trigger this publication is to call the following REST
address:

POST: http://localhost:8080/datahub-webap/v1/pools/C4CCUSTOMER_POOL/publications

{"targetSystemPublications":[{"targetSystemName":"C4CSoapTargetSystem"}]}

Checking Publication Statuses


To check the publication statuses, call the following REST address:

GET: http://localhost:8080/datahub-webap/v1/pools/C4CCUSTOMER_POOL/publications/

Related Information
c4c-integration-raw Extension
c4c-integration-canonical Extension
c4c-integration-soap-adapter Extension
Data Hub
y2ySync Extension - Technical Guide

c4c-integration-soap-adapter Extension
The c4c-integration-soap-adapter extension creates a soap request that can be processed by SAP Cloud for Customer.

 Note
An SAP Commerce extension may provide functionality that is licensed through different SAP Commerce modules. Make sure to limit your implementation to
the features de ned in your contract license. In case of doubt, please contact your sales representative.

General
The c4c-integration-soap-adapter is designed to create a soap request that SAP Cloud for Customer can process. This target extension is created to
process information that comes from target items, in this case from the c4c-integration-target extension. The c4c-integration-soap-adapter
extension depends on c4c-integration-target extension because the transformations de ned along with target items are used.

The dependency de nition:

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 40/99
3/5/2020

<extension xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.hybris.com/schema/"


xsi:schemaLocation="http://www.hybris.com/schema/datahub-metadata-schema-1.1.1.xsd" name="c4c-integration-soap-adapte

<dependencies>
<dependency>
<extension>c4c-integration-target</extension>
</dependency>
</dependencies>

</extension>

A way to map the c4c-integration-soap-adapter with the target system de ned in c4c-integration-target is done in the spring con guration le:
c4c-integration-soap-adapter/src/main/resources/META-INF/c4c-integration-soap-adapter-datahub-extension-
spring.xml.

Con guration:

<beans xmlns="http://www.springframework.org/schema/beans">

<bean name="c4cSoapAdapter" class="com.hybris.datahub.c4c.adapter.soapadapter.core.C4cSoapAdapter">


<property name="targetSystemType" value="C4C_CLIENT_SOAP_JAXWS" />
... other properties...

</bean>

</beans>

The C4C_CLIENT_SOAP_JAXWS value registers the c4c-integration-soap-adapter in Data Hub against the con guration that was de ned within c4c-
integration-target.

The Big Picture

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 41/99
3/5/2020

Where:

AdapterService: a Data Hub interface used to de ne outbound adapters.

BusinessPartnerReplicationIn: a JAXB interface created automatically after compiling c4c-integration-soap-


adapter/src/main/resources/META-INF/wsdl/business-partner-replication.wsdl. It de nes the C4C SOAP Service to reach.

ApacheCxfSoapClientProxy: a class created on the y by apache CXF. It represents the actual SOAP Client that access the C4C SOAP Service.

Interceptor, PhaseInterceptor, AbstractPhaseInterceptor: Apache CXF interceptor classes that allow modi cation of soap message.

 Note
For developers, the WSDL le is compiled every time using maven during generate-sources phase. This is con gured in c4c-integration-soap-adapter project's
pom le.

<?xml version="1.0" encoding="UTF-8"?>


<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

... extra config ...

<build>
<plugins>
<plugin>
<groupId>org.apache.cxf</groupId>

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 42/99
3/5/2020
<artifactId>cxf-codegen-plugin</artifactId>
<version>${org.apache.cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>wsdl2java</goal>
</goals>
<configuration>
<sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/META-INF/wsdl/business-partner-replication.wsdl</wsdl>
<extraargs>
<extraarg>-p</extraarg>
<extraarg>http://sap.com/xi/A1S/Global=com.hybris.datahub.c4c.adapter.soapadapter.sche
<extraarg>-p</extraarg>
<extraarg>http://sap.com/xi/BASIS/Global=com.hybris.datahub.c4c.adapter.soapadapter.sc
<extraarg>-p</extraarg>
<extraarg>http://sap.com/xi/SAPGlobal20/Global=com.hybris.datahub.c4c.adapter.soapadap
<extraarg>-p</extraarg>
<extraarg>http://sap.com/xi/AP/Common/Global=com.hybris.datahub.c4c.adapter.soapadapte
<extraarg>-p</extraarg>
<extraarg>http://sap.com/xi/AP/Common/GDT=com.hybris.datahub.c4c.adapter.soapadapter.s
<extraarg>-p</extraarg>
<extraarg>http://xiTest.com/xi/test=com.hybris.datahub.c4c.adapter.soapadapter.schema
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

This con g generates JAXB and JAXWS classes that are used by the soap adapter. To be able to open the project eclipse, you have to compile the project once.
And if not previously con gured, add the target/generated/cxf folder to your project con g:

cd /root/of/project
mvn clean package

Publication Process

C4cSoapAdapter: handles any exception that comes from the publisher and if any, marks the publication as FAILURE, otherwise as SUCCESS.

C4cSoapPublisher: in charge of preprocessing target items and giving them a logic order, for instance, checking that there are no addresses without a
customer, grouping addresses, and assigning them to the customers.

C4cSoapProcessor: creates the c4c soap request and sends it to SAP Cloud for Customer.

Publication process is as follows: All the customer target items that are ready to be published are gathered in pages. Then all the address target items that are ready
to be published are gathered in pages. All items that are not part of a complete side are put aside and wait for completion. The list of SAP Cloud for Customer
business partners is created and the SAP Cloud for Customer is called as many times as possible considering a threshold. If a soap error appears in the rst
publication, then the publication is marked as FAILURE. If a soap error occurs in a subsequent call, then only the rest of the items are marked as FAILURE, since the
previous soap request was successful.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 43/99
3/5/2020
There are two properties related to the threshold. The c4c.soap.request.size.threshold=1000 which speci es number of customers that can be sent in one call. And
the c4c.soap.request.pause.between.requests=5000 speci es how long Data Hub waits before next call and informs SAP Cloud for Customer how much time it has
to process the received data before next call.

The C4cSoapPublisher
For the preprocessing, there are populators that transform the target items into SAP Cloud for Customer speci c objects.

The preprocess() method currently checks the following:

Filters out customers or addresses that are not possible to transform and marks them as INCOMPLETE.

Filters out addresses that do not have a customer present in the current publication chunk and marks them as MISSING_REFERENCE.

Filters out addresses that are not expected as a part of the customer information and marks them as INVALID_REFERENCE_KEY: A customer has a list of
expected addresses.

Filters out customers and addresses that are not a part of a full set and marks them as INCOMPLETE. If expected addresses are not met after processing
the current publication chunk, it means that it is not possible to publish those elements and they need to be reprocessed.

After nishing this preprocess method returns a list of BusinessPartner objects that are sent to the C4cSoapProcessor for further processing.

The C4cSoapProcessor
The current implementation of the DefaultC4cJaxwsSoapProcessor uses a JAX-WS soap client that is created against a wsdl: c4c-integration-soap-
adapter/src/main/resources/META-INF/wsdl/business-partner-replication.wsdl. The JAX-WS client is con gured within spring in the
following le: c4c-integration-soap-adapter/src/main/resources/META-INF/c4c-integration-soap-adapter-datahub-
extension-spring.xml.

<beans xmlns="http://www.springframework.org/schema/beans">

... some other spring beans ...

<bean id="businessPartnerReplicationClient" factory-bean="proxyFactory" factory-method="create" scope="prototype" lazy-init="

... some other spring beans ...

</beans>

This bean is attached to the DefaultC4cJaxwsSoapProcessor and used for reaching c4c soap endpoint.

<beans xmlns="http://www.springframework.org/schema/beans">

... some other spring beans ...

<alias name="defaultPartyResolvingStrategy" alias="partyResolvingStrategy" />

<bean name="defaultPartyResolvingStrategy"
class="com.hybris.datahub.c4c.adapter.soapadapter.processor.strategy.impl.DefaultPartyResolvingStrategy">
</bean>

<alias name="defaultC4cJaxwsSoapProcessor" alias="c4cJaxwsSoapProcessor" />


<bean name="defaultC4cJaxwsSoapProcessor"
class="com.hybris.datahub.c4c.adapter.soapadapter.processor.impl.DefaultC4cJaxwsSoapProcessor">
<property name="partyResolvingStrategy" ref="partyResolvingStrategy" />
<lookup-method name="getBusinessPartnerRequestClient" bean="businessPartnerReplicationClient" />
</bean>

<alias name="defaultC4cJaxwsSoapProcessor" alias="c4cJaxwsSoapProcessor" />


https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 44/99
3/5/2020
<bean name="defaultC4cJaxwsSoapProcessor" class="com.hybris.datahub.c4c.adapter.soapadapter.processor.impl.DefaultC4cJax
<lookup-method name="getBusinessPartnerRequestClient" bean="businessPartnerReplicationClient" />
... some other properties ...
</bean>

... some other spring beans ...


</beans>

This way a new JAXWS soap client is created every time and thus the endpoint URL can be modi ed for each call independently. Do not forget that spring creates by
default singleton beans.

The JAXWS Soap Client


For con guring this soap client, for instance: proxy and authentication, the following con guration can be used:

<beans xmlns="http://www.springframework.org/schema/beans">

... some other spring beans ...

<http:conduit name="{http://sap.com/xi/A1S/Global}BusinessPartnerReplicationInPort.http-conduit">
<http:authorization>
<sec:UserName>${datahub.c4c.userName}</sec:UserName>
<sec:Password>${datahub.c4c.password}</sec:Password>
<sec:AuthorizationType>Basic</sec:AuthorizationType>
</http:authorization>
<http:client AutoRedirect="true"
Connection="Keep-Alive"
ProxyServer="10.10.10.10"
ProxyServerPort="8080"
NonProxyHosts="localhost|127.0.0.1"
AllowChunking="false" />
</http:conduit>
</beans>

Where the transport is con gured to:

Use BASIC authentication:

The username is provided by: ${datahub.c4c.userName}

The password is provided by: ${datahub.c4c.password}

Use a proxy:

The proxy host is set to: 10.10.10.10

The proxy port is set to: 8080

Add this con guration to your Data Hub extension's spring le: myextension/src/main/resources/META-INF/myextension-datahub-
extension-spring.xml and make sure your extension is deployed along with the soap adapter.

Creating a Data Hub Proxy Extension


During the c4c integration, creating a Data Hub proxy extension is needed. To create the proxy, see the Creating a Data Hub Proxy Extension topic.

The PartyResolvingStrategy
The strategy allows de nition of both c4c request tags: SenderParty and RecipientParty which are part of the request message header.The current
implementation: DefaultPartyResolvingStrategy resolves those tags based on the pool name where the target items are contained and queries the
local con guration looking for the values to be applied. For more information about DATA_FEED and POOL_NAME con guration, see Feeds and Pools.

For instance, if the target items are contained in the C4CCUSTOMER_POOL pool, this strategy tries to nd and map the following properties in c4c-datahub-
overlay/src/main/resources/local.properties:

datahub.c4c.senderParty.schemeID.C4CCUSTOMER_POOL=CommunicationSystemID
datahub.c4c.senderParty.internalID.C4CCUSTOMER_POOL=HYBRISINT
datahub.c4c.senderParty.schemeAgencyID.C4CCUSTOMER_POOL=310

datahub.c4c.recipientParty.schemeID.C4CCUSTOMER_POOL=LocalSystemID
datahub.c4c.recipientParty.internalID.C4CCUSTOMER_POOL=0LO7ESO
datahub.c4c.recipientParty.schemeAgencyID.C4CCUSTOMER_POOL=310

This generates the following tags:

<SenderParty>
<InternalID schemeID="CommunicationSystemID" schemeAgencyID="310">HYBRISINT</InternalID>
</SenderParty>
<RecipientParty>

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 45/99
3/5/2020
<InternalID schemeID="LocalSystemID" schemeAgencyID="310">0LO7ESO</InternalID>
</RecipientParty>

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns4:BusinessPartnerSUITEBulkReplicateRequest xmlns:ns4="http://sap.com/xi/SAPGlobal20/Global">
<MessageHeader>
<ID>729349E61DEC4D0FBCF1D7CFA9D79681</ID>
<UUID>729349E6-1DEC-4D0F-BCF1-D7CFA9D79681</UUID>
<CreationDateTime>2015-07-22T14:06:25.243Z</CreationDateTime>
<SenderParty>
<InternalID schemeID="CommunicationSystemID" schemeAgencyID="310">HYBRISINT</InternalID>
</SenderParty>
<RecipientParty>
<InternalID schemeID="LocalSystemID" schemeAgencyID="310">0LO7ESO</InternalID>
</RecipientParty>
</MessageHeader>
<BusinessPartnerSUITEReplicateRequestMessage>

... business partner info ...

</BusinessPartnerSUITEReplicateRequestMessage>
</ns4:BusinessPartnerSUITEBulkReplicateRequest>
</soap:Body>
</soap:Envelope>

Both tags are generated under the request message header, for example:

The MessageIdInterceptor
This Apache CXF interceptor modi es the endpoint URL. The interceptor uses the same ID that is generated for the request UUID. For instance, based on the
following payload:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns4:BusinessPartnerSUITEBulkReplicateRequest xmlns:ns4="http://sap.com/xi/SAPGlobal20/Global">
<MessageHeader>
<ID>729349E61DEC4D0FBCF1D7CFA9D79681</ID>
<UUID>729349E6-1DEC-4D0F-BCF1-D7CFA9D79681</UUID>
<CreationDateTime>2015-07-22T14:06:25.243Z</CreationDateTime>
<SenderParty>
<InternalID schemeID="CommunicationSystemID" schemeAgencyID="310">HYBRISINT</InternalID>
</SenderParty>
<RecipientParty>
<InternalID schemeID="LocalSystemID" schemeAgencyID="310">0LO7ESO</InternalID>
</RecipientParty>
</MessageHeader>
<BusinessPartnerSUITEReplicateRequestMessage>
... business partner info ...
</BusinessPartnerSUITEReplicateRequestMessage>
</ns4:BusinessPartnerSUITEBulkReplicateRequest>
</soap:Body>
</soap:Envelope>

For example:

The UUID is: 729349E6-1DEC-4D0F-BCF1-D7CFA9D79681. This value is added to the endpoint, in a way that the SOAP endpoint address is:

https://qxl-cust241.dev.sapbydesign.com/sap/bc/srt/scs/sap/businesspartnerreplicationin?MessageId=729349E6-1DEC-4D0F-BCF1-D7CFA9

Data Pools
Data pools enable users to isolate and manage their data for composition and publishing. This enables many system to synchronize and usage of its own pools. All
available pools are mapped with sender party and recipient party.

PartyType enum was created to de ne party types, such as senderParty and recipientParty:

ParentType.java

package com.hybris.datahub.c4c.adapter.soapadapter.processor.strategy;

/**
* Enum of existing types of parties.
*/
public enum PartyType
{
SENDER_PARTY("senderParty"),
RECIPIENT_PARTY("recipientParty");

private String value;

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 46/99
3/5/2020
private PartyType(final String value)
{
this.value = value;
}

/**
* String value to get properties of the party.
* @return
*/
public String getValue()
{
return this.value;
}
}

To resolve mapping special strategy interface is created. Only one method is con gured - PartyInternalID by partyType and pool.

PartyResolvingStrategy.java

package com.hybris.datahub.c4c.adapter.soapadapter.processor.strategy;

import com.hybris.datahub.c4c.adapter.soapadapter.schema.com.sap.xi.ap.common.gdt.PartyInternalID;
import com.hybris.datahub.runtime.domain.DataHubPool;

/**
* Strategy to get sender party id via Data Hub pool.
*/
public interface PartyResolvingStrategy
{
/**
* The method configures PartyInternalID using the pool name and the party type.
* @param dataHubPool
* @param party
* @return
*/
PartyInternalID getPartyInternalID(final PartyType party, final DataHubPool dataHubPool);
}

The default implementation constructs property name from the party type and the pool name, and gets required properties from environment.

DefaultPartyResolvingStrategy

package com.hybris.datahub.c4c.adapter.soapadapter.processor.strategy.impl;

import com.hybris.datahub.c4c.adapter.soapadapter.C4cSoapAdapterException;
import com.hybris.datahub.c4c.adapter.soapadapter.processor.strategy.PartyType;
import com.hybris.datahub.c4c.adapter.soapadapter.processor.strategy.PartyResolvingStrategy;
import com.hybris.datahub.c4c.adapter.soapadapter.schema.com.sap.xi.ap.common.gdt.PartyInternalID;
import com.hybris.datahub.runtime.domain.DataHubPool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.support.AbstractBeanFactory;

/**
* Default implementation of the {@link com.hybris.datahub.c4c.adapter.soapadapter.processor.strategy.PartyResolvingStrateg
*/
public class DefaultPartyResolvingStrategy implements PartyResolvingStrategy
{
private static final String DATAHUB_C4C_PREFIX = "datahub.c4c";
private static final String DATAHUB_C4C_INTERNAL_SYSTEM_ID = "internalID";
private static final String DATAHUB_C4C_AGENCY_SCHEME_ID = "schemeAgencyID";
private static final String DATAHUB_C4C_SCHEME_ID = "schemeID";

@Autowired
private AbstractBeanFactory abstractBeanFactory;

/**
* The method configures PartyInternalID using the pool name and the party type.
* @param party
* @param dataHubPool
* @return PartyInternalID mapped to the pool and party type
* @throws C4cSoapAdapterException if dataHubPool is null or if no sender party for the pool or no such property
*/
@Override
public PartyInternalID getPartyInternalID(final PartyType party, final DataHubPool dataHubPool)
{
final PartyInternalID partyInternalID = new PartyInternalID();

if (party == null)
{
throw new C4cSoapAdapterException("Can't map dataHubPool: partyType is null");
}
if (dataHubPool == null)
{
throw new C4cSoapAdapterException("Can't map dataHubPool: dataHubPool is null");
}
else
{
if (dataHubPool.getPoolName() == null || dataHubPool.getPoolName().isEmpty())
{
throw new C4cSoapAdapterException("Can't map dataHubPool name: dataHubPoolName is null or empty");
}

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 47/99
3/5/2020
else
{
partyInternalID.setValue(getPartyParameter(party, dataHubPool, DATAHUB_C4C_INTERNAL_SYSTEM_ID));
partyInternalID.setSchemeID(getPartyParameter(party, dataHubPool, DATAHUB_C4C_SCHEME_ID));
partyInternalID.setSchemeAgencyID(getPartyParameter(party, dataHubPool, DATAHUB_C4C_AGENCY_SCHEME_ID));
}
}
return partyInternalID;
}

/**
* The method gets properties of PartyInternalID.
* @param party
* @param dataHubPool
* @return
* @throws C4cSoapAdapterException if no such property
*/
private String getPartyParameter(final PartyType party, final DataHubPool dataHubPool, final String parameter)
{
final String propertyName = "${" + DATAHUB_C4C_PREFIX + "." + party.getValue() + "." + parameter + "." + dataHubPool
+ "}";
final String senderPartyId = abstractBeanFactory.resolveEmbeddedValue(propertyName);
if ((senderPartyId != null) && (!propertyName.equals(senderPartyId)))
{
return senderPartyId;
}
throw new C4cSoapAdapterException("Can't map party by dataHubPool name and party type: dataHubPool.name='"
+ dataHubPool.getPoolName() + "', partyType='" + party + "'");
}
}

DefaultC4cJaxwsSoapProcessor is modi ed to use strategy.

package com.hybris.datahub.c4c.adapter.soapadapter.processor.impl;

//some imports here


/**
* JAXWS implementation of the {@link C4cSoapProcessor}.
*/
public abstract class DefaultC4cJaxwsSoapProcessor implements C4cSoapProcessor
{
private static final Logger LOG = LoggerFactory.getLogger(DefaultC4cJaxwsSoapProcessor.class);

private PartyResolvingStrategy partyResolvingStrategy;

/**
* Processes the customers being provided by datahub and that need to be send to C4C.
*
* @param pub
* @param customers
* @return A list of datahub errors
*/
@Override
public List<ErrorData> process(final TargetSystemPublication pub,
final List<BusinessPartnerReplicationSingleInstance> customers)
{
final List<ErrorData> errors = new ArrayList<>();
BusinessPartnerReplicationRequest request = null;
try
{
if (customers == null || customers.isEmpty())
{
return errors;
}

final DataHubPool pool = pub.getTargetItems().iterator().next().getDataPool();


request = createRequest(customers, pool);
sendMessage(request);
}
catch (Exception e)
{
LOG.error(e.getMessage(), e);
while (e.getCause() != null)
{
e = (Exception) e.getCause();
}
final ErrorData errorData = new ErrorData();
errorData.setMessage(e.getMessage());
errorData.setCode("500");
errors.add(errorData);
return errors;
}
return errors;
}

...

/**
* Creates the {@link BusinessPartnerReplicationRequest} request Object.
*
* @param customers
* @param pool

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 48/99
3/5/2020
* @return The generated request object.
*/
public BusinessPartnerReplicationRequest createRequest(final List<BusinessPartnerReplicationSingleInstance> customers,
final DataHubPool pool)
{
// Send SOAP Message to SOAP Server
final String uuid = java.util.UUID.randomUUID().toString().toUpperCase();

final BusinessPartnerReplicationRequest request = new BusinessPartnerReplicationRequest();


request.setMessageHeader(new BusinessDocumentMessageHeader());
final BusinessDocumentMessageHeader header = request.getMessageHeader();
header.setID(new BusinessDocumentMessageID());
final BusinessDocumentMessageID messageID = header.getID();
messageID.setValue(uuid.replaceAll("-", ""));

header.setUUID(new UUID());
final UUID messageUUID = header.getUUID();
messageUUID.setValue(uuid);

final DateTime now = new DateTime(DateTimeZone.UTC);


header.setCreationDateTime(this.getCalendar(now));

final BusinessDocumentMessageHeaderParty senderParty = new BusinessDocumentMessageHeaderParty();


final PartyInternalID senderPartyInternalID = partyResolvingStrategy.getPartyInternalID(PartyType.SENDER_PARTY, pool
senderParty.setInternalID(senderPartyInternalID);
header.setSenderParty(senderParty);

final BusinessDocumentMessageHeaderParty recipientParty = new BusinessDocumentMessageHeaderParty();


final PartyInternalID recipientPartyInternalID = partyResolvingStrategy.getPartyInternalID(PartyType.RECIPIENT_PARTY
recipientParty.setInternalID(recipientPartyInternalID);
header.getRecipientParty().add(recipientParty);

final List<BusinessPartnerBulkReplicationRequestBusinessPartner> partners = request


.getBusinessPartnerSUITEReplicateRequestMessage();
for (final BusinessPartnerReplicationSingleInstance c : customers)
{
partners.add(this.createBusinessPartner(c));
}

return request;
}

...

/**
* Sets the senderPartyResolvingStrategy attribute.
*
* @param partyResolvingStrategy
*/
@Required
public void setPartyResolvingStrategy(final PartyResolvingStrategy partyResolvingStrategy)
{
this.partyResolvingStrategy = partyResolvingStrategy;
}
}

The c4c Soap Message


Mappings:

For the following CustomerItem:

The values are mapped against a BusinessPartnerReplicationSingleInstance object. This class is a JAXB class generated after compilation of WSDL.

customer (CustomerItem)
{
customerId = c1
name = John
lastname = Doe

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 49/99
3/5/2020
email = john.doe@email.com
roleCode = CRM000
gender = 0
formOfAddress = null
}

Produces:

<BusinessPartner actionCode="04"
addressInformationListCompleteTransmissionIndicator="true"
roleListCompleteTransmissionIndicator="true"
identificationListCompleteTransmissionIndicator="true"
industrySectorListCompleteTransmissionIndicator="true"
commonListCompleteTransmissionIndicator="true">
<ExternalID>c1</ExternalID> <--- customer.customerId
<CategoryCode>1</CategoryCode>
<AddressInformation actionCode="04"
addressUsageListCompleteTransmissionIndicator="true">
<Address emailListCompleteTransmissionIndicator="true"
facsimileListCompleteTransmissionIndicator="true"
postalAddressListCompleteTransmissionIndicator="true"
webListCompleteTransmissionIndicator="true"
organisationNameListCompleteTransmissionIndicator="true">
<Email actionCode="04" eMailUsageListCompleteTransmissionIndicator="true">
<URI>john.doe@email.com</URI> <--- customer.email
<EmailUsage actionCode="04">
<Usage>
<Code>AD_DEFAULT</Code>
</Usage>
</EmailUsage>
</Email>
</Address>
</AddressInformation>
<Common actionCode="04">
<ReleasedIndicator>true</ReleasedIndicator>
<BlockedIndicator>false</BlockedIndicator>
<DeletedIndicator>false</DeletedIndicator>
<Person>
<Name>
<--- here should go customer.formOfAddress, but since it is null, no "<FormOfAddress>
<GivenName>John</GivenName> <--- customer.name
<FamilyName>Doe</FamilyName> <--- customer.lastname
</Name>
<GenderCode>0</GenderCode> <--- customer.gender
</Person>
</Common>
<Role actionCode="04">
<RoleCode>CRM000</RoleCode> <--- customer.roleCode
</Role>
</BusinessPartner>

The same way for an AddressItem:

And for the following values:

address1 (AddressItem)
{
addressId = A1
streetName = Nymphenburgerstr. 86
postalCode = 80636
city = MUNICH
country = DE
customerId = c1
}

address2 (AddressItem)
{
addressId = A2
streetName = Berlinerstr. 88
postalCode = 10245

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 50/99
3/5/2020
city = BERLIN
country = DE
customerId = c1
}

Produce two addresses:

<AddressInformation actionCode="04"
addressUsageListCompleteTransmissionIndicator="true">
<Address emailListCompleteTransmissionIndicator="true"
facsimileListCompleteTransmissionIndicator="true"
postalAddressListCompleteTransmissionIndicator="true"
webListCompleteTransmissionIndicator="true"
organisationNameListCompleteTransmissionIndicator="true">
<PostalAddress actionCode="04">
<CountryCode>DE</CountryCode> <--- address1.country
<CityName>MUNICH</CityName> <--- address1.city
<StreetPostalCode>80636</StreetPostalCode> <--- address1.postalCode
<StreetName>Nymphenburgerstr. 86</StreetName> <--- address1.streetName
</PostalAddress>
</Address>
</AddressInformation>

<AddressInformation actionCode="04"
addressUsageListCompleteTransmissionIndicator="true">
<Address emailListCompleteTransmissionIndicator="true"
facsimileListCompleteTransmissionIndicator="true"
postalAddressListCompleteTransmissionIndicator="true"
webListCompleteTransmissionIndicator="true"
organisationNameListCompleteTransmissionIndicator="true">
<PostalAddress actionCode="04">
<CountryCode>DE</CountryCode> <--- address2.country
<CityName>BERLIN</CityName> <--- address2.city
<StreetPostalCode>10245</StreetPostalCode> <--- address2.postalCode
<StreetName>Berlinerstr. 88</StreetName> <--- address2.streetName
</PostalAddress>
</Address>
</AddressInformation>

Addresses and customer are generated nally in a single tag:

<BusinessPartner actionCode="04"
addressInformationListCompleteTransmissionIndicator="true"
roleListCompleteTransmissionIndicator="true"
identificationListCompleteTransmissionIndicator="true"
industrySectorListCompleteTransmissionIndicator="true"
commonListCompleteTransmissionIndicator="true">
<ExternalID>c1</ExternalID> <--- customer.customerId
<CategoryCode>1</CategoryCode>
<AddressInformation actionCode="04"
addressUsageListCompleteTransmissionIndicator="true">
<Address emailListCompleteTransmissionIndicator="true"
facsimileListCompleteTransmissionIndicator="true"
postalAddressListCompleteTransmissionIndicator="true"
webListCompleteTransmissionIndicator="true"
organisationNameListCompleteTransmissionIndicator="true">
<Email actionCode="04" eMailUsageListCompleteTransmissionIndicator="true">
<URI>john.doe@email.com</URI> <--- customer.email
<EmailUsage actionCode="04">
<Usage>
<Code>AD_DEFAULT</Code>
</Usage>
</EmailUsage>
</Email>
</Address>
</AddressInformation>
<AddressInformation actionCode="04"
addressUsageListCompleteTransmissionIndicator="true">
<AddressUsage actionCode="04">
<AddressUsageCode>XXDEFAULT</AddressUsageCode>
</AddressUsage>
<Address emailListCompleteTransmissionIndicator="true"
facsimileListCompleteTransmissionIndicator="true"
postalAddressListCompleteTransmissionIndicator="true"
webListCompleteTransmissionIndicator="true"
organisationNameListCompleteTransmissionIndicator="true">
<PostalAddress actionCode="04">
<CountryCode>DE</CountryCode> <--- address1.country
<CityName>MUNICH</CityName> <--- address1.city
<StreetPostalCode>80636</StreetPostalCode> <--- address1.postalCode
<StreetName>Nymphenburgerstr. 86</StreetName> <--- address1.streetName
</PostalAddress>
</Address>
</AddressInformation>
<AddressInformation actionCode="04"
addressUsageListCompleteTransmissionIndicator="true">
<Address emailListCompleteTransmissionIndicator="true"
facsimileListCompleteTransmissionIndicator="true"
postalAddressListCompleteTransmissionIndicator="true"
webListCompleteTransmissionIndicator="true"
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 51/99
3/5/2020
organisationNameListCompleteTransmissionIndicator="true">
<PostalAddress actionCode="04">
<CountryCode>DE</CountryCode> <--- address2.country
<CityName>BERLIN</CityName> <--- address2.city
<StreetPostalCode>10245</StreetPostalCode> <--- address2.postalCode
<StreetName>Berlinerstr. 88</StreetName> <--- address2.streetName
</PostalAddress>
</Address>
</AddressInformation>
<Common actionCode="04">
<ReleasedIndicator>true</ReleasedIndicator>
<BlockedIndicator>false</BlockedIndicator>
<DeletedIndicator>false</DeletedIndicator>
<Person>
<Name>
<GivenName>John</GivenName> <--- customer.name
<FamilyName>Doe</FamilyName> <--- customer.lastname
</Name>
<GenderCode>0</GenderCode> <--- customer.gender
</Person>
</Common>
<Role actionCode="04">
<RoleCode>CRM000</RoleCode> <--- customer.roleCode
</Role>
</BusinessPartner>

Finally, for the whole SOAP request message that is sent to c4c:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns4:BusinessPartnerSUITEBulkReplicateRequest xmlns:ns2="http://xiTest.com/xi/test"
xmlns:ns3="http://sap.com/xi/AP/Common/Global"
xmlns:ns4="http://sap.com/xi/SAPGlobal20/Global">
<MessageHeader>
<ID>D0B4FA557C0740F99C942F2984209381</ID> <--- Same UUID but without
<UUID>D0B4FA55-7C07-40F9-9C94-2F2984209381</UUID> <--- Random UUID
<CreationDateTime>2015-07-23T12:05:03.986Z</CreationDateTime> <--- Current Timestamp
<SenderParty>
<InternalID schemeID="CommunicationSystemID" schemeAgencyID="310">HYBRISINT</InternalID> <--- Resolved SenderParty u
</SenderParty>
<RecipientParty>
<InternalID schemeID="LocalSystemID" schemeAgencyID="310">0LO7ESO</InternalID> <--- Resolved RecipientPart
</RecipientParty>
</MessageHeader>
<BusinessPartnerSUITEReplicateRequestMessage>
<MessageHeader/>
<BusinessPartner actionCode="04"
addressInformationListCompleteTransmissionIndicator="true"
roleListCompleteTransmissionIndicator="true"
identificationListCompleteTransmissionIndicator="true"
industrySectorListCompleteTransmissionIndicator="true"
commonListCompleteTransmissionIndicator="true">
<ExternalID>c1</ExternalID> <--- customer.customerId
<CategoryCode>1</CategoryCode>
<AddressInformation actionCode="04"
addressUsageListCompleteTransmissionIndicator="true">
<Address emailListCompleteTransmissionIndicator="true"
facsimileListCompleteTransmissionIndicator="true"
postalAddressListCompleteTransmissionIndicator="true"
webListCompleteTransmissionIndicator="true"
organisationNameListCompleteTransmissionIndicator="true">
<Email actionCode="04" eMailUsageListCompleteTransmissionIndicator="true">
<URI>john.doe@email.com</URI> <--- customer.email
<EmailUsage actionCode="04">
<Usage>
<Code>AD_DEFAULT</Code>
</Usage>
</EmailUsage>
</Email>
</Address>
</AddressInformation>
<AddressInformation actionCode="04"
addressUsageListCompleteTransmissionIndicator="true">
<AddressUsage actionCode="04">
<AddressUsageCode>XXDEFAULT</AddressUsageCode>
</AddressUsage>
<Address emailListCompleteTransmissionIndicator="true"
facsimileListCompleteTransmissionIndicator="true"
postalAddressListCompleteTransmissionIndicator="true"
webListCompleteTransmissionIndicator="true"
organisationNameListCompleteTransmissionIndicator="true">
<PostalAddress actionCode="04">
<CountryCode>DE</CountryCode> <--- address1.country
<CityName>MUNICH</CityName> <--- address1.city
<StreetPostalCode>80636</StreetPostalCode> <--- address1.postalCode
<StreetName>Nymphenburgerstr. 86</StreetName> <--- address1.streetName
</PostalAddress>
</Address>
</AddressInformation>
<AddressInformation actionCode="04"
addressUsageListCompleteTransmissionIndicator="true">
<Address emailListCompleteTransmissionIndicator="true"
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 52/99
3/5/2020
facsimileListCompleteTransmissionIndicator="true"
postalAddressListCompleteTransmissionIndicator="true"
webListCompleteTransmissionIndicator="true"
organisationNameListCompleteTransmissionIndicator="true">
<PostalAddress actionCode="04">
<CountryCode>DE</CountryCode> <--- address2.country
<CityName>BERLIN</CityName> <--- address2.city
<StreetPostalCode>10245</StreetPostalCode> <--- address2.postalCode
<StreetName>Berlinerstr. 88</StreetName> <--- address2.streetName
</PostalAddress>
</Address>
</AddressInformation>
<Common actionCode="04">
<ReleasedIndicator>true</ReleasedIndicator>
<BlockedIndicator>false</BlockedIndicator>
<DeletedIndicator>false</DeletedIndicator>
<Person>
<Name>
<GivenName>John</GivenName> <--- customer.name
<FamilyName>Doe</FamilyName> <--- customer.lastname
</Name>
<GenderCode>0</GenderCode> <--- customer.gender
</Person>
</Common>
<Role actionCode="04">
<RoleCode>CRM000</RoleCode> <--- customer.roleCode
</Role>
</BusinessPartner>
</BusinessPartnerSUITEReplicateRequestMessage>
</ns4:BusinessPartnerSUITEBulkReplicateRequest>
</soap:Body>
</soap:Envelope>

c4c roleCode, formOfAddress, and gender


A c4c roleCode, formOfAddress, and gender are con gured by adding an extra eld to CustomerItem in c4c-integration-target extension. This can be found
under: c4c-integration-target/src/main/resources/META-INF/c4c-integration-target-datahub-extension.xml. The extra eld is
called accordingly: CustomerItem.roleCode, CustomerItem.formOfAddress, and CustomerItem.gender:

<extension xmlns="http://www.hybris.com/schema/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"


xsi:schemaLocation="http://www.hybris.com/schema/datahub-metadata-schema-1.1.1.xsd" name="c4c-integration-target">

<dependencies>
<dependency>
<extension>c4c-integration-canonical</extension>
</dependency>
</dependencies>

<targetSystems>
<targetSystem>
... extra target system config ...
<targetItems>
<item>
<type>CustomerItem</type>
... extra item config ...
<attributes>
<attribute>
<name>roleCode</name>
<localizable>false</localizable>
<collection>false</collection>
<transformationExpression>"CRM000"</transformationExpression>
<exportCode>roleCode</exportCode>
<mandatoryInHeader>false</mandatoryInHeader>
</attribute>

<attribute>
<name>formOfAddress</name>
<localizable>false</localizable>
<collection>false</collection>
<transformationExpression>null</transformationExpression>
<exportCode>formOfAddress</exportCode>
<mandatoryInHeader>false</mandatoryInHeader>
</attribute>

<attribute>
<name>gender</name>
<localizable>false</localizable>
<collection>false</collection>
<transformationExpression>"0"</transformationExpression>
<exportCode>gender</exportCode>
<mandatoryInHeader>false</mandatoryInHeader>
</attribute>
</attributes>
</item>

... other target items ...


</targetItems>
</targetSystem>
</targetSystems>

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 53/99
3/5/2020

</extension>

When the publication process is triggered, a CustomerItem object is created by every customer that has been modi ed in Data Hub, and thus this extra value is
added to each one. Finally the DefaultCustomerPopulator implementation adds this information to the business partner, and this generates a SOAP request:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns4:BusinessPartnerSUITEBulkReplicateRequest xmlns:ns4="http://sap.com/xi/SAPGlobal20/Global">
<MessageHeader>
... message header info ...
</MessageHeader>
<BusinessPartnerSUITEReplicateRequestMessage>
<MessageHeader/>
<BusinessPartner actionCode="04"
addressInformationListCompleteTransmissionIndicator="true"
roleListCompleteTransmissionIndicator="true"
identificationListCompleteTransmissionIndicator="true"
industrySectorListCompleteTransmissionIndicator="true"
commonListCompleteTransmissionIndicator="true">

... extra business partner info ...

<Common actionCode="04">
<ReleasedIndicator>true</ReleasedIndicator>
<BlockedIndicator>false</BlockedIndicator>
<DeletedIndicator>false</DeletedIndicator>
<Person>
<Name>
<--- Since in the current mapping a "nul
<GivenName>John</GivenName>
<FamilyName>Doe</FamilyName>
</Name>
<GenderCode>0</GenderCode> <--- the gender code
</Person>
</Common>
<Role actionCode="04">
<RoleCode>CRM000</RoleCode> <--- The roleCode
</Role>
</BusinessPartner>
</BusinessPartnerSUITEReplicateRequestMessage>
</ns4:BusinessPartnerSUITEBulkReplicateRequest>
</soap:Body>
</soap:Envelope>

The gender values:

0 - unknown

1 - male

2- female

Related Information
c4c-integration-raw Extension
c4c-integration-canonical Extension
c4c-integration-target Extension
Data Hub
y2ySync Extension - Technical Guide

Creating a Data Hub Proxy Extension


During the SAP Cloud for Customer integration, creating a Data Hub proxy extension is needed.

Context
Even if you do not use proxy servers, the creation of a Data Hub proxy extension is needed for the SAP Cloud for Customer integration to work. Here you will nd the
steps leading you through the creation of a proxy extension.

Procedure
1. Install Apache Maven.

2. Install Data Hub SDK (if not already installed) by executing the following command in <HYBRIS_HOME>\hybris\bin\ext-
integration\datahub\sdk. Replace <version> with the correct Data Hub SDK version.

mvn org.apache.maven.plugins:maven-install-plugin:2.5.1:install-file -Dfile=datahub-extension-sdk-<version>.jar

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 54/99
3/5/2020
3. Create a new Data Hub extension by executing the following command in <HYBRIS_HOME>\hybris\bin\custom:

mvn archetype:generate -DgroupId=com.hybris.datahub -DartifactId=custom-proxy -DarchetypeArtifactId=maven-archetype-quicks

4. Import the new Data Hub extension with existing maven project into your IDE.

5. Create the custom-proxy-datahub-extension.xml le in the custom-proxy project:

custom-proxy/src/main/resources/META-INF/custom-proxy-datahub-extension.xml

<extension xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.hybris.com/schema/"


xsi:schemaLocation="http://www.hybris.com/schema/datahub-metadata-schema-1.1.1.xsd" name="custom-proxy">
</extension>

6. Create the custom-proxy-datahub-extension-spring.xml le in the custom-proxy project:

custom-proxy/src/main/resources/META-INF/custom-proxy-datahub-extension-spring.xml

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://cxf.apache.org/core"
xmlns:sec="http://cxf.apache.org/configuration/security"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:http="http://cxf.apache.org/transports/http/configuration"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http
http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-co

<context:annotation-config />

<http:conduit name="*.http-conduit">
<http:authorization>
<sec:UserName>${datahub.c4c.userName}</sec:UserName>
<sec:Password>${datahub.c4c.password}</sec:Password>
<sec:AuthorizationType>Basic</sec:AuthorizationType>
</http:authorization>
<http:client AutoRedirect="true"
Connection="Keep-Alive"
ProxyServer="${datahub.c4c.proxyServer}"
ProxyServerPort="${datahub.c4c.proxyServerPort}"
NonProxyHosts="localhost|127.0.0.1"
AllowChunking="false" />
</http:conduit>
</beans>

 Caution
Pay attention to the <http:conduit> tag as it contains conduit con gurations. The name="*.http-conduit" code means this con guration is
applied to all CXF clients including our client used for SAP Cloud for Customer communication. In our example, we have added basic authentication and
proxy server. This proxy is not used if client points to localhost or to 127.0.0.1. You can nd more details about <http:conduit> here:
http://cxf.apache.org/docs/client-http-transport-including-ssl-support#ClientHTTPTransport%28includingSSLsupport%29-Theconduitelement

7. Modify the pom.xml le:

custom-proxy/pom.xml

<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"


xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.hybris.datahub</groupId>
<artifactId>custom-proxy</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>custom-proxy</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

8. In <HYBRIS_HOME>/hybris/bin/custom/custom-proxy, execute this command: mvn clean package.

9. Copy the <HYBRIS_HOME>/hybris/bin/custom/custom-proxy/target/custom-proxy-1.0-SNAPSHOT.jar le to the lib folder of the


Data Hub extensions.

For the embedded version of Data Hub, the path is: <HYBRIS_HOME>/hybris/bin/platform/tomcat/lib/ .

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 55/99
3/5/2020
10. Restart the server.

c4c-integration-soap-schema Extension
The c4c-integration-soap-schema extension compiles the C4C generated WSDL le and produces JAXB classes that can be used by other extensions.

General
The c4c-integration-soap-schema holds JAXB objects generated upon the provided C4C WSDL de nition. Other extensions like c4c-integration-
mock or c4c-integration-soap-adapter can then use these objects to build C4C tags. This extension does not hold any other extra information, that is
why either c4c-integration-soap-schema/src/main/resources/META-INF/c4c-integration-soap-schema-datahub-extension.xml
and c4c-integration-soap-schema/src/main/resources/META-INF/c4c-integration-soap-schema-datahub-extension-
spring.xml are empty:

<extension xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.hybris.com/schema/"


xsi:schemaLocation="http://www.hybris.com/schema/datahub-metadata-schema-1.1.1.xsd"
name="c4c-integration-soap-schema">

<dependencies>
</dependencies>

</extension>

<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"


xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">

<context:annotation-config/>
</beans>

Generation of JAXB Classes


The generation occurs at compilation time by Maven using Apache-CXF's wsdl2java tool. Take a look into the provided c4c-integration-soap-
schema/pom.xml le and pay attention to the CXF plugin con guration:

<?xml version="1.0" encoding="UTF-8"?>


<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

... project configuration ...

<build>
<plugins>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${org.apache.cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>wsdl2java</goal>
</goals>
<configuration>
<sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/META-INF/wsdl/business-partner-replication.wsdl</wsdl>
<extraargs>
<extraarg>-mark-generated</extraarg>
<extraarg>-p</extraarg>
<extraarg>http://sap.com/xi/A1S/Global=com.hybris.datahub.c4c.adapter.schema.com.sap.xi.

... extra args ...

</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 56/99
3/5/2020

sapsoapinboundadapter Data Hub Extension


The sapsoapinboundadapter Data Hub extension provides a Spring integration end point to receive SOAP XMLs from any external system. It also provides the
Spring integration ow de nition to route incoming SOAP XML to raw models in Data Hub.

The sapsoapinboundadapter extension includes the following primary components:

HttpInboundService

Spring Integration

SoapMappingService

HttpInboundService
This service receives SOAP request and sends Spring integration XML messages for them to the Spring integration channel.

The endpoint URL for this webservice is: http://<domain>:<port>/<context eg. datahub-webapp>/v1/soap/receiver

This webservice:

receives POST requests in the form of SOAP XML

extracts SOAP BODY from the XML

extracts root node from SOAP BODY into channel header MESSAGE_TYPE which is then used for routing the request XML to correct Spring Integration
Channel.

Spring Integration
Map SOAP XMLs with different Message Types to the Corresponding Mapping Services- HEADER-VALUE-ROUTER.

The sapsoapinboundadapter-datahub-extension-spring.xml le contains a HEADER-VALUE-ROUTER for the header attribute MESSAGE_TYPE.


This router maps the received XML to the corresponding mapping service classes, depending on the value of the header attribute MESSAGE_TYPE.

The following shows the HEADER-VALUE-ROUTER for the MESSAGE_TYPE header attribute:

<!-- Maps received XML by value of header attribute: "MESSAGE_TYPE" to corresponding mapping service -->
<int:header-value-router id="soapRouter" input-channel="soapXmlInboundChannel" header-name="MESSAGE_TYPE">
<int:mapping value="SalesOrderRequestMassRequest" channel="quoteInboundChannel" />
</int:header-value-router>

Service Activator
The corresponding mapping service is mapped to the different channels via the service activator, and the map method is called.

The following shows a service activator for a corresponding mapping service:

<int:service-activator id="quoteInboundServiceActivator"
input-channel="quoteInboundChannel" output-channel="rawFragmentDataInputChannel" ref="quoteInboundDefaultSoapMap

If a non-supported MESSAGE_TYPE value is detected, a service activator is available for logging. In this case, the log method is called.

<bean id="quoteInboundDefaultSoapMappingService"
class="com.hybris.datahub.sapsoapinboundadapter.DummyMappingService" />

SoapMappingService
SoapMappingService maps SOAP XML Body elements to raw item data. It contains an implementation of the map method required by the service-activator to
transform an XML le into a list of RawFragmentData.

Each segment and attribute name is concatenated using the "/" separator to create the raw item attribute name.

SoapMappingService contains the following properties:

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 57/99
3/5/2020
rawFragmentDataExtensionSource: Specify the RawFragmentData.setExtensionSource (extensionSource string).

rawFragmentDataFeedName: Specify the RawFragmentData.setDataFeedName (dataFeedName string).

rawFragmentDataType: Specify the RawFragmentData.setType (type string).

Bean De nition Example:

<bean id="quoteInboundDefaultSoapMappingService"
class="com.hybris.datahub.sapsoapinboundadapter.SoapMappingService">
<property name="rawFragmentDataExtensionSource" value="c4cquote" />
<property name="rawFragmentDataFeedName" value="SAPC4CQUOTE_INBOUND_FEED" />
<property name="rawFragmentDataType" value="RawHybrisQuoteInbound" />
</bean> >

RawItem Mapping Usage:

Mapping Service class to generate RawItems from SOAP XMLs.


SOAP Request XML
<n0:SalesOrderRequestMassRequest
xmlns:n0="http://sap.com/xi/SAPGlobal20/Global" xmlns:prx="urn:sap.com:proxy:QXL:/1SAI/TAS0749A78CDF35720044BD:804">
<MessageHeader>
<CreationDateTime>2017-03-30T08:44:06.229839Z</CreationDateTime>
<SenderParty>
<InternalID schemeID="CommunicationSystemID" schemeAgencyID="310">0LO7ESC</InternalID>
</SenderParty>
</MessageHeader>
...
</n0:SalesOrderRequestMassRequest>

Corresponding Raw XML


...
<attribute>
<name>n0:SalesOrderRequestMassRequest/MessageHeader/ID</name>
</attribute>
<attribute>
<name>n0:SalesOrderRequestMassRequest/MessageHeader/SenderParty/InternalID/schemeID</name>
</attribute>

c4cquote Data Hub Extensions


The c4cquote Data Hub extensions provide the integration content to connect a SAP Commerce core installation with an SAP C4C system for quote processing.

These extensions are mandatory for asynchronous quote processing. The extensions are c4cquote-raw, c4cquote-canonical, and c4cquote-target.
The extensions perform the following:

Create SOAP payloads and send them to the SAP back-end to replicate SAP Commerce quotes.

Dependencies:

c4c-integration-canonical

Overview
The following graphic gives an overview of the quote-related integration between SAP Commerce and an SAP C4C system via Data Hub.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 58/99
3/5/2020

The quotes created in SAP Commerce are sent as CSV les to Data Hub, which stores them as raw items. During composition, the raw items are converted into
canonical quotes and subordinate items. During publication, the canonical quotes are converted into target items that correspond to SOAP payload (see
sapidocoutboundadapter Data Hub extension). Using the SOAP outbound adapter, the corresponding target items are assembled in SOAP payload and are
sent as XML over HTTP(S) to the back-end, which starts quote processing.

When the system replicates sales quotes from SAP Commerce to the back-end, quotes are created automatically in the back-end.

When the quote is updated in SAP C4C, it sends SOAP payload as XML over HTTP(S) to the Data Hub. After composition and publication, Data Hub sends impex as
a le to SAP Commerce, which updates the quote in SAP Commerce automatically.

The c4cquote Data Hub extensions contain the raw, canonical, and target item de nitions.

Outbound Flow

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 59/99
3/5/2020

Inbound Flow

Raw Items
RawHybrisQuote

This represents a quote coming from SAP Commerce. It contains all subordinate information (quote entries, partner details, pricing details).

RawHybrisQuoteInbound

This represents a quote coming from SAP C4C. It contains all subordinate information (quote entries, partner details, pricing details).

RawHybrisQuoteCon rmationInbound

This represents a quote con rmation coming from SAP C4C after successful creation of quote in SAP C4C.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 60/99
3/5/2020
Composition Handler
QuoteIDCompositionHandler: This handler is used to append zeros to the quote ID.

Canonical Items
The canonical items in this context are designed to facilitate the mapping between the SAP Commerce domain model and the domain model in the SAP back-end.

CanonicalQuote

This represents the quote header. In addition to the expected attributes (quote ID, name, currency, and so on), the store name and the channel (B2B or B2C) are
also stored. The store name is used during publication, to infer store-speci c con guration properties (transaction type, sales area).

CanonicalQuoteItem

This represents one item or entry of a quote. Like all subordinate objects of a quote, the quote ID is part of the (compound) key. The entry number is the same as in
SAP Commerce.

CanonicalQuotePartnerRole

This represents a partner role for a quote such as sold-to, bill-to, and so on. Each role may have a separate partner attached, and can occur at most once. The
encoding of the role ( eld partnerRoleCode) is already in line with the scheme in the SAP back-end:

AG: sold-to

RE: bill-to

WE: ship-to

AP: contact person

CanonicalQuoteInbound

This represents the quote header. In addition to the expected attributes (quote ID, name, currency, and so on), the store name and the channel (B2B or B2C) are
also stored. The store name is used during publication, to infer store-speci c con guration properties (transaction type, sales area).

CanonicalQuoteItemInbound

This represents one item or entry of a quote. Like all subordinate objects of a quote, the quote ID is part of the (compound) key. The entry number is the same as in
SAP Commerce.

CanonicalQuoteCommentInboundItem

This represents comment made by processor coming from SAP C4C related to quote.

CanonicalQuoteCon rmationInbound

This represents con rmation of quote created in SAP C4C.

CanonicalQuoteItemPriceComponent

This represents product price/discounts related to item based on condition type.

CanonicalQuotePriceComponent

This represents quote price/discounts related to header based on condition type.

CanonicalQuoteInboundParty

This represents employee responsible for the quote.

Target Items
The c4cquote-target extension models information that comes from the source systems, in this case from the c4cquote-canonical extension. The
following target items are de ned (see c4cquote-target-datahub-extension.xml for each target item de nition):

QuoteItem/TargetQuoteItem: Contains the quote header information

QuoteEntryItem/TargetQuoteEntryItem: Contains the entry level/line item details

QuotePartnerItem: Contains the partner details

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 61/99
3/5/2020
TargetQuoteCommentItem: Contains comments details

TargetQuoteCon rmation: Contains quote con rmation details

TargetQuoteItemBasePriceComponent: Contains quote item price details

TargetQuoteBasePriceComponent: Contains quote header price details

TargetItemDiscountPriceComponent: Contains quote item discount details

TargetDiscountPriceComponent: Contains quote header discount details

TargetQuoteInboundParty: Contains employee details responsible for quote

PublicationHandler
QuoteCommentGroupingHandler: This handler is used to lter out new comments coming from SAP C4C.

DetermineQuoteSellerParty: This handler is used to nd seller party related to quote.

QuoteDiscountGroupingHandler: This handler is used to lter out discount component out of multiple price components.

QuoteUserTypeGroupingHandler: This handler is used to lter out inbound party for the quote.

<extension xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.hybris.com/schema/"
xsi:schemaLocation="http://www.hybris.com/schema/ http://www.hybris.com/schema/datahub-metadata-schema-1.3.0.xsd"
name="c4cquote-target">

<dependencies>
<dependency>
... dependencies between Data Hub extensions ...
</dependency>
</dependencies>

<targetSystems>

<targetSystem>
<name>C4CSoapQuoteTargetSystem</name>
<type>C4C_QUOTE_SOAP_JAXWS</type>
<exportURL>${datahub.c4c.quote.exportURL}</exportURL>
<userName>${datahub.c4c.quote.userName}</userName>
<password>${datahub.c4c.quote.password}</password>
<targetItems>
... some target item definitions ...
</targetItems>

</targetSystem>
</targetSystems>
</extension>

The idea behind this is to de ne the C4C_QUOTE_SOAP_JAXWS target system. The system is mapped against an existing adapter implementation and the adapter
maps against this value. For more information, see the c4cquote-soap-adapter Extension.

Publication
You can create a target item only by triggering the InitiatePublicationEvent event. A simple way to trigger this publication is to call the following REST
address:

POST: http://localhost:8080/datahub-webapp/v1/pools/SAPC4CQUOTE_OUTBOUND_POOL/publications

Body : {"targetSystemPublications":[{"targetSystemName":"C4CSoapTargetSystem"}]}

Feeds and Pools

Feed Pool Description

SAPC4CQUOTE_OUTBOUND_FEED SAPC4CQUOTE_OUTBOUND_POOL Feed for SAP Commerce quote replication from SAP
Commerce to back-end.

SAPC4CQUOTE_INBOUND_FEED SAPC4CQUOTE_INBOUND_POOL Feed for SAP quote replication from SAP C4C back-end
to SAP Commerce.

c4cquote-soap-schema Extension
The c4cquote-soap-schema extension compiles the C4C generated WSDL le and produces JAXB classes that can be used by other extensions.

General
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 62/99
3/5/2020
The c4cquote-soap-schema extension holds JAXB objects generated upon the provided WSDL les which are generated by C4C. c4cquote-soap-
adapter extension uses the generated JAXB objects to build SOAP request tags. This extension does not hold any other information, that is why either
c4cquote-soap-schema/src/main/resources/META-INF/c4cquote-soap-schema-datahub-extension-spring.xml or c4cquote-
soap-schema/src/main/resources/META-INF/c4cquote-soap-schema-datahub-extension.xml le is empty.

Generation of JAXB Classes


The generation occurs during compilation by Maven using Apache-CXF's wsdl2java tool. Take a look into the provided c4cquote-soap-schema/pom.xml le.

<?xml version="1.0">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
... extra config ...
<build>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${org.apache.cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>wsdl2java</goal>
</goals>
<configuration>
<sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/META-INF/wsdl/CustomerOrderReplication
<extraargs>
<extraarg>-p</extraarg>
<extraarg>http://sap.com/xi/A1S/Global=com.sap.datahub.c4c.adapter.schema.
<extraarg>-p</extraarg>
<extraarg>http://sap.com/xi/BASIS/Global=com.sap.datahub.c4c.adapter.schem
<extraarg>-p</extraarg>
<extraarg>http://sap.com/xi/SAPGlobal20/Global=com.sap.datahub.c4c.adapter
<extraarg>-p</extraarg>
<extraarg>http://sap.com/xi/AP/Common/Global=com.sap.datahub.c4c.adapter.s
<extraarg>-p</extraarg>
<extraarg>http://sap.com/xi/AP/Common/GDT=com.sap.datahub.c4c.adapter.sche
<extraarg>-p</extraarg>
<extraarg>http://sap.com/xi/Common/DataTypes=com.sap.datahub.c4c.adapter.s
<extraarg>-p</extraarg>
<extraarg>http://sap.com/xi/AP/FO/Activity/Global=com.sap.datahub.c4c.adap
<extraarg>-p</extraarg>
<extraarg>http://sap.com/xi/AP/CRM/Global=com.sap.datahub.c4c.adapter.sche
<extraarg>-p</extraarg>
<extraarg>http://xiTest.com/xi/test=com.sap.datahub.c4c.adapter.schema.com
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
</execution>
<execution>
<id>generate-sources-approval-notification</id>
<phase>generate-sources</phase>
<goals>
<goal>wsdl2java</goal>
</goals>
<configuration>
<sourceRoot>${project.build.directory}/generated/cxf/notification</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/META-INF/wsdl/CustomerQuoteProcessingU
<extraargs>
<extraarg>-p</extraarg>
<extraarg>http://sap.com/xi/BASIS/Global=com.sap.datahub.c4c.adapter.schem
<extraarg>-p</extraarg>
<extraarg>http://sap.com/xi/SAPGlobal20/Global=com.sap.datahub.c4c.adapter
<extraarg>-p</extraarg>
<extraarg>http://sap.com/xi/AP/Common/Global=com.sap.datahub.c4c.adapter.s
<extraarg>-p</extraarg>
<extraarg>http://sap.com/xi/AP/Common/GDT=com.sap.datahub.c4c.adapter.sche
<extraarg>-p</extraarg>
<extraarg>http://sap.com/xi/Common/DataTypes=com.sap.datahub.c4c.adapter.s
<extraarg>-p</extraarg>
<extraarg>http://sap.com/xi/AP/CRM/Global=com.sap.datahub.c4c.adapter.sche
<extraarg>-p</extraarg>
<extraarg>http://xiTest.com/xi/test=com.sap.datahub.c4c.adapter.schema.not
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
</execution>
</executions>
</plugin>
</build>
</project>

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 63/99
3/5/2020
This con guration generates JAXB and JAXWS classes that are used by the SOAP adapter. To be able to open the project and view generated classes in eclipse, you
should compile the project once.

c4cquote-soap-adapter Extension
The c4cquote-soap-adapter extension creates quote SOAP request and quote approval noti cation SOAP request that can be processed by SAP Cloud for
Customer.

General
The c4cquote-soap-adapter extension is designed to create quote SOAP request and quote approval noti cation SOAP request that SAP C4C can process.
This extension is created to process the information that comes from the target items, in this case from c4cquote-target extension.

A way to map c4cquote-soap-adapter with the target system de ned in c4cquote-target is done in the spring con guration le: c4cquote-soap-
adapter/src/main/resources/META-INF/c4cquote-soap-adapter-datahub-extension-spring.xml.

Con guration:

<beans xmlns="http://www.springframework.org/schema/beans">
<bean name="c4cQuoteSoapAdapter" class="com.sap.datahub.c4c.adapter.soapadapter.core.C4cSoapAdapter">
<property name="targetSystemType" value="C4C_QUOTE_SOAP_JAXWS" />
... other properties...
</bean>
</beans>

The C4C_QUOTE_SOAP_JAXWS value registers the c4cquote-soap-adapter in Data Hub against the con guration that was de ned within c4cquote-
target.

The Big Picture

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 64/99
3/5/2020

Where:

AdapterService : A Data Hub interface used to de ne outbound adapters.

CustomerOrderReplicationIn: A JAXB interface created automatically after compiling /c4cquote-soap-


schema/src/main/resources/META-INF/wsdl/CustomerOrderReplicationIn.wsdl. It de nes the C4C SOAP service to be reached.

CustomerQuoteProcessingUpdatingSalesQuoteWithSalesOrderIn: A JAXB interface created automatically after compiling /c4cquote-


soap-schema/src/main/resources/META-INF/wsdl/ CustomerQuoteProcessingUpdati1.wsdl. It de nes the C4C SOAP service to be
reached.

ApacheCxfSoapClientProxy: a class created on the y by apache CXF. It represents the actual SOAP client that access the C4C SOAP Service.

Interceptor, PhaseInterceptor, AbstractPhaseInterceptor: Apache CXF interceptor classes that allow modi cation of SOAP message.

Publication Process

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 65/99
3/5/2020

C4cQuoteSoapAdapter: Handles any exception that comes from the publisher and if any, marks the publication as FAILURE, otherwise as SUCCESS.

C4cQuoteSoapPublisher: In charge of processing and converting target items into SAP C4C speci c objects.

C4cQuoteSoapProcessor: Creates the quote and quote approval noti cation SOAP requests and sends it to SAP C4C.

C4cQuoteSoapPublisher

Current implementation: DefaultC4cQuoteSoapPublisher processes the quote and quote approval noti cation target items. For processing the target
items, there are populators that transform the target items into SAP Cloud for Customer speci c objects.

Following are populators and handlers that create the C4C speci c objects:

DefaultQuotePopulator: Populates data from QuoteItem which mainly contains the header data for quote in C4C

DefaultQuoteEntryPopulator: Populates data from QuoteEntryItem which mainly contains the item data for quote in C4C.

DefaultQuoteCommentPopulator: Populates data from QuoteCommentItem which contains the notes data for quote in C4C.

DefaultQuotePartnerHandler: Populates data from QuotePartnerItem which contains the customer data for quote in C4C.

DefaultQuoteApprovalNotificationHandler: Populates data from QuoteApprovalNoti cationItem which contains approval noti cation data for
quote in C4C.

While processing the target items, CustomerOrderRequestRequest and SalesOrderNotification are populated by populators and handlers and are
set in ProcessContext.

C4cQuoteSoapProcessor
The current implementation of DefaultC4cQuoteSoapProcessor uses JAX-WS SOAP clients that are created against the following WSDL les:

c4cquote-soap-schema/src/main/resources/META-INF/wsdl/CustomerOrderReplicationIn.wsdl

c4cquote-soap-schema/src/main/resources/META-INF/wsdl/CustomerQuoteProcessingUpdati1.wsdl

The JAX-WS clients are con gured within spring in the following le: c4cquote-soap-adapter/src/main/resources/META-INF/c4cquote-soap-
adapter-datahub-extension-spring.xml.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 66/99
3/5/2020

<beans xmlns="http://www.springframework.org/schema/beans">
... some other spring beans ...
<jaxws:client id="quoteReplicationClient" serviceClass="com.sap.datahub.c4c.adapter.schema.com.sap.xi.ap.crm.globa
... some other properties ...
</jaxws:client>
<jaxws:client id="quoteApprovalClient" serviceClass="com.sap.datahub.c4c.adapter.schema.notification.com.sap.xi.ap.crm.global.C
... some other properties ...
</jaxws:client>
... some other spring beans ...
</beans>

The above beans are attached to the DefaultC4cQuoteSoapProcessor and are used for reaching the C4C SOAP endpoint.

<beans xmlns="http://www.springframework.org/schema/beans">

... some other spring beans ...


<bean name="defaultC4cQuoteSoapProcessor" class="com.sap.datahub.c4c.adapter.soapadapter.processor.soap.impl.DefaultC4cQuoteSoap
<lookup-method name="getQuoteRequestClient" bean="quoteReplicationClient" />
<lookup-method name="getQuoteApprovalClient" bean="quoteApprovalClient" />
... some other properties ...
</bean>

... some other spring beans ...


</beans>

Creating a Data Hub Proxy Extension


During C4C integration, creating a Data Hub proxy extension is needed. To create the proxy, see the Creating a Data Hub Proxy Extension topic.

Party De nition
C4C expects SenderParty and RecipientParty which are part of the request message header. These two elds are resolved based on the pool name where
the target items are contained and queries the local con guration looking for the values to be applied. For more information about DATA_FEED and POOL_NAME
con guration, see Feeds and Pools.

For instance, if the target items are contained in SAPC4CQUOTE_OUTBOUND_POOL pool, then properties should be de ned as shown below:

datahub.c4c.senderParty.schemeID.SAPC4CQUOTE_OUTBOUND_POOL=CommunicationSystemID
datahub.c4c.senderParty.internalID.SAPC4CQUOTE_OUTBOUND_POOL=HYBRISINT
datahub.c4c.senderParty.schemeAgencyID.SAPC4CQUOTE_OUTBOUND_POOL=310
datahub.c4c.recipientParty.schemeID.SAPC4CQUOTE_OUTBOUND_POOL=LocalSystemID
datahub.c4c.recipientParty.internalID.SAPC4CQUOTE_OUTBOUND_POOL= 0LO7ESC
datahub.c4c.recipientParty.schemeAgencyID.SAPC4CQUOTE_OUTBOUND_POOL=310

This generates the following tags:

<SenderParty>
<InternalID schemeID="CommunicationSystemID"schemeAgencyID="310">
HYBRISINT
</InternalID>
</SenderParty>
<RecipientParty>
<InternalID schemeID="LocalSystemID"schemeAgencyID="310">
0LO7ESC
</InternalID>
</RecipientParty>

QuoteMessageIdInterceptor
This Apache CXF interceptor modi es the endpoint URL. The interceptor uses the same ID that is generated for the request UUID. For instance, based on the
following payload:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns4:CustomerOrderRequestMassRequest xmlns:ns4="http://sap.com/xi/SAPGlobal20/Global">
<MessageHeader>
<ID>729349E61DED4D0FBCF1D7CFA9D79136</ID>
<UUID>729349E6-1DED-4D0F-BCF1-D7CFA9D79136</UUID>
<CreationDateTime>2017-03-22T14:06:25.243Z</CreationDateTime>
<SenderParty>
<InternalID schemeID="CommunicationSystemID" schemeAgencyID="310">HYBRISINT</InternalID>
</SenderParty>
<RecipientParty>
<InternalID schemeID="LocalSystemID" schemeAgencyID="310">0LO7ESC</InternalID>

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 67/99
3/5/2020
</RecipientParty>
</MessageHeader>
<CustomerOrderRequest>
... quote info ...
</CustomerOrderRequest>
</ns4:CustomerOrderRequestMassRequest>
</soap:Body>
</soap:Envelope>

For example:

The UUID is: 729349E6-1DED-4D0F-BCF1-D7CFA9D79136. This value is added to the endpoint in a way that the SOAP end-point address is:

https://qxl-cust238.dev.sapbydesign.com/sap/bc/srt/scs/sap/customerorderreplicationin?MessageId=729349E6-1DED-4D0F-BCF1-D7CFA9D7

QuoteApprovalMessageIdInterceptor
This Apache CXF interceptor modi es the endpoint URL. The interceptor uses the same ID that is generated for the request UUID. For instance, based on the
following payload:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns4:SalesOrderMassNotification xmlns:ns4="http://sap.com/xi/SAPGlobal20/Global">
<MessageHeader>
<ID>729349E61DED4D0FBCF1D7CFA9D79136</ID>
<UUID>729349E6-1DED-4D0F-BCF1-D7CFA9D79136</UUID>
<CreationDateTime>2017-03-22T14:06:25.243Z</CreationDateTime>
<SenderParty>
<InternalID schemeID="CommunicationSystemID" schemeAgencyID="310">HYBRISINT</InternalID>
</SenderParty>
<RecipientParty>
<InternalID schemeID="LocalSystemID" schemeAgencyID="310">0LO7ESC</InternalID>
</RecipientParty>
</MessageHeader>
<SalesOrderNotification>
... quote approval notification info ...
</SalesOrderNotification>
</ns4:SalesOrderMassNotification>
</soap:Body>
</soap:Envelope>

For example:

The UUID is: 729349E6-1DED-4D0F-BCF1-D7CFA9D79136. This value is added to the endpoint, in a way that the SOAP endpoint address is:

https://qxl-cust238.dev.sapbydesign.com/sap/bc/srt/scs/sap/customerquoteprocessingupdati1?MessageId=729349E6-1DED-4D0F-BCF1-D7CF

C4C Quote SOAP Request

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 68/99
3/5/2020

Following is the complete quote SOAP request that is sent to C4C:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns4:CustomerOrderRequestMassRequest xmlns:ns3="http://sap.com/xi/AP/Common/Global" xmlns:ns2="http://xiTest.com
<MessageHeader>
<ID>ECB7633319F342409334D2C402ADB25A</ID>
<UUID>ECB76333-19F3-4240-9334-D2C402ADB25A</UUID>
<CreationDateTime>2017-04-19T10:30:28.896Z</CreationDateTime>
<SenderParty>
<InternalID schemeID="CommunicationSystemID" schemeAgencyID="310">HYBRISINT</InternalID>
</SenderParty>
<RecipientParty>
<InternalID schemeID="LocalSystemID" schemeAgencyID="310">0LO7ESC</InternalID>
</RecipientParty>
</MessageHeader>
<CustomerOrderRequest>
<CustomerOrderRequest otherPartyListCompleteTransmissionIndicator="true" itemCompleteTransmissio
<ID>0006200354</ID> <--
<SenderSequenceNumberValue>20170419160028</SenderSequenceNumberValue>
<ProcessingTypeCode>ZAGR</ProcessingTypeCode> <--
<Name>Quote from hybris</Name>
<BuyerID>0006200354</BuyerID>
<BuyerParty>
<RoleCode>AG</RoleCode>
<OtherID>
<ID>0000000592</ID>
<IDType>918</IDType>
<LogicalSystemID>Q5ECLNT004</LogicalSystemID>
</OtherID>
</BuyerParty>
<BillToParty>
<RoleCode>RE</RoleCode>
<OtherID>
<ID>0000000592</ID>
<IDType>918</IDType>
<LogicalSystemID>Q5ECLNT004</LogicalSystemID>
</OtherID>
</BillToParty>
<ProductRecepient>
<RoleCode>WE</RoleCode>
<OtherID>
<ID>0000000592</ID>
<IDType>918</IDType>
<LogicalSystemID>Q5ECLNT004</LogicalSystemID>
</OtherID>
</ProductRecepient>
<SalesBusinessArea>
<SalesOrganisationID/>
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 69/99
3/5/2020
<DistributionChannelCode>01</DistributionChannelCode>
<DivisionCode>00</DivisionCode>
<SalesOrganisationOtherID>
<ID>1000</ID>
<LogicalSystemID>Q5ECLNT004</LogicalSystemID>
</SalesOrganisationOtherID>
</SalesBusinessArea>
<PricingTerms>
<CurrencyCode>EUR</CurrencyCode>
</PricingTerms>
<TextCollection textListCompleteTransmissionIndicator="false">
<Text actionCode="01">
<TypeCode>10008</TypeCode>
<ContentText languageCode="EN">Please give 5% discount</ContentText>
</Text>
</TextCollection>
<Item actionCode="04" scheduleLineCompleteTransmissionIndicator="true" ItemCustomDefined
<ID>10</ID>
<Description>Demo #9999</Description>
<ItemProduct>
<ProductOtherID>
<ID>MDECC-DS01</ID>
<LogicalSystemID>Q5ECLNT004</LogicalSystemID>
</ProductOtherID>
</ItemProduct>
<ScheduleLine>
<ScheduleLineID>0001</ScheduleLineID>
<TypeCode>1</TypeCode>
<Quantity unitCode="EA">10</Quantity>
</ScheduleLine>
</Item>
</CustomerOrderRequest>
</CustomerOrderRequest>
</ns4:CustomerOrderRequestMassRequest>
</soap:Body>
</soap:Envelope>

Following is the complete quote approval noti cation SOAP request that is sent to C4C:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:glob="http://sap.com/xi/SAPGlobal20/Global" xm


<soapenv:Header/>
<soapenv:Body>
<glob:SalesOrderMassNotification>
<MessageHeader>
<ID>4C92394B478C11E7B73F000000733A3E</ID>
<UUID>4C92394B-478C-11E7-B73F-000000733A3E</UUID>
<CreationDateTime>2017-06-05T07:09:53Z</CreationDateTime>
<SenderParty>
<InternalID schemeAgencyID="310" schemeID="CommunicationSystemID">HYBRIS_LOCAL</InternalID> <-- Sender Par
</SenderParty>
<RecipientParty>
<InternalID schemeAgencyID="310" schemeID="LocalSystemID">0LO7FQ0</InternalID> <--
</RecipientParty>
</MessageHeader>
<SalesOrderNotification>
<MessageHeader>
<ID>0000000000003373</ID>
</MessageHeader>
<SalesOrder businessTransactionDocumentReferenceListCompleteTransmissionIndicator="false" itemListCompleteTransmissi
<ID schemeID="Q5ECLNT004">29806940</ID>
<TypeCode>114</TypeCode>
<BusinessTransactionDocumentReference actionCode="04">
<ID>6940</ID>
<TypeCode>30</TypeCode>
</BusinessTransactionDocumentReference>
</SalesOrder>
</SalesOrderNotification>
</glob:SalesOrderMassNotification>
</soapenv:Body>
</soapenv:Envelope>

c4ccpiquote Extension
The c4ccpiquote extension is responsible for the integration of quote management services between SAP Commerce and SAP Cloud for Customer.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 70/99
3/5/2020
Overview
The c4ccpiquote extension provides the following functionalities:

Create and edit quotes

Release quote to customer

Cancel and accept quotes

 Note
This content is only relevant if you have the latest Commerce Cloud Extension Pack, see Commerce Cloud Extension Pack. The Commerce Cloud Extension Pack
can only be used with SAP Commerce Cloud in the Public Cloud.

Getting Started
Follow the instructions below to integrate quote management services between SAP Commerce and SAP Cloud for Customer:

1. Add all the dependent extensions in localextensions.xml le.

2. Add the extension c4ccpiquote in localextensions.xml.

3. Perform ant clean all.

4. Start the server,and then in SAP Commerce Administration Cockpit initialize SAP Commerce.

Dependencies
The c4ccpiquote extension depends on the following extensions:

commerceservices (commerceservices-module)

integrationservices (mdm-integration-apis-module)

outboundservices (mdm-integration-apis-module)

inboundservices (mdm-integration-apis-module)

sapcpiadapter (sap-scpi-module)

saporderexchange (sap-asynchronosOM-module)

odata2webservices (mdm-integration-apis-module)

b2bacceleratorservices (b2b-accelerator-module)

sapmodel (sap-model-module)

Create and Edit Quotes


The creation or update of a quote, processed by a sales representative, is an asynchronous process. A quote created or updated in SAP Commerce is sent to the
Outbound Quote integration ow deployed in SAP Cloud Platform Integration. This iFlow sends the request for a quote to SAP Cloud for Customer.

The service DefaultSapCpiC4CQuoteService publishes an event SapC4CCpiQuoteBuyerSubmitEvent when a B2B customer creates or updates a
quote from the B2B storefront. The SapC4CCpiQuoteBuyerSubmitEventListener handles the event and starts the process sap-cpi-c4cquote-
buyer-submit-process.

The sap-cpi-c4cquote-buyer-submit-process has the following action class:

SapCpiSendC4CQuoteAction

This action class triggers DefaultSapCpiOutboundC4CQuoteConversionService to convert QuoteModel object to


SAPC4CCpiOutboundQuoteModel object and sends the object to the iFlow deployed in SAP Cloud Platform Integration. Outbound quote integration ow
(CommerceQuoteOutbound) receives the quote and sends it to SAP Cloud for Customer.

The sendQuote method in this class takes SAPC4CCpiOutboundQuoteModel and sends it to SAP Cloud for Customer with the help of
DefaultOutboundServiceFacade in the outboundservices extension.

The convertQuoteToSapCpiQuote method of DefaultSapCpiOutboundC4CQuoteConversionService is responsible for converting


QuoteModel object to SAPC4CCpiOutboundQuoteModel object.

Once the quote is replicated to SAP Cloud for Customer, a con rmation is sent to SAP Commerce along with the external ID via SAP Cloud Platform
Integration. The inbound iFlow (CommerceQuoteCon rmationInbound) receives and processes the payload and sends it to SAP Commerce which further
updates the quote with the external quote ID.

Release Quote to Customer

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 71/99
3/5/2020
A sales representative logs into SAP C4C. An XML payload containing this quote details is sent to SAP Commerce through SAP Cloud Platform Integration.

Following classes are executed for handling this quote inbound request:

SapCpiSalesQuoteInboundPrePersistHook

This pre-persist hook gets called by the integration object framework before persisting the quote object in SAP Commerce. The execute method of this class calls
the instance of C4CCpiInboundQuoteHelper and returns the updated quote object to the integration object framework, for persisting.

DefaultC4CCpiInboundQuoteHelper

This helper class is called by SapCpiSalesQuoteInboundPrePersistHook to do all the required processing of the quote object. The
processSalesInboundQuote is the entry point to this class.

New quote: quote is always created in SAP Commerce, and is sent to C4C to get the external price details and discounts

Existing quote: in this scenario the quote is rst created in SAP Commerce and is replicated in to C4C for the sales representative’s consideration. The
processSalesInboundQuote method replicates the existing version of the quote to create a new version, and processes header level comments,
discounts, and taxes.

Cancel and Accept Quotes


The canceling of a quote or accepting and creating an order from a quote, processed by a sales representative, is an asynchronous process.

DefaultSapCpiC4CQuoteService publishes an event SapC4CCpiQuoteCancelEvent when a B2B customer cancels a quote in the B2B
storefront. The SapC4CCpiQuoteCancelEventListener handles the event and starts the process sap-cpi-c4c-quote-post-
cancellation-process.

C4CCpiPlaceQuoteOrderMethodHook publishes an event SapC4CCpiQuoteBuyerOrderPlacedEvent when a B2B Customer accepts and


creates an order from a quote in the B2B storefront. The SapC4CCpiQuoteBuyerOrderPlacedEventListener handles the event and starts the
process sap-cpi-c4cquote-order-placed-process.

The sap-cpi-c4cquote-order-placed-process has the following action classes:

DefaultC4CCpiInboundQuoteOrderedHelper

This class is invoked when SAP Commerce receives an order con rmation from the back-end system. processOrderConfirmationFromHub is the entry
point to this class.

waitForERPConfirmation: this wait action waits for the event ERPOrderConfirmationEventForC4CQuote_orderCode to be triggered by
DefaultC4CCpiInboundQuoteOrderedHelper class, on receipt of the order con rmation noti cation from the back end. On this event trigger,
SendSalesQuoteToC4CAction is performed.

SendSalesQuoteToC4CAction

This action class triggers DefaultSapCpiOutboundC4CQuoteConversionService to convert QuoteModel object to


C4CSalesOrderNotificationModel object, and to send the object to the iFlow deployed in SAP Cloud Platform Integration. The outbound iFlow
(CommerceOrderNoti cationOutbound) receives the quote and sends it to SAP Cloud for Customer.

The sendOrderNotification method in this class takes C4CSalesOrderNotificationModel and sends it to SAP Cloud Platform Integration
with the help of DefaultOutboundServiceFacade in the outboundservices extension.

The convertQuoteToSalesOrderNotification method of DefaultSapCpiOutboundC4CQuoteConversionService is responsible for


converting QuoteModel object to C4CSalesOrderNotificationModel object.

Integration Object De nitions


The integration extensions in SAP Cloud Platform Integration contain an impex folder under the resources folder. The impex folder contains all the relevant
integration object de nitions. All the impex les are imported into the system when SAP Commerce is initialized or updated.

The c4ccpiquote extension contains the following integration objects:

Outbound:

C4COutboundQuote

C4COrderNoti cationOutbound

Inbound:

SalesInboundQuote

SalesQuoteCon rmationInbound

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 72/99
3/5/2020

SAP Cloud for Customer Integration Implementation


Make the required con gurations in SAP Commerce and SAP Cloud for Customer for the integration to take effect.

SAP Commerce - SAP Cloud for Customer Integration Guide


You can easily integrate the SAP Commerce with the SAP Cloud for Customer system.

SAP Commerce - SAP Cloud for Customer Integration


Guide
You can easily integrate the SAP Commerce with the SAP Cloud for Customer system.

Context
SAP Commerce supports the SAP Cloud for Customer solution integration. This integration is based on the following modules, extensions and functionalities:

Customer Ticketing Module

Assisted Service Module

SAML Single Sign On extension

Customer data replication

Commerce quote replication

There are several steps to the SAP Commerce - SAP Cloud for Customer Integration. Each step is described in the following documents:

Procedure
1. Installing SAP Commerce for SAP Cloud for Customer Integration

2. Integration Using SAP Cloud Platform Integration

3. Integrating the SAP Commerce Assisted Service Module with SAP Cloud Identity

4. Con guring SAP Cloud for Customer Integration

5. Testing SAP Cloud for Customer Integration

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 73/99
3/5/2020
Related Information
samlsinglesignon Extension

Installing SAP Commerce for SAP Cloud for Customer


Integration
Prior to using the SAP Commerce and SAP Cloud for Customer intergration, you have to ful ll several requirements and install the software.

The installation procedure is divided between topics which relate to the B2C or B2B scenarios. The documents present the steps necessary to install the SAP
Commerce with the SAP Cloud for Customer solution for each of the scenarios:

Business to Customer

Business to Business

Business to Customer
Prior to using the SAP Commerce and SAP Cloud for Customer integration, you have to ful ll several requirements and install the software.

This document presents the steps necessary to install the SAP Commerce with the SAP Cloud for Customer solution.

 Note
This document uses the {HYBRIS_HOME} term to refer to the directories created when you unzip the release .zip les .

Prerequisites
You need to perform several tasks in SAP Cloud for Customer prior to con guring SAP Commerce:

1. Create an employee.

2. Assign them either to the SERVICE_AGENT or SERVICE_MANAGER role, and set the business user password.

For information on creating employees and assigning roles in SAP Cloud for Customer solution, see the Create employees and Assign business roles to employees
sections: SAP Cloud for Customer Documentation: Create Employees on SAP Help Portal. For information on changing the business user password, see the related
links to access SAP Cloud for Customer Security Guide.

 Note
SAP Cloud for Customer users are replicated in the SAP Cloud Identity every 15 minutes. Once the user is transferred to the SAP Cloud Identity, you receive an
e-mail on the address that you provided during the creation of the employee.

SAP Commerce Installation


Perform the following steps:

1. Perform the steps described in the Download and Unpack Packages and Build the SAP Commerce sections of the Installation document.

2. Add the following extensions to your {HYBRIS_HOME} /hybris/config/localextensions.xml le:

<hybrisconfig xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='../bin/platform/resource


<extensions>
<path dir='${HYBRIS_BIN_DIR}' autoload='false' />
<extension name='backoffice' />
<extension name='commercesearchbackoffice' />
<extension name='commerceservicesbackoffice' />
<extension name='solrfacetsearchbackoffice' />
<extension name='solrserver' />
<extension name='yacceleratorcockpits' />
<extension name='yacceleratorinitialdata' />
<extension name='yacceleratorfulfilmentprocess' />
<extension name='yacceleratorstorefront' />
<extension name='yaddon' />
<extension name='ycommercewebservices' />
<extension name='electronicsstore' />
<extension name='apparelstore' />
<extension name='liveeditaddon' />
<extension name='acceleratorwebservicesaddon' />
<extension name='customerticketingaddon' />
<extension name='customerticketingc4cintegrationatddtests' />
<extension name='assistedservicestorefront' />

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 74/99
3/5/2020
<extension name='assistedserviceatddtests' />
<extension name='c4ccustomer' />
<extension name='y2ysyncbackoffice' />
<webapp contextroot='datahub' path='../../../../../installer/work/datahub-
</extensions>
</hybrisconfig>

For more information, see the following document:

Con guring Available Extensions

3. Install the necessary AddOns by running the following command from the {HYBRIS_HOME} /hybris/bin/platform directory:

 Note
Make sure to set up the Apache Ant environment by opening the setantenv.bat le in the command prompt.

ant addoninstall -Daddonnames="liveeditaddon,customerticketingaddon,assistedservicestorefront" -DaddonStorefront.yaccelera

ant addoninstall -Daddonnames="acceleratorwebservicesaddon" -DaddonStorefro

For more information, see the following documents:

customerticketingaddon AddOn

assistedservicestorefront AddOn

acceleratorwebservicesaddon AddOn

4. Navigate to the {HYBRIS_HOME} /hybris/config directory and open the local.properties le. Set the properties to the following:

#customerticketingc4cintegration.facade.mock=true
customerticketingc4cintegration.facade.mock=false
adminweb.webroot=/admin
# The number of catalog sync worker threads
# to speed up Catalog synchronization on multicore machines
# This property might be set to an expression. #cores variable will be subs
# by a number of available cores.
catalog.sync.workers=16
addonfilter.active=false
#######################################################
#######################################################
# samlsinglesignon properties:
# Specifies the location of the spring context file putted automatically to
samlsinglesignon.application-context=samlsinglesignon-spring.xml
# the user type for newly created user in hybris
sso.mapping.asagentgroup.usertype=Employee
# the user group mapping that is valid in hybris
sso.mapping.asagentgroup.groups=asagentsalesmanagergroup
# the user type for newly created user in hybris
sso.mapping.SALES_REP.usertype=Employee
# the user group mapping that is valid in hybris
sso.mapping.SALES_REP.groups=asagentsalesgroup
# the user type for newly created user in hybris
sso.mapping.SALES_MANAGER.usertype=Employee
# the user group mapping that is valid in hybris
sso.mapping.SALES_MANAGER.groups=asagentsalesmanagergroup
# the user type for newly created user in hybris
sso.mapping.SERVICE_AGENT.usertype=Employee
# the user group mapping that is valid in hybris
sso.mapping.SERVICE_AGENT.groups=asagentsalesgroup
# the user type for newly created user in hybris
sso.mapping.SERVICE_MANAGER.usertype=Employee
# the user group mapping that is valid in hybris
sso.mapping.SERVICE_MANAGER.groups=asagentsalesmanagergroup
# the default context to use to build the redirect URL for security reasons
sso.redirect.url=YOURVALUE
# cookie age in seconds
sso.cookie.max.age=60
# cookie path
sso.cookie.path=/
# cookie domain
sso.cookie.domain=
#generated token name, if empty then samlPassThroughToken will be used
sso.cookie.name=samlPassThroughToken
# default password encoding
sso.password.encoding=md5
sso.usergroup.attribute.key=usergroup
sso.firstname.attribute.key=first_name
sso.lastname.attribute.key=last_name
sso.userid.attribute.key=mail
#######################################################
#######################################################
# customerticketingc4cintegration properties:
customerticketingc4cintegration.facade.mock=false
# Specifies the location of the spring context file putted automatically to
customerticketingc4cintegration.application-context=customerticketingc4cin
customerticketingc4cintegration.c4c-url=YOURVALUE
customerticketingc4cintegration.c4c-batch-suffix=/$batch

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 75/99
3/5/2020
# ticketing part of url, used for listing, creating, retrieving tickets
customerticketingc4cintegration.c4c-ticket-suffix=/ServiceTicketCollection
customerticketingc4cintegration.c4c-token-url-suffix=?$top=1
customerticketingc4cintegration.c4c-accept=Application/json
customerticketingc4cintegration.c4c-username=YOURVALUE
customerticketingc4cintegration.c4c-password=YOURVALUE
customerticketingc4cintegration.c4c-token-naming=x-csrf-token
customerticketingc4cintegration.c4c-site-header=c4c-odata-businessSystemID
customerticketingc4cintegration.c4c-token-empty=fetch
customerticketingc4cintegration.c4c-expand-suffix=$expand=Notes,RelatedTra
customerticketingc4cintegration.c4c-update-message-suffix=/ServiceRequestTe
# Specifies the value of created-by field in Note object to be replaced by
customerticketingc4cintegration.displayname=YOURVALUE
customerticketingc4cintegration.siteId.electronics=YOURVALUE
customerticketingc4cintegration.siteId.electronics.type=b2c
customerticketingc4cintegration.siteId.testb2bSite.type=b2b

commerceservices.default.desktop.ui.experience=desktop
datahub.c4c.exportURL=YOURVALUE
y2ysync.datahub.url=YOURVALUE
datahub.server.url=YOURVALUE
datahub.c4c.proxyServer=YOURVALUE
datahub.c4c.proxyServerPort=YOURVALUE
datahub.publication.saveImpex=true
datahub.c4c.userName=YOURVALUE
datahub.c4c.password=YOURVALUE
datahub.c4c.senderParty.schemeID.GLOBAL=CommunicationSystemID
datahub.c4c.senderParty.internalID.GLOBAL=HYBRISINT
datahub.c4c.senderParty.schemeAgencyID.GLOBAL=310
datahub.c4c.recipientParty.schemeID.GLOBAL=LocalSystemID
datahub.c4c.recipientParty.internalID.GLOBAL=0LO7ESO
datahub.c4c.recipientParty.schemeAgencyID.GLOBAL=310
c4c.payload.filename=payload.xml
kernel.autoInitMode=create-drop
datahub.encryption.key.path=/encryption-key.txt
c4c.soap.request.size.threshold=1000
c4c.soap.request.pause.between.requests=5000

5. Navigate to the {HYBRIS_HOME}\installer directory and run the following command:

install.bat -r b2c_c4c setupDataHub

Running this command results in creating a Data Hub with SAP Cloud for Customer integration .war le in the
{HYBRIS_HOME}\installer\work\datahub-tomcat\webapps directory.

6. Navigate to the {HYBRIS_HOME} /hybris/bin/platform directory and download the JDBC driver by running the following command:

mvn hybris:getDatabaseDrivers

7. Initialize the SAP Commerce system by running the following command from the {HYBRIS_HOME} /hybris/bin/platform directory:

ant clean all initialize

Related Information
Installation
Extension Concept in the SAP Commerce
customerticketingc4cintegration Extension

Building and Con guring a Data Hub war File


Building and con guring a Data Hub war le requires you to perform a number of steps.

Prerequisites
Make sure that you have the necessary Data Hub installed. See Install the Basic Prerequisites for a full overview.

Context
This topic presents the steps necessary to build and con gure a Data Hub war le including SAP Cloud for Customer plug-ins.

 Note
This topic uses the following terms:

<HYBRIS_HOME> to refer to the directories created when you unzip the release ZIP les.

<CATALINA_HOME> to refer to the directories where your Tomcat is installed.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 76/99
3/5/2020
<DATAHUB_HOME> to refer the directory where a Data Hub WAR le is downloaded.

<C4C_INTEGRATION_JARS> to refer a folder where c4c-integration .jar les are copied.

<CONFIG_HOME> to refer a folder where you store local.properties le.

Procedure
1. Navigate to <HYBRIS_HOME> /hybris/bin/ext-integration/datahub/web-app/ and copy the datahub-webapp-xxx.war to
<DATAHUB_HOME> .

2. Navigate to <HYBRIS_HOME> /hybris/bin/ext-integration/datahub/extensions/c4c-integration and copy the following les to


<C4C_INTEGRATION_JARS>:

c4c-integration-canonical.jar

c4c-integration-raw.jar

c4c-integration-soap-adapter.jar

c4c-integration-target.jar

 Note
The c4c-integration-sync is replaced by the y2ysync Data Hub extensions. For more information about y2ysync, see the y2ysync Framework
documentation.

3. Navigate to <HYBRIS_HOME> /hybris/bin/ext-integration/datahub/extensions/sap/ and copy party-canonical-X.X.X.X.jar


to <C4C_INTEGRATION_JARS>.

4. Make sure you have the encryption-key.txt le. You can generate this key by following the steps in Tutorial: Using Attribute Encryption.

5. Create a local.properties le for the c4c-integration in <CONFIG_HOME> . Add the following properties:

datahub.enryption.key.path is path to your encryption key which you prepared in previous step.

datahub.c4c.exportURL which is url to your c4c endpoint, refer to a place where you want to export data from Data Hub .

datahub.c4c.userName and datahub.c4c.password are your C4C credentials

datahub.c4c.proxyServer and datahub.c4c.proxyServerPort are proxy con guration.

local.properties

# Keep the kernel.autoInitMode=update or change it to update if it was set to create-drop


# in the earlier step to reinitialize the database
kernel.autoInitMode=create-drop
datahub.encryption.key.path=where_is_your_encryption_key
datahub.publication.saveImpex=true

datahub.c4c.userName=user_name
datahub.c4c.password=your_password

# Keep the datahub.c4c.proxyServer=127.0.0.1 and datahub.c4c.proxyServerPort=8080 or change them to your proxy


datahub.c4c.proxyServer=127.0.0.1
datahub.c4c.proxyServerPort=8080
datahub.c4c.exportURL=where_is_your_c4c
datahub.c4c.senderParty.schemeID.GLOBAL=senderPartyID
datahub.c4c.senderParty.internalID.GLOBAL=senderInternalId
datahub.c4c.senderParty.schemeAgencyID.GLOBAL=000
datahub.c4c.recipientParty.schemeID.GLOBAL=recipientSchemeID
datahub.c4c.recipientParty.internalID.GLOBAL=recipientInternalID
datahub.c4c.recipientParty.schemeAgencyID.GLOBAL=111

c4c.soap.request.size.threshold=1000
c4c.soap.request.pause.between.requests=5000
csv.empty.value=<empty>

6. Navigate to or create the following path: <CATALINA_HOME> /conf/engine/host/ , where <engine> is your engine name and <host> is your host
name, where you want to deploy Data Hub . For example: <CATALINA_HOME> /conf/Catalina/localhost .

7. Create a datahub-webapp.xml le as follows:

datahub-webapp.xml

<Context antiJARLocking="true"
docBase="${DATAHUB_HOME}/datahub-webapp-5.7.0.0-RCx.war"
reloadable="true">
<Loader className="org.apache.catalina.loader.VirtualWebappLoader"
virtualClasspath=
"${CONFIG_HOME};
${C4C_DEPENDENCIES_HOME}/*.jar;
${C4C_INTEGRATION_JARS}/*.jar" />
</Context>

8. Run Tomcat.

9. Send a POST request to Data Hub , to check if the synchronization works:

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 77/99
3/5/2020

url:
http://localhost:8080/datahub-webapp/v1/data-feeds/DEFAULT_FEED/items/CustomerRawItem (if you did not change your tomc
http://<engine_host>:<tomcat_port>/datahub-webapp/v1/data-feeds/DEFAULT_FEED/items/CustomerRawItem (if you have change
method:
POST
headers:
Content-Type: application/octet-stream
data:
customerId,name,email
jd8,John Doe,john.doe@email.com

Related Information
Installation Guide
Extension Concept in the SAP Commerce

Con gure SAP Commerce Backoffice


Make required con gurations in SAP Commerce Backoffice for integration with SAP Cloud for Customer.

Procedure
1. Log in to SAP Commerce Administration Console.

2. Modify the following impex les with appropriate values for credentials and hostname, and then select Import Impex to import the code:

essentialdata-OutboundC4cCustomer.impex

essentialdata-OutboundC4cCustomerConfiguration.impex

essentialdata-OutboundDestinations.impex

Business to Business
Prior to using SAP Commerce and SAP Cloud for Customer integration, you have to ful ll several requirements and install the software.

This document presents the steps necessary to install SAP Commerce with the SAP Cloud for Customer solution.

In the B2B scenario, the following feature in SAP Commerce has been integrated with the SAP Cloud for Customer back end:

Customer ticketing

Commerce quote replication

Replication of Customer Tickets


To activate the replication of customer tickets between SAP Commerce and SAP Cloud for Customer, do the following:

Prerequisites
You need to perform several tasks in SAP Cloud for Customer and SAP ERP, prior to con guring SAP Commerce:

1. Create an employee in SAP ERP.

2. As SAP ERP and SAP Cloud for Customer systems are already integrated, the system replicates this employee from SAP ERP to SAP Cloud for Customer.
For more information, see the section Working in the Employee Staging Area in SAP Cloud for Customer documentation on SAP Help Portal.

3. For the business user created for the employee, assign either the SERVICE_AGENT or SERVICE_MANAGER role and set the password.

For information on assigning roles to business users in SAP Cloud for Customer solution, see the Assign business roles to employees section in the section Create
Employees in SAP Cloud for Customer documentation. For information on changing the business user password, see the related links to access SAP Cloud for
Customer Security Guide.

You can set an SSO password by following the link from the customer creation con rmation e-mail.

 Note
SAP Cloud for Customer users are replicated in the SAP Cloud Identity every 24 hours. Once the user is transferred to the SAP Cloud Identity, you receive an e-
mail on the address you provided during the creation of the employee.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 78/99
3/5/2020
Context

Procedure
1. If you do not have the SAP Commerce and the SAP ERP integration scenario already installed, then perform the steps described in the Installing SAP
Commerce document.

2. Add the following extensions to your {HYBRIS_HOME} /hybris/config/localextensions.xml le:

<extension name='customerticketingaddon' />

<extension name='customerticketingc4cb2bintegration' />

For more information, see the document Con guring Available Extensions.

3. Install the necessary AddOns by running the following command from the {HYBRIS_HOME} /hybris/bin/platform directory:

 Note
Make sure to set up the Apache Ant environment by opening the setantenv.bat le in the command prompt.

ant addoninstall -Daddonnames="customerticketingaddon,assistedservicestorefront" -DaddonStorefront.yacceleratorstorefront=

For more information, see the following documents:

customerticketingaddon AddOn

assistedservicestorefront AddOn

4. Navigate to the {HYBRIS_HOME} /hybris/config directory and open the local.properties le. Set the properties to the following:

# customerticketingc4cintegration properties:
customerticketingc4cintegration.facade.mock=false
# Specifies the location of the spring context file putted automatically to the global platform application context.
customerticketingc4cintegration.application-context=customerticketingc4cintegration-spring.xml
customerticketingc4cintegration.c4c-url=YOURVALUE1
customerticketingc4cintegration.c4c-batch-suffix=/$batch
# ticketing part of url, used for listing, creating, retrieving tickets
customerticketingc4cintegration.c4c-ticket-suffix=/ServiceTicketCollection
customerticketingc4cintegration.c4c-token-url-suffix=?$top=1
customerticketingc4cintegration.c4c-accept=Application/json
customerticketingc4cintegration.c4c-username=YOURVALUE2
customerticketingc4cintegration.c4c-password=YOURVALUE3
customerticketingc4cintegration.c4c-token-naming=x-csrf-token
customerticketingc4cintegration.c4c-site-header=c4c-odata-businessSystemID
customerticketingc4cintegration.c4c-token-empty=fetch
customerticketingc4cintegration.c4c-expand-suffix=$expand=Notes,RelatedTransactions
customerticketingc4cintegration.c4c-update-message-suffix=/ServiceRequestTextCollection
# Specifies the value of created-by field in Note object to be replaced by customer name (would be the account used for hy
customerticketingc4cintegration.displayname=YOURVALUE4

customerticketingc4cintegration.siteId.<B2BSiteID>=YOURVALUE5
customerticketingc4cintegration.siteId. <B2BSiteID>.type=b2b

Details of the Values:

YOURVALUE1 -> https://<Cloud for Customer base URL>/sap/byd/odata/v1/yserviceticket/ServiceTicketCollection

YOURVALUE2-> User created for OData. Look at the prerequisite section.

YOURVALUE3 -> Password for the above user

YOURVALUE4 -> Explained in the comments

YOURVALUE5 -> This is the “System Instance ID”, from Cloud for Customer customizing in step “Setup Communication System” <B2BSiteID>-> This
is the Site ID for the B2B shop. (For example: powertools)

Related Information
Extension Concept in the SAP Commerce
SAP Cloud for Customer Security Guide

Replication of Commerce Quotes


Commerce quotes enable buyers to create quotes and negotiate the nal price of an order using the SAP Commerce storefront. The quote initiated by a buyer from
the storefront is replicated asynchronously to SAP Cloud for Customer. Further updates are replicated between the two systems.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 79/99
3/5/2020
Prerequisites
SAP C4C and SAP ERP/SAP S/4HANA on-premise master data should be in sync.

SAP Commerce communicates to C4C system using HTTPS, so import a certi cate from your C4C system and then install it in the Tomcat server to
establish a proper connection.

Context
A B2B customer can create a quote from the storefront for a cart of items that exceeds a threshold value. The master data such as customer, product, and B2B unit
are replicated from an integrated SAP ERP or SAP S/4HANA system.

The following diagram illustrates the overview of quote replication process.

Procedure
1. If you do not have the SAP Commerce and the SAP S/4HANA or the SAP ERP integration scenario already installed, then perform the steps described in the
Installing SAP Hybris Commerce document.

2. Set up SAP Commerce and Data Hub with B2B_C4C recipe.

3. Replicate the following master data from the SAP back-end.

B2BCustomer

B2BUnit

Products

Price

For more information about master data replication, see SAP Master Data.

Integration Using SAP Cloud Platform Integration


Follow the steps to integrate SAP Cloud for Customer with SAP Commerce.

Procedure
1. Include scpiconnectorbackoffice extension in localextensions.

2. Run a system update by selecting this extension.

This enables a new node in Backoffice named SAP Cloud Platform Integration.

3. Log in to Backoffice and choose SAP Cloud Platform Integration SAP Cloud Platform Integration Con guration .

A window to create a new SAP Cloud Platform Integration con guration appears.

4. Create a new SAP Cloud Platform Integration con guration:

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 80/99
3/5/2020
Name: Enter a name for the con guration

Username: Enter username for SAP Cloud Platform Integration connectivity

Password: Enter password for SAP Cloud Platform Integration connectivity

Base URL: Enter base URL of your SAP Cloud Platform Integration instance

Proxy URL: Leave it blank, if no proxy server is requird for connection

5. Click Done.

The con guration is saved.

6. Open the con guration again by clicking on search in the previous Backoffice window.

7. Scroll down and click in the iFlow Con guration text box.

8. Click Create New iFlow Con guration.

A window to create a new iFlow con guration appears.

9. Create a new iFlow Con guration:

iFlow Key: Enter the key as <c4cconsumer>

iFlow URL: Enter the iFlow URL

10. Click Done.

11. Click Save.

Integrating the SAP Commerce Assisted Service Module


with SAP Cloud Identity
Using the properly con gured samlsinglesignon extension, customer service agents in SAP Cloud for Customer can seamlessly enter the assisted service
mode without the need to re-enter their credentials.

This document describes the steps necessary to integrate the SAP Commerce Assisted Service Module with the SAP Cloud for Customer solution using the
samlsinglesignon extension.

 Note
An SAP Commerce extension may provide functionality that is licensed through different SAP Commerce modules. Make sure to limit your implementation to
the features de ned in your contract license. In case of doubt, please contact your sales representative.

General
The SAP Commerce Assisted Service Module allows the customer service representatives to perform actions on behalf of the customer. The ASM can be integrated
with the SAP Cloud for Customer solution.

To integrate the SAP Cloud Identity Service with the Assisted Service Module using the samlsinglesignon extension, you only need to change the most
important con guration options and leave the rest of the con guration options at their default state.

For a general overview of the SAP Cloud Identity's functionality, see the following video: https://www.youtube.com/watch?v=6y_gHhKSaIQ

There are several different options you need to con gure:

Metadata

Certi cates

IDP discovery

IDP custom attribute con guration

Properties inside the local.properties le

Con gure the Metadata


SAML metadata is an XML document containing information necessary for interaction with SAML-enabled identity or service providers. The metadata contains
URLs of endpoints, information about supported bindings, identi ers and public keys. Normally, one metadata document is generated for your own service provider
and sent to all identity providers you want to enable single sign-on with. Similarly, each identity provider need to make its own metadata available for you to import
into your service provider application.

Identity Provider Metadata

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 81/99
3/5/2020
1. Navigate to the bin/modules/platform/samlsinglesignon/web/webroot/WEB-INF/security folder and open the spring-security-
config.xml le.

2. The below snippet shows the service provider's SAML Spring con guration pointing to the IDP metadata le.

samlsinglesignonresourcessecurityspring-security-config.xml

<!-- IDP Metadata configuration - paths to metadata of IDPs in circle of trust is here -->
<bean id="metadata" class="org.springframework.security.saml.metadata.CachingMetadataManager">
<constructor-arg>
<list>
<bean class="org.opensaml.saml2.metadata.provider.FilesystemMetadataProvider">
<!-- URL containing the metadata -->
<constructor-arg>
<value type="java.io.File">${sso.metadata.location:classpath:security/metadata.xml}</value>
</constructor-arg>
<property name="parserPool" ref="parserPool"/>
</bean>
</list>
</constructor-arg>
</bean>

 Note
You can con gure the value of the constructor argument of the metadata bean in the local.properties le. If no values are provided, the default
values present in the spring-security-config.xml le are used.

The value in the <constructor-arg> tag of the FilesystemMetadataProvider bean speci es the location and the name of the IDP metadata le.
You need to download the metadata le from the Tenant settings section of the SAP Cloud Identity Administration Console.

3. Navigate to your instance of the SAP Cloud Identity service and log in. The Administration Console is displayed.

4. In the Administration Console, click the Tenant Settings button. The Tenant Settings window is displayed.

5. In the Tenant Settings window, click the Tenant SAML 2.0 Con guration link. The Tenant SAML 2.0 Con guration window is displayed.

6. At the bottom of the page, click the Download Metadata File link.

7. When the le is downloaded, make sure to place it in the location speci ed between the <constructor-arg> tags of the
FilesystemMetadataProvider bean from the spring-security-config.xml le.

Service Provider Metadata

Service provider metadata contains keys, services and URLs de ning SAML endpoints of your application. You can generate the metadata automatically upon the
rst request to the service.

SAML exchanges involve usage of cryptography for signing and encryption of data. All interactions with cryptographic keys are done through the
org.springframework.security.saml.key.KeyManager interface . The default implementation
org.springframework.security.saml.key.JKSKeyManager relies on a single JKS key store which contains all private and public keys. KeyManager
should contain at least one private key which should be marked as default by using the alias of the private key as part of the JKSKeyManager constructor. By
default, the extension is shipped with a private key with the name hybris.

To obtain the metadata for the service provider, perform the following steps:

1. Start the SAP Commerce Server.

2. Access the following URL: http://localhost:9001/samlsinglesignon/saml/metadata. This action triggers the download of the service
provider's metadata le.

 Note
URL

If you have set up SAP Commerce with the samlsinglesignon extension on another machine, make sure to change the host and port in the URL.

3. Upload and save the metadata le into your application in SAP Cloud Identity.

 Note
For more information on creating application in SAP Cloud Identity, see the Create a New Application document.

Con gure the Certi cates


By default, the metadata is not required to be signed. But when it is digitally signed, it requires veri cation of signature's validity and trust. The signature is veri ed
with PKIX algorithm and uses all public keys present in the con gured keyManager bean:

samlsinglesignonresourcessecurityspring-security-config.xml

<!-- Central storage of cryptographic keys -->


<bean id="keyManager" class="org.springframework.security.saml.key.JKSKeyManager">

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 82/99
3/5/2020
<constructor-arg value="${sso.keystore.location:classpath:security/samlKeystore.jks}"/>
<constructor-arg type="java.lang.String" value="${sso.keystore.password:changeit}"/>
<constructor-arg>
<map>
<entry key="${sso.keystore.privatekey.alias:hybris}" value="${sso.keystore.privatekey.password:changeit}"/>
</map>
</constructor-arg>
<constructor-arg type="java.lang.String" value="${sso.keystore.default.certificate.alias:hybris}"/>
</bean>

 Note
You can con gure the values of the constructor arguments of the keyManager bean in thelocal.properties le. If no values are provided, the default
values present in the spring-security-config.xml le are used.

In order for the signed metadata to work, you need to import the certi cate from the IDP for this signature into your keystore. By default, your keystore is the
samlkeystore.jsk le. To con gure the certi cates, perform the following steps:

1. Navigate to the bin/modules/platform/samlsinglesignon/web/webroot/WEB-INF/security directory and copy the


samlkeystore.jsk le to the bin folder of your JDK installation directory.

2. Navigate to your instance of the SAP Cloud Identity service and log in. The Administration Console is displayed.

3. In the Administration Console, click the Tenant Settings button. The Tenant Settings window is displayed.

4. In the Tenant Settings window, click the Tenant SAML 2.0 Con guration link. The Tenant SAML 2.0 Con guration window is displayed.

5. At the bottom of the page, locate the Signing Certi cate section. Copy the certi cate and paste it into a le with the .cer extension, for example
key.cer.

 Note
The lename is irrelevant, but it is used later on to import the certi cate.

6. Copy the key.cer le to the bin folder of your JDK installation directory.

7. Run the following command:

keytool -importcert -alias some-alias -file key.cer -keystore samlKeystore.jks

 Note
Parameters

Name Description

-importcert Speci es the what needs to be done with the certi cate.

-alias Describes how the certi cate is named in the keystore.

-file Contains a path to the certi cate.

-keystore Contains a path to the keystore.

8. Copy the new samlKeystore.jks le into the security folder of the samlsinglesignon extension. By default:
bin/modules/platform/samlsinglesignon/web/webroot/WEB-INF/security.

Add the Custom Attribute to the IDP


In order for the integration to work you need to pass a custom usergroup attribute in the SAML assertion. The usergroup attribute holds the groups in which the
user is a member, so that these groups are mapped in SAP Commerce.

1. To add the custom usergroup attribute in the SAP Cloud Identity Service, follow the link in the Related Links at the end of this topic.

Con gure the Properties

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 83/99
3/5/2020
For the integration to work, you need to con gure the properties in the local.properties le.

1. Open the hybris/config/local.properties le for editing.

2. Make sure that the properties are set to the following values:

local.properties

# Specifies the location of the spring context file putted automatically to the global platform application context.
samlsinglesignon.application-context=samlsinglesignon-spring.xml

# the user type for newly created user in hybris


sso.mapping.asagentgroup.usertype=Employee

# the user group mapping that is valid in hybris


sso.mapping.asagentgroup.groups=asagentsalesmanagergroup
# the user type for newly created user in hybris
sso.mapping.SALES_REP.usertype=Employee
# the user group mapping that is valid in hybris
sso.mapping.SALES_REP.groups=asagentsalesgroup
# the user type for newly created user in hybris
sso.mapping.SALES_MANAGER.usertype=Employee
# the user group mapping that is valid in hybris
sso.mapping.SALES_MANAGER.groups=asagentsalesmanagergroup
# the user type for newly created user in hybris
sso.mapping.SERVICE_AGENT.usertype=Employee
# the user group mapping that is valid in hybris
sso.mapping.SERVICE_AGENT.groups=asagentsalesgroup
# the user type for newly created user in hybris
sso.mapping.SERVICE_MANAGER.usertype=Employee
# the user group mapping that is valid in hybris
sso.mapping.SERVICE_MANAGER.groups=asagentsalesmanagergroup

# the default context to use to build the redirect URL for security reasons
sso.redirect.url=YOURVALUE

# cookie age in seconds


sso.cookie.max.age=60

# cookie path
sso.cookie.path=/

# cookie domain
sso.cookie.domain=

#generated token name, if empty then samlPassThroughToken will be used


sso.cookie.name=samlPassThroughToken

# default password encoding


sso.password.encoding=md5

#usergroup attribute name in the saml assertion


sso.usergroup.attribute.key=usergroup

#firstname attribute name in the saml assertion


sso.firstname.attribute.key=first_name

#lastname attribute name in the saml assertion


sso.lastname.attribute.key=last_name

#userid attribute name in the saml assertion


sso.userid.attribute.key=mail

# location of the samelKeystore file


sso.keystore.location=classpath:security/samlKeystore.jks

# password of the keystore, changeit by default


sso.keystore.password=changeit

# default priate key alias shipped within samlkeysotre


sso.keystore.privatekey.alias=hybris

# private key password


sso.keystore.privatekey.password=changeit

# alias for the default certificate


sso.keystore.default.certificate.alias=hybris

# the location of the metadata file which holds the IDP info
sso.metadata.location=classpath:security/metadata.xml

# the entity id to identity our service provider


sso.entity.id=urn:ssoextension:hybris:de

# default password encoding


sso.password.encoding=md5
sso.usergroup.attribute.key=usergroup
sso.firstname.attribute.key=first_name
sso.lastname.attribute.key=last_name
sso.userid.attribute.key=mail

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 84/99
3/5/2020

 Note
The sso.redirect.url property has to be secure (https) and end with a slash (/).

3. If you started the SAP Commerce Server already, restart it now.

Integration Flow Overview


When you complete the above steps, the SAML extension is ready to be used. Below, you can nd the information on how the communication between the ASM and
SAP Cloud for Customer looks like:

1. When the user rst hits the SAML extension through a URL like this:
http://localhost:9001/samlsinglesignon/saml/yacceleratorstorefront/electronics/en/?site=electronics&asm=true
then the extension checks if this user is logged in or not.

 Note
If the user is not logged in, then they are redirected to the SAP Cloud Identity login screen.

2. Once the user is logged in, a SAML assertion is created for this user and they are not required to login again. Then, the user is redirected to the SAML
extension again.

3. A controller intercepts the request, parses the URL, and does the following:

a. If the authenticated user exists on the SAP Commerce side, then the user is returned and the user groups are updated according to the mapping
between the shipped groups in the custom usergroup attribute and the valid SAP Commerce groups as per the corresponding properties in the
local.properties le.

b. If the user does not exist on the SAP Commerce side, they are created on the y and assigned the list of groups.

4. A secure cookie is generated with the customer information. This cookie is used by the Assisted Service Module.

5. The nal destination of this request is the part of the URL following the saml/ part, i.e. yacceleratorstorefront/electronics/en/?
site=electronics&asm=true.

6. Automatic redirection is done by taking what follows the /saml/ part of the URL and appending the domain in front of it. The domain is con gured in the
local.properties le as the sso.redirect.url property.

7. The ASM intercepts the request and checks and if there is a valid secure cookie, the system proceeds with the ASM login.

Related Information
http://docs.spring.io/autorepo/docs/spring-security-saml/1.0.x-SNAPSHOT/reference/htmlsingle/
https://help.hana.ondemand.com/cloud_identity/frameset.htm
http://help.sap.com/cloud4customer
https://help.sap.com/viewer/6d6d63354d1242d185ab4830fc04feb1/Cloud/en-US

Con guring SAP Cloud for Customer Integration


Prior to using it, SAP Cloud for Customer solution requires you to con gure its elements.

This document presents the steps necessary to con gure SAP Cloud for Customer solution.

Con guring the SAP Cloud for Customer Solution


Depending on how you plan to use the solution, there are two separate procedures:

Business to Business (B2B)

Business to Customer (B2C)

Business to Business (B2B)


Prior to integrating SAP Cloud for Customer with SAP Commerce in the B2B scenario, several steps must be performed.

1. Activating SAP Commerce Integration in Scoping

2. Setting up SSO between SAP Cloud for Customer and Identity Provider

3. Setting Up Communication System

4. Setting Up Communication Arrangements

5. Creating a URL Mashup for Deep Link

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 85/99
3/5/2020
6. Con guring SAP Commerce Storefront Integration

Activating SAP Commerce Integration in Scoping


If you want to activate integration in scoping, proceed through steps below.

Prerequisites
Ensure that SAP Commerce integration is active in SAP Cloud for Customer system.

Procedure
1. Log in to SAP Cloud for Customer system, as a system administrator.

2. In the Business Con guration work center, select the Implementation Projects view.

3. Select your implementation project, and click Edit Project Scope.

4. In the scoping wizard, choose Next until the Scoping screen appears.

5. Expand Communication and Information Exchange - Integration with External Applications and Solutions nodes.

6. Select Integration with SAP Commerce Storefront, and select Next.

7. After you have carefully reviewed and con rmed your entries, click Finish and close the view.

8. If this implementation project is scoped for the rst time, then proceed further to deploy the solution. Click on the Business Con guration work center, and
click Open Activity List.

9. Select Con rm Milestone: Design Accepted.

10. Select Design Accepted and click Con rm.

Setting up SSO between SAP Cloud for Customer and


Identity Provider
Prerequisites to Setting Up SSO Between SAP Cloud for Customer and Identity
Provider
These are the steps needed to set up SSO between SAP Cloud for Customer and Identity Provider.

Context
This procedure is based on the example, when SAP Cloud Identity is your Identity Provider.

Procedure
1. Log in to the SAP Cloud Identity system.

2. Click Home and then Tenant Settings.

3. Choose SAML 2.0 Con guration.

4. Click Download Metadata File.

5. Save the XML le on your computer.

This le needs to be uploaded in SAP Cloud for Customer system.

6. Log in to SAP Cloud for Customer system, as a system administrator

7. In the Administrator work center, choose Con gure Single Sign-On.

8. In the My System tab, click SP Metadata to download the metadata.

9. Save the metadata XML le on your computer

This le needs to be uploaded in your Identity Provider system.

10. In the SAP Cloud for Customer system, click Administrator work center and choose Communication Certi cates.

11. Click Download Tenant Certi cate.

12. Save the certi cate le on your computer.

The certi cate le you downloaded is in DER encoded format. However, SCI understands the certi cate le is in BASE encoded format.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 86/99
3/5/2020
Related Information
Converting the Tenant Certi cate File from DER to BASE Encoded Format

Converting the Tenant Certi cate File from DER to BASE Encoded Format
This procedure leads you through the steps needed to convert your tenant certi cate le from DER to BASE encoded format.

Procedure
1. Double-click on the certi cate le, and click Open.

2. In the Details tab, click Copy to File.

3. In the Certi cate Export Wizard, click Next.

4. Select Base-64 encoded X.509 (.CER) and click Next.

5. Select a folder and enter a le name for the converted certi cate le.

6. Click Next and then Finish. The le is now available in the required format.

This le needs to be uploaded in your Identity Provider system.

Setting Up SSO in SAP Cloud for Customer


These are the steps to be performed in SAP Cloud for Customer.

Procedure
1. Log in to SAP Cloud for Customer system, as a system administrator.

2. In the Administrator work center, select Con gure Single Sign-On.

3. In the Identity Provider tab, click New Identity Provider.

4. Upload the metadata le that you downloaded from your identity provider system (step 1 in the Prerequisites section).

5. Click Actions and select Activate.

6. Click Activate Single Sign-On.

Setting Up SSO in Identity Provider System


These are the steps to be performed in your identity provider system.

Context
This procedure is based on the example, when SAP Cloud Identity is your Identity Provider.

Procedure
1. Log in to SAP Cloud Identity and click Applications.

2. Click the + icon at the bottom-left row to add an application. Enter a name, for example SAP Cloud for Customer, and click Save.

3. In the application, under Trust tab, click SAML 2.0 Con guration.

4. In the SAML 2.0 Con guration screen, under De ne from Metadata section, click Browse.

5. Select the metadata XML le you downloaded from SAP Cloud for Customer (step 2 in the Prerequisites section), and click Save.

6. In SAP Cloud Identity, click on the application you created, and under Trust tab click Name ID Attribute.

Ensure that Login Name is selected.

7. Under Trust tab, click Certi cate for API Authentication.

8. In the Con gure Certi cate section, click Browse.

9. Upload the tenant certi cate you have downloaded from SAP Cloud for Customer (step 3 in prerequisites).

10. Click the back button, and choose HTTP Basic Authentication.

11. Click New to con gure a user for basic authentication in your identity provider.

A user ID is automatically generated once you set your password.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 87/99
3/5/2020
Related Information
Integrating the SAP Commerce Assisted Service Module with SAP Cloud Identity

Setting Up Communication System


A communication system represents an external system for communication. It is also a reference for ID mapping maintained within your cloud solution. The
communication system represents the SAP Commerce client.

Procedure
1. Log in to the SAP Cloud for Customer system, as a system administrator.

2. In the Administrator work center, select Communication Systems.

3. Click New.

4. On the New Communication System screen, in the Basic Information section, enter the following information:

Option Description

ID SAP Commerce storefront instance ID, or name of the SAP Commerce system to
be connected

SAP Business Suite Checked

Host name Enter the host name

System Access Type Internet

5. Optionally, in the Technical Contact section, you can enter data of the contact person for the SAP Commerce system.

6. Save your data.

7. In the System Instances section, enter the following data:

Option Description

System Instance ID Enter the ID or name of the business instance of the SAP Commerce system

Preferred Application Protocol Web service

To nd your instance ID, navigate to local.properties le of SAP Commerce ECP and nd:
customerticketingc4cintegration.siteId.electronics=<hybrisbusinessinstanceid>.

8. Choose Actions and Set to Active.

9. Choose Save and Close.

10. Maintain Sender Party and Receiver Party in Data Hub.

11. Activate the communication system.

Related Information
customerticketingc4cintegration Extension

Setting Up Communication Arrangements


A communication arrangement represents the type of communication that will happen with the connected communication system. It is also a reference for the
communication scenarios maintained within your cloud solution.

Context
The communication arrangement represents the communication scenarios used for communicating with the SAP Commerce client.

Procedure
1. Log in to the SAP Cloud for Customer system, as a system administrator.

2. In the Administrator work center, select Communication Arrangements.

3. Click New.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 88/99
3/5/2020
4. On the New Communication Arrangement screen, enter the following information.

Option Description

Select Scenario Enter the communication scenario for your business requirement

De ne Business Data Enter your communication system

De ne Technical Data Enter

Communication method: Direct Connection

Application Protocol: WebService

Authentication Method: User ID/Password

Check the generated Service URL

Inbound Communication: Basic Settings Enter

Service: Name of the service

Protocol: WebService

URL: Receiver URL

Authentication Method: User ID/Password

Outbound Communication: Basic Settings Enter

Service: Name of the service

Protocol: WebService

URL: Receiver URL

Authentication Method: User ID/Password

Review Review your settings and Check Completeness and Check Service

5. Click Finish to set up the communication arrangement.

6. To nd your instance ID navigate to local.properties le of SAP Commerce ECP and nd


customerorderc4cintegration.siteId.electronics=<hybrisbusinessinstanceid>

Communication scenarios used for quote replication:

Creation of Sales Quote Follow Up Document in SAP Business Suite

Sales Quote Replication from SAP Business Suite

7. Activate the communication arrangement.

Creating a URL Mashup for Deep Link


A URL mashup sends data from SAP Cloud for Customer solution to the SAP Commerce URL. The SAP Commerce system uses the data, for example, to perform a
search, and the results are displayed in a new browser window. Creation of two mashups is needed: one for ASM and the other for a service ticket.

Context
You know the end-point URL of the SAP Commerce system, for example, URL to the SAP Commerce ASM page or the service ticket page on SAP Commerce.

Procedure
1. Log in to the SAP Cloud for Customer system, as a system administrator.

2. In the Administrator work center, select Mashup Authoring.

3. Click New and select URL Mashup.

4. Enter a name and a description for the mashup. The mashup's name is displayed to business users when using the mashup.

5. Under URL Information, enter the URL of the SAP Commerce web service to the ASM or service ticket page, and click Extract Parameters.

6. Enter any URL parameters that you want to pass with the URL, for example, a site parameter to capture the shop name.

You do not need to add the customer ID and ticket ID parameters, as they are automatically added to the URL by the system.

7. Click the Preview link to display the end result of the mashup.

8. Save your changes.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 89/99
3/5/2020
The mashup is now active and ready to be used.

Con guring SAP Commerce Storefront Integration


The details of the SAP Commerce system need to be maintained. Only one connection of a Commerce system to SAP Cloud for Customer is possible.

Procedure
1. Log in to the SAP Cloud for Customer system, as a system administrator.

2. In the Administrator work center, select Hybris Storefront Integration.

3. Click New.

4. On the Integration Settings for Hybris Storefront screen, enter the following information.

Option Description

SAP Commerce Storefront ID Enter an ID, for example powertools, or name for the SAP Commerce system you
want to connect.

SAP Commerce Storefront Description Enter a short description of the SAP Commerce system.

SAP Commerce Storefront System Instance ID Enter the system instance ID of the SAP Commerce system.

SAP ERP System Instance ID Enter the system instance ID of the connected ERP system.

You can nd the SAP ERP System Instance ID in the SAP Customizing Implementation Guide: SAP NetWeaver Application Server IDoc Interface/
Application Link Enabling Basic settings Logical Systems De ne Logical System .

5. Create an entry to maintain a deep link to ASM page: Deep Link Settings Add Row Navigation to Storefront Assisted service Module (ASM) Page Enter
the mashup ID .

6. Create an entry to maintain a deep link to service ticket page: Deep Link Settings Add Row Navigation to Storefront Service Ticket Page Enter the
mashup ID .

7. Choose Save and Close.

Related Information
Installing SAP Commerce Manually
Extension Concept

Business to Customer (B2C)


Prior to integrating SAP Cloud for Customer with SAP Commerce in the B2C scenario, several steps must be performed.

1. Activating SAP Commerce Integration in Scoping

2. B2C - Setting Up SSO Between SAP Cloud for Customer and Identity Provider

3. B2C - Setting Up Communication System

4. B2C - Creating a URL Mashup for Deep Link

5. B2C - Con guring SAP Commerce Storefront Integration

6. B2C - Con guring Communication Arrangement

Activating SAP Commerce Integration in Scoping


If you want to activate integration in scoping, proceed through steps below.

Prerequisites
Ensure that SAP Commerce integration is active in SAP Cloud for Customer system.

Procedure
1. Log in to SAP Cloud for Customer system, as a system administrator.

2. In the Business Con guration work center, select the Implementation Projects view.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 90/99
3/5/2020
3. Select your implementation project, and click Edit Project Scope.

4. In the scoping wizard, choose Next until the Scoping screen appears.

5. Expand Communication and Information Exchange - Integration with External Applications and Solutions nodes.

6. Select Integration with SAP Commerce Storefront, and select Next.

7. After you have carefully reviewed and con rmed your entries, click Finish and close the view.

8. If this implementation project is scoped for the rst time, then proceed further to deploy the solution. Click on the Business Con guration work center, and
click Open Activity List.

9. Select Con rm Milestone: Design Accepted.

10. Select Design Accepted and click Con rm.

B2C - Setting Up SSO Between SAP Cloud for Customer


and Identity Provider
B2C - Prerequisites to Setting Up SSO Between SAP Cloud for Customer and
Identity Provider
These are the steps needed to set up SSO between SAP Cloud for Customer and Identity Provider.

Context
This procedure is based on the example, when SAP Cloud Identity is your Identity Provider.

Procedure
1. Log in to the SAP Cloud Identity system.

2. Click Home and then Tenant Settings.

3. Choose SAML 2.0 Con guration.

4. Click Download Metadata File.

5. Save the XML le on your computer.

This le needs to be uploaded in the SAP Cloud for Customer system.

6. Log in to SAP Cloud for Customer system, as a system administrator.

7. In the Administrator work center, choose Con gure Single Sign-On.

8. In the My System tab, click SP Metadata to download the metadata.

9. Save the metadata XML le on your computer.

This le needs to be uploaded in your Identity Provider system.

10. In the SAP Cloud for Customer system, click Administrator work center and choose Communication Certi cates.

11. Click Download Tenant Certi cate.

12. Save the ceti cate le on your computer.

The certi cate le you downloaded is in DER encoded format. However, SCI understands the certi cate le is in BASE encoded format.

Related Information
B2C - Converting the Tenant Certi cate File from DER to BASE Encoded Format

B2C - Converting the Tenant Certi cate File from DER to BASE Encoded Format
This procedure leads you through the steps needed to convert your tenant certi cate le from DER to BASE encoded format.

Procedure
1. Double-click on the certi cate le, and click Open.

2. In the Details tab, click Copy to File.

3. In the Details tab, click Copy to File.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 91/99
3/5/2020
4. Select Base-64 encoded X.509 (.CER) and click Next.

5. Select a folder and enter a le name for the converted certi cate le.

6. Click Next and then Finish. The le is now available in the required format.

This le needs to be uploaded in your Identity Provider system.

B2C - Setting Up SSO in SAP Cloud for Customer


These are the steps to be performed in SAP Cloud for Customer.

Procedure
1. Log in to SAP Cloud for Customer system, as a system administrator.

2. In the Administrator work center, select Con gure Single Sign-On.

3. In the Identity Provider tab, click New Identity Provider.

4. Upload the metadata le that you downloaded from your identity provider system (step 1 in the Prerequisites section).

5. Click Actions and select Activate.

6. Click Activate Single Sign-On.

B2C - Setting Up SSO in Identity Provider System


These are the steps to be performed in your Identity Provider system.

Context
This procedure is based on the example, when SAP Cloud Identity is your Identity Provider.

Procedure
1. Log in to SAP Cloud Identity and click Applications.

2. Click the + icon at the bottom-left row to add an application. Enter a name, for example SAP Cloud for Customer, and click Save.

3. In the application, under Trust tab, click SAML 2.0 Con guration.

4. In the SAML 2.0 Con guration screen, under De ne from Metadata section, click Browse.

5. Select the metadata XML le you downloaded from SAP Cloud for Customer (step 2 in the Prerequisites section), and click Save.

6. In SAP Cloud Identity, click on the application you created, and under Trust tab, click Name ID Attribute.

Ensure that Login Name is selected.

7. In SAP Cloud Identity, click on the application you created, and under Trust tab, click Certi cate for API Authentication.

8. In the Con gure Certi cate section, click Browse.

9. Upload the tenant certi cate you downloaded from SAP Cloud for Customer (step 3 in prerequisites).

10. Click the back button, and choose HTTP Basic Authentication.

11. Click New to con gure a user for basic authentication in your identity provider.

A user ID is automatically generated once you set your password.

Related Information
Integrating the SAP Commerce Assisted Service Module with SAP Cloud Identity

B2C - Setting Up Communication System


A communication system represents an external system for communication. It is also a reference for ID mapping maintained within your cloud solution. The
communication system represents the SAP Commerce client, even if the technical communication occurs using Data Hub.

Procedure
1. Log in to the SAP Cloud for Customer system, as a system administrator.

2. In the Administrator work center, select Communication Systems.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 92/99
3/5/2020
3. Click New.

4. On the New Communication System screen, in the Basic Information section, enter the following information:

Option Description

ID SAP SAP Commerce Storefront Instance ID, or name of the SAP Commerce
system to be connected

SAP Business Suite Leave it unchecked

Host name Reverse proxy of SAP Commerce Data Hub

System Access Type Internet

5. Optionally, in the Technical Contact section, you can enter data of the contact person for the SAP Commerce system.

6. Save your data.

7. In the System Instances section, enter the following data:

Option Description

System Instance ID Enter the ID or name of your business instance of the SAP Commerce system.

Preferred Application Protocol Web Service

8. Choose Actions - Set to Active.

9. Choose Save and Close.

Related Information
customerticketingc4cintegration Extension

B2C - Creating a URL Mashup for Deep Link


A URL mashup sends data from SAP Cloud for Customer solution to the SAP Commerce URL. The SAP Commerce system uses the data, for example, to perform a
search, and the results are displayed in a new browser window. You need to create two mashups: one for ASM and the other for service ticket.

Context
You know the end-point URL of the SAP Commerce system, for example, URL to the SAP Commerce ASM page or the service ticket page on SAP Commerce.

Procedure
1. Log in to the SAP Cloud for Customer system, as a system administrator.

2. In the Administrator work center, select Mashup Authoring.

3. Click New and select URL Mashup.

4. Enter a name and a desciption for the mashup. The mashup's name is displayed to business users when using the mashup.

5. Under URL Information, enter the URL of the SAP Commerce web service to the ASM or service ticket page, and click Extract Parameters.

6. Enter any URL parameters that you want to pass with the URL, for example, a site parameter to capture the shop name.

You do not need to add the customer ID and ticket ID parameters, as they are automatically added to the URL by the system.

7. Click the Preview link to display the end result of the mashup.

8. Save you changes.

The mashup is now active and ready to be used.

B2C - Con guring SAP Commerce Storefront


Integration
The details of the SAP Commerce system need to be maintained. Only one connection of a Commerce system to SAP Cloud for Customer is possible.

Procedure

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 93/99
3/5/2020
1. Log in to the SAP Cloud for Customer system, as a system administrator.

2. In the Administrator work center, select Hybris Storefront Integration.

3. Click New.

4. On the Integration Settings for Hybris Storefront screen, enter the following information:

Option Description

SAP Commerce Storefront ID Enter an ID, say electronics, or name for the SAP Commerce system you want to
connect.

SAP Commerce Storefront Description Enter a short description of the SAP Commerce system.

SAP Commerce Storefront System Instance ID Enter the system instance ID of the SAP Commerce system.

SAP ERP System Instance ID Leave it empty.

5. Create an entry to maintain a deep link to ASM page: Deep Link Settings Add Row Navigation to Storefront Assisted service Module (ASM) Page Enter
the mashup ID .

6. Create an entry to maintain a deep link to service ticket page: Deep Link Settings Add Row Navigation to Storefront Service Ticket Page Enter the
mashup ID .

7. Chose Save and Close.

B2C - Con guring Communication Arrangement


To complete the SAP Cloud for Customer integration, you need to con gure the communication arrangement.

Procedure
1. Go to Administrator Communication Arrangements .

2. Click New.

3. Select Business Partner replication from SAP Business Suite, and click Next.

4. Select the System Instance ID you entered while creating the communication system, and click Next.

5. Select the code list mapping as SAP Commerce.

6. Enter the user credentials of the technical user created to log in to hybris.

7. Deselect Outbound Communication Enabled and click Next.

8. To create and activate your communication arrangement in the system, click Finish.

A success message is displayed once the communication arrangement is created successfully.

Related Information
Installing SAP Commerce Manually
Extension Concept

Con guring SAP Commerce for Quote Replication using


SAP Cloud Platform Integration
Make necessary con gurations in SAP Commerce to replicate quote between SAP Commerce and SAP Cloud for Customer.

Procedure
1. Log in to Backoffice.

2. Go to SAP Integration SAP Base Store Con guration .

3. In the C4C tab, con gure the following properties:

Processing Type Code: processing type code from SAP Cloud for Customer

Logical System ID: logical ID of the SAP ERP system

4. Modify the impex le essentialdata-c4cquoteOutboundDestinations.impex with appropriate values for credentials and host name, and then
select Import Impex to import the code.

Related Information
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 94/99
3/5/2020
Replicating Quote Between SAP Commerce and SAP Cloud for Customer
c4ccpiquote Extension

Testing SAP Cloud for Customer Integration


This document presents the steps necessary to test the integration of SAP Commerce with SAP Cloud for Customer solution.

Single Sign-On (SSO) Functionality


Perform the following steps:

1. Go to the following address: https://<hostname:port>/samlsinglesignon/saml. This link takes you to SAP Cloud Identity login page.

2. On SAP Cloud Identity login page, enter SAP Cloud for Customer employee's credentials and log in. After successfully logging in, you are redirected to the
page whose location you speci ed in the sso.redirect.url property of the local.properties le.

3. Go to the following address:https://<hostname:>sso.dev.sapbydesign.com. You can view this link in the SAP Cloud for Customer system. Go to
Administrator work center, then to Con gure Single Sign-On view, and at the end go to Single Sign-On URL Handling. If SSO is activated, this link will take
you to the SAP Cloud for Customer login page.

4. On the login page, enter SAP Cloud for Customer credentials and log in.

Customer Creation
To check if the replication of customers from the SAP Commerce storefront to SAP Cloud for Customer is working correctly, perform the following steps:

1. On the SAP Commerce storefront, click the Sign in / Register link.

2. In the Create An Account section, provide the necessary information.

3. Log in to SAP Cloud for Customer solution and switch to the Customers tab.

4. In the search eld, type the e-mail address you provided on the SAP Commerce storefront.

Ticket Creation
To create a support ticket, perform the following steps:

1. Create a new customer or log in as an existing one to the storefront.

2. Navigate to the My Account → Support Tickets area.

3. Click the Request Support button.

4. On the Request Customer Support page, enter the Subject and the Message of the ticket.

5. Click the Submit button. Your ticket is sent to the customer service system.

 Note
When your ticket is sent successfully, the following message is displayed: Thank you for your customer support request. Your message has been sent
to one of our Customer Service Agents who will contact you shortly.

Ticket Visibility in SAP Cloud for Customer


To check if the ticket was sent to the SAP Cloud for Customer, perform the following steps:

1. Log in to SAP Cloud for Customer system.

2. Switch to the Customers tab.

3. Switch to the Individual Customers tab.

4. Search for the customer who you used to create the ticket and ensure the ticket is visible in the SAP Cloud for Customer.

Navigation from SAP Cloud for Customer to SAP Commerce Storefront


The SAP Commerce Storefront link is available on the following views in SAP Cloud for Customer:

Customers > Accounts

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 95/99
3/5/2020
Customers > Contacts

Customers > Individual Customers

Help Center > Live Activity

Service > Tickets

To check if the customer support agent can navigate from SAP Cloud for Customer to SAP Commerce Storefront, perform the following steps:

1. Log in to SAP Cloud for Customer system.

2. Go to any view (listed above) that has the SAP Commerce Storefront link. For example, in the Customers work center, click Individual Customers.

3. Click on an ID in a row.

4. In the screen that appears, click Actions, and choose SAP Commerce Storefront.

SAP Cloud for Customer user should be automatically logged in to SAP Commerce Storefront.

Running SAP Cloud for Customer ATDD Tests Guide


You can set up the ATDD (Acceptance Test Driven Development) tests for SAP Commerce - SAP Cloud for Customer integration.

This document guides you through the setup process of the ATDD test for SAP Cloud for Customer on your local machine.

 Note
An SAP Commerce extension may provide functionality that is licensed through different SAP Commerce modules. Make sure to limit your implementation to
the features de ned in your contract license. In case of doubt, please contact your sales representative.

 Note
This document uses the term:

{HYBRIS_HOME} to refer to the directory where you unzipped SAP Commerce package.

Download SAP Commerce Package


Download the latest SAP Commerce release. For more information, see Download.

Con gure SAP Commerce


1. Navigate to {HYBRIS_HOME} and unzip SAP Commerce.

2. Navigate to {HYBRIS_HOME}/installer and in command prompt run:

install.bat -r b2c_c4c - Windows machines

./install.sh -r b2c_c4c - Unix related systems

Add c4ccustomeratddtests to Con guration


1. Navigate to {HYBRIS_HOME}/hybris/config/localextensions.xml and add c4ccustomeratddtests:

<extensions>
<!-- ... -->
<extension name='c4ccustomeratddtests' />
<!-- ... -->
</extensions>

2. Navigate to {HYBRIS_HOME}/hybris/config/localproperties and update Data Hub port to 8080:

datahub.c4c.exportURL=http\://127.0.0.1\:8080/c4c-endpoint-mock-webapp/services/businessPartnerReplicationInMockService
y2ysync.datahub.url=http\://localhost\:8080/datahub/v1/data-feeds/y2ysync
datahub.server.url=http\://localhost\:8080/datahub/v1

3. In the localproperties le, add the following line and replace the ${HYBRIS_HOME} with absolute path where you unzipped the SAP Commerce
package.

c4ccustomeratddtests.war.path=${HYBRIS_HOME}/c4c-integration/binary/c4c-datahub-webapp.war

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 96/99
3/5/2020

Start ATDD tests


1. Navigate to {HYBRIS_HOME}/hybris/bin/platform and in command prompt run the following command:

setantenv.bat - Windows machines


./setantenv.sh - Unix related systems

2. In the command prompt, run the following command:

ant all yunitinit alltests -Dtestclasses.extensions=c4ccustomeratddtests

Related Information
c4c-integration-raw Extension
c4c-integration-canonical Extension
c4c-integration-target Extension
c4c-integration-soap-adapter Extension
Data Hub
Synchronization Between SAP Commerce Installations

Con gurations in SAP Cloud Platform Integration


Con gure and deploy integration ows in SAP Cloud Platform Integration, to replicate customer data from SAP Commerce to SAP Cloud for Customer.

Before performing these con gurations, ensure that you have received the SAP Cloud Platform Integration provisioning email. You must also ensure that the
required user credentials have been created for SAP Cloud Platform Integration.

 Note
You can also perform the replication of customer data using Data Hub.

Replicating Customer Data from SAP Commerce to SAP


Cloud for Customer
The replication of customer data from SAP Commerce to SAP Cloud for Customer happens when the customer account is created in SAP Commerce.

Prerequisites
You must have a valid SAP license and a valid SAP Cloud Platform Integration tenant subscription.

Context
The customer account can be created by the customer directly using the SAP Commerce storefront or by the customer support agent (on request by the
customer). Once the customer account is created in SAP Commerce, the customer data is replicated to SAP Cloud for Customer using SAP Cloud Platform
Integration package.

Con gure the following in SAP Cloud Platform Integration for the replication of customer data.

Procedure
1. Log in to SAP Cloud Platform.

2. Choose the package SAP Commerce Cloud Integration with SAP Cloud for Customer.

3. Choose Artifacts.

4. Choose the action icon corresponding to the respective iFlow and choose Con gure.

5. Con gure the following parameters:

iFlow Name iFlow Description Parameter Parameter Description

Replication-of-Customer-from-SAP- Replicate customer data from SAP Type Select All Parameters to view all
Commerce-Cloud-to-SAP-Cloud-for- Commerce to SAP Cloud for Customer con gurable parameters
Customer

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 97/99
3/5/2020

iFlow Name iFlow Description Parameter Parameter Description

Basic Authentication Provide credential name as de ned in


SAP Cloud Platform Integration
security material.

Basic Partner URL Provide partner URL

Billing Address Code Provide billing address code for the


customer in SAP Cloud for Customer

Blocked Indicator Blocked status of customer pro le in


SAP Cloud for Customer. Default value
is false.

Category Code Customer category code in SAP Cloud


for Customer

Cellphone Usage Code Cellphone usage code in SAP Cloud for


Customer

Communication System ID SAP Commerce communication


system ID

Default Address Code Default address code in SAP Cloud for


Customer

Deleted Indicator Deleted status for customer pro le in


SAP Cloud for Customer

Email Usage Code Email usage code in SAP Cloud for


Customer

Fax Usage Code Fax usage code in SAP Cloud for


Customer

Gender Code Gender code for SAP Cloud for


Customer

Local System ID Current system ID

Phone 1 Usage Code Phone 1 usage code in SAP Cloud for


Customer

Phone 2 Usage Code Phone 2 usage code in SAP Cloud for


Customer

Release Indicator Released status for customer pro le in


SAP Cloud for Customer

Role Code Role code for customer pro le in SAP


Cloud for Customer

Shipping Address Code Shipping address code in SAP Cloud for


Customer

6. Click Save to save the con gurations.

7. Click Deploy for the con gurations to take effect.

Related Information
SAP Commerce Integration with SAP Cloud for Customer on SAP API Business Hub

Replicating Quote Between SAP Commerce and SAP


Cloud for Customer
Con gure the settings in SAP Cloud Platform Integration to replicate a B2B quote between SAP Commerce and SAP Cloud for Customer.

Context
A B2B commerce quote created in SAP Commerce is replicated SAP Cloud for Customer for further processing. Any updates to the quote in SAP Cloud for
Customer are replicated back to SAP Commerce.

Procedure
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 98/99
3/5/2020
1. Log in to SAP Cloud Platform.

2. Choose the package SAP Commerce Cloud - B2B Integration with SAP Cloud for Customer.

3. Choose Artifacts.

4. Choose the action icon corresponding to the required integration ow, and choose Con gure.

5. Con gure the following parameters:

iFlow Name iFlow Description Parameters Parameter Description

CommerceQuoteOutbound Replicates quote from SAP Commerce QuoteReplicationURL Target URL for SAP Cloud for Customer
to SAP Cloud for Customer System quote replication service interface

CommunicationSystemID Con gured in the communication


system of SAP Cloud for Customer

LocalSystemID Con gured in the communication


system of SAP Cloud for Customer

Credential Name SAP Cloud for Customer system


credentials provided in communication
system

CommerceQuoteCon rmationInbound Noti es SAP Commerce about the Address SAP Commerce host URL
external ID from SAP Cloud for
Customer Proxy Type On-Premise or Internet

Location ID Cloud Connector location ID if proxy


type is On-Premise

Credential Name SAP Commerce credentials

CommerceQuoteInbound Replicates the updated quote from SAP Address SAP Commerce host URL
Cloud for Customer to SAP Commerce
Proxy Type On-Premise or Internet

Location ID Cloud Connector location ID if proxy


type is On-Premise

Credential Name SAP Commerce credentials

CommerceOrderNoti cationOutbound Noti es SAP Cloud for Customer about QuoteUpdationURL Target URL for SAP Cloud for Customer
the order creation in the back end and quote updation service interface
updates the order information in the
quote CommunicationSystemID Con gured in the communication
system of SAP Cloud for Customer

LocalSystemID Con gured in the communication


system of SAP Cloud for Customer

Credential Name SAP Cloud for Customer system


credentials provided in communication
system

6. Click Save to save the con gurations.

7. Click Deploy for the con gurations to take effect.

Related Information
Con guring SAP Commerce for Quote Replication using SAP Cloud Platform Integration
SAP Commerce Cloud - B2B Integration with SAP Cloud for Customer on SAP API Business Hub

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=8c47c75c86691014895c8d27d7… 99/99

Das könnte Ihnen auch gefallen