Вы находитесь на странице: 1из 54

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 CRM: Self Services


With SAP Commerce, registered B2B and B2C customers can perform various self-service tasks on the SAP Commerce storefront such as registering a product,
creating a service ticket, viewing and renewing service contract, viewing service orders, and so on. The commerce solution also provides the single sign-on feature
to access the Assisted Service Module (ASM) from SAP CRM.

Related Information
Service Request Management
Complaints Management
Service Contract Management

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c417… 1/54
3/5/2020
Service Order Management
Single Sign-On to Assisted Service Module
Product Registration

Service Request Management


A service request is a ticket created by the customers in SAP Commerce when they encounter any problems such as issue in using a product, ordering a product,
and so on. Alternatively, customers can call a service agent in SAP CRM Interaction Center to create a service request on their behalf.

Process Flow

Service Ticket Process Flow

1. Customer encounters an issue.

2. Customer logs into SAP Commerce storefront.

3. Customer creates a service ticket. For information on how to create a ticket, see the Creating a Support Ticket section in crmcustomerticketingaddon
AddOn.

Alternatively, customers can call a service agent in SAP CRM Interaction Center to create a service request on their behalf.

 Note
If the customer service agents in SAP CRM need to access the customer cart or related details on the storefront, the single sign-on feature allows them a
seamless login to the Assisted Service Module.

4. The service ticket is replicated to SAP CRM as a service request. If the service request is created in SAP CRM, then the request is replicated from SAP CRM
to SAP Commerce. Any updates made to the service request in SAP CRM or SAP Commerce is replicated between the two systems.

For information on ticket replication, see Understanding the Replication of Service Requests.

5. If needed, a service order is created in SAP CRM as a follow-up activity of the service ticket, which gets resolved eventually.

For more information on service order process ow, see Service Order Management.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c417… 2/54
3/5/2020

Data flow between SAP CRM and SAP Commerce via Data Hub with the service ticket flow highlighted

Related Information
Tickets

Understanding the Replication of Service Requests


The service tickets, created by the customer in SAP Commerce or by the customer service agent in SAP CRM Interaction Center, are replicated from SAP
Commerce to SAP CRM and vice versa.

Service ticket replication takes place in the following scenarios:

A service ticket created by the customer in SAP Commerce storefront is replicated from SAP Commerce to SAP CRM.

A status change or any other updates to the service request in SAP CRM is replicated to SAP Commerce.

A service request created by the Customer Service Agent in SAP CRM is replicated to SAP Commerce.

A status change or any other updates to the service ticket in SAP Commerce is replicated to SAP CRM.

 Note
If the service ticket is related to an order, make sure that the customer attribute is maintained in the ticket, as it is mandatory for service request creation in SAP
CRM.

Service Request Replication Data Flow


The service ticket data from SAP Commerce is transferred in CSV format to Data Hub, where it is transformed and processed, and then transferred to SAP CRM in
the form of intermediate documents (IDocs). Service requests created in SAP CRM are sent to Data Hub in the form of IDocs, where they are transformed and
processed, and then transferred to SAP Commerce as impex les.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c417… 3/54
3/5/2020

Service Request Replication Data Flow

Service ticket created in SAP Commerce is replicated to SAP CRM as a service request. Any updates to the service ticket in SAP Commerce is also replicated to
SAP CRM.

Service Ticket Replicated from SAP Commerce to SAP CRM

Any updates to the service request in SAP CRM is replicated back to SAP Commerce. A service request created by the Customer Service Agent in SAP CRM is
replicated to SAP Commerce.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c417… 4/54
3/5/2020

Service Ticket Replicated from SAP CRM to SAP Commerce

Making Settings in Backoffice for Service Request


Replication
Con gure the required settings in Backoffice to enable the replication of service tickets from SAP Commerce to SAP CRM and vice versa.

Settings and Descriptions


Under SAP Integration SAP Base Store Con gurations Service Management , make the following settings:

Setting Description

Service Request Type Transaction type of the service request from SAP CRM

Service Organization Enter the ID of service organization

Service Organization Responsible Enter the ID of service organization responsible

Service Organization Short Enter the text (code) of service organization

Schema ID Enter the schema ID

Catalog Name Enter the catalog name

Mapping Details
Service ticket replication between SAP CRM and SAP Commerce requires the mapping of status and data.

A customer service ticket created in SAP Commerce belongs to any of the following categories:

Complaint

Problem

Enquiry

For category mapping, the respective category code, catalog type, and code group should be maintained in both SAP and SAP CRM.

A sample category mapping:

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c417… 5/54
3/5/2020
Catalog type ZR

Code Group ZSERGRP

Code Short text for code

Z002 Complaint

Z005 Problem

Z006 Enquiry

For information on creating categorization schema in SAP CRM, see Multilevel Categorization.

When a service request updated in SAP CRM is replicated back to SAP Commerce, only the following elds are replicated:

Subject

Message

Associated To

Category

Priority

Reference Objects – Refers to any associated service order, installed base or its components

Status Mapping
A service ticket created in SAP starts with the NEW status. When the ticket is being acted upon, the status is changed to OPEN, and when the issue is resolved the
status is changed to CLOSED. The status of the replicated service request in SAP CRM is summarized in the following table:

Ticket Status in SAP Commerce Ticket Status in SAP CRM

New New

Open In Process

Closed Completed

Data Model in SAP Commerce

Data Table Description

CsTickets Maintains ticket details

CsTicketEmail Maintains the elds relevant to e-mail generation

CsTicketEventEmailCon g Maintains e-mail con guration details like the e-mail template

CsTicketRelatedObject Any referred object in ticket. The reference object may be a service order, installed base, or installed base component. The ObjectType
represents the type of object referred such as installedBaseId. The types are con gured in the properties le.

Data Model in SAP CRM


IDoc for Service Request: CRMXIF_ORDER_SAVE_U04

Data Mapping From SAP Commerce to CRM

SAP Commerce Ticket CRM Segment CRM Field Value


Attribute

Mandatory in SAP Commerce

Headline E101CRMXIF_BUSTRANS Description

TicketID E101CRMXIF_BUSTRANS Object_id

Category E101CRMXIF_BUSTRANS-E101CRMXIF_SUBJECT_XT- CODE


E101CRMXIF_SUBJECT

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c417… 6/54
3/5/2020

SAP Commerce Ticket CRM Segment CRM Field Value


Attribute

State CRMXIF_ORDER_SAVE_U04$E101CRMXIF_BUSTRANS Status

$E101CRMXIF_STATUS_XT$E101CRMXIF_STATUS

Non Mandatory in SAP Commerce

Customer CRMXIF_ORDER_SAVE_U04$E101CRMXIF_BUSTRANS PARTNER_NO

$E101CRMXIF_PARTNER_XT$E101CRMXIF_PARTNER

Order Object_id

Priority CRMXIF_ORDER_SAVE_U04$E101CRMXIF_BUSTRANS PRIORITY

$E101CRMXIF_ACTIVITY_X$E101CRMXIF_ACTIVITY

Reason NOT THERE

Comment CRMXIF_ORDER_SAVE_U04$E101CRMXIF_BUSTRANS NOTES

$E101CRMXIF_TEXT_XT$E101CRMXIF_TEXT$E101CRMXIF_TLINE

ObjectType E101CRMXIF_BUSTRANS-E101CRMXIF_REF_OBJECT_XT- IB_INSTANCE IB_INSTANCE contains all 0s if the


E101CRMXIF_REF_OBJECT-IB_INSTANCE request is created from Installed
Base. Hence ObjectType is
installedBaseID.

ObjectGuid E101CRMXIF_BUSTRANS-E101CRMXIF_REF_OBJECT_XT- IBASE_COMP_GUID


E101CRMXIF_REF_OBJECT-IBASE_COMP_GUID

Additional elds required in CRM

CRMXIF_ORDER_SAVE_U04$EDI_DC40 TABNAM EDI_DC40

DOCNUM Some Random Value

IDOCTYP CRMXIF_ORDER

_SAVE_U04

MESTYP CRMXIF_ORDER

_SAVE_M

CRMXIF_ORDER_SAVE_U04$E101CRMXIF_BUSTRANS OBJECT_TYPE BUS2000223

PROCESS_TYPE SRVR

CRMXIF_ORDER_SAVE_U04$E101CRMXIF_BUSTRANS PARTNER_FCT 00000001

$E101CRMXIF_PARTNER_XT$E101CRMXIF_PARTNER

PARTNER_PFT X

CRMXIF_ORDER_SAVE_U04$E101CRMXIF_BUSTRANS SALES_ORG O 50020093

$E101CRMXIF_ORGMAN_X$E101CRMXIF_ORGMAN

SALES_ORG_RESP O 50020093

DIS_CHANNEL 10

SERVICE_ORG O 50000007

SERVICE_ORG_RESP O 50000007

SERV_ORG_SHORT PC4UService

SER_ORGRESP_SHT PC4UService

CRMXIF_ORDER_SAVE_U04$E101CRMXIF_BUSTRANS USER_STAT_PROC IT000004

$E101CRMXIF_STATUS_XT$E101CRMXIF_STATUS

CRMXIF_ORDER_SAVE_U04$E101CRMXIF_BUSTRANS TEXT_ID S005

$E101CRMXIF_TEXT_XT$E101CRMXIF_TEXT

Replicating Service Requests


Once the service ticket is created in SAP Commerce, it is replicated automatically through Data Hub to SAP CRM, where a corresponding service request is created.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c417… 7/54
3/5/2020
The Ticket Replicated status in Backoffice, under Ticket System Tickets Administration tab, indicates the replication status of the ticket. The status is set to
false by default, and changes automatically to true, once the ticket is replicated to SAP CRM.

Service ticket integration with SAP CRM requires the following extensions:

sapcrmserviceticket (Data Hub extension)

sapcrmticketsystem (SAP Commerce extension)

crmcustomerticketingaddon AddOn

Creating a Support Ticket


Create a support ticket if you encounter any problems such as issues in using a product, ordering a product, and so on.

Procedure
1. Create a new customer or log in as an existing one on the SAP Commerce storefront.

2. Navigate to My Account Support Tickets/Complaints page.

3. Hover over the Add New option and select the ticket type from the list of options available.

4. In the Reason Category eld, specify the reason for creating the ticket. Reason categories are maintained in multiple levels and you can select these
categories sequentially.

Multi-level category selection allows the ticket to be assigned to the relevant department/agent easily. The options that appear for Reason Category 2 will
be based on the selection you make for Reason Category 1 and so on. You cannot skip a category and move to the next one.

5. Enter a subject for the ticket and select the required priority.

The category of the ticket is pre- lled, based on the selection during ticket creation.

6. If you have a cart or an order that this ticket relates to, select the cart or the order from the Associated To dropdown list.

7. Enter a message for the ticket and click Submit.

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 co

 Note
The document upload functionality is not supported in this addon since it is built on top of customerticketingaddon. This functionality is out of
the scope for CRM replication.

sapcrmticketsystem Extension
The sapcrmticketsystem extension provides the data model and business logic for replicating the customer service tickets for B2C customers to and from the
back-end system. The back-end system may be SAP CRM or SAP ERP.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c417… 8/54
3/5/2020
Tickets are typically created through tools such as the customer service module (CSM), and represent contacts with customers of Web store. With the SAP CRM
integration, it is assumed that CSM will be replaced by the Interaction Center module in SAP CRM. The customer can now create a ticket for himself from the
storefront with the help of customerticketingaddon AddOn. The sapcrmticketsystem extension provides the functionality for sending any ticket
created in SAP Commerce to the back-end system, or creates a ticket in SAP Commerce after receiving a request from the back-end system. The replication
process is triggered as soon as the ticket is created or updated in SAP Commerce or SAP CRM.

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

Data Model
The sapcrmticketsystem extension adds an additional eld to CsTicketModel de ned in the ticketsystem extension. The eld
isTicketReplicated determines whether the ticket has been replicated to SAP CRM successfully or not. If true, the ticket has been replicated to SAP CRM
successfully. Also, if a ticket is replicated from SAP CRM to SAP Commerce, this eld is set to true.

A new Item Type CsTicketRelatedObject is de ned. It refers to the related objects with service request. The referred object may be a service order, installed
base, or installed base component.

The Item Type contains following attributes:

ObjectId – The ID of the referred object.

ObjectType – The object type may be installedBaseId or componentId. It is con gured in the project properties le of the extension.

ObjectGuid – The object GUID received from the back end system.

The Csticket has one to many cardinality relation with CsTicketRelatedObject named CsTicket2CsTicketRelatedObject.

Services
All services for the sapcrmticketsystem extension are de ned in the Spring con guration le sapcrmticketsystem-spring.xml.

CsTicketExportService

This service provides a mechanism to export the newly created or updated ticket to Data Hub. It prepares a map containing the ticket attributes and their values to
create a CSV le, and then sends it to Data Hub. You may override or extend this service to implement the additional data that you may want to send to SAP CRM
system such as attachments, media, and so on.

<alias alias="ticketExportService" name="defaultCsTicketExportService" />

<bean id="defaultCsTicketExportService"

class="com.sap.hybris.crm.sapcrmticketsystem.outbound.CsTicketExportService">

<property name="dataHubOutboundService" ref="dataHubOutboundService" />

<property name="feed" value="${sapcrmticketexchange.outbound.datahub.feed}" />

<property name="baseStoreService" ref="baseStoreService"/>

</bean>

SapDefaultTicketService

This service extends DefaultTicketService to add the getTicketsForIbase API for fetching list of service tickets associated with an IBase from
database.

<alias name="sapDefaultTicketService" alias="ticketService" />

<bean id="sapDefaultTicketService"

class="com.sap.hybris.crm.sapcrmticketsystem.service.impl.SapDefaultTicketService"

parent="defaultTicketService" scope="tenant">

</bean>

SapDefaultTicketBusinessService

This service is used for triggering the export whenever a ticket has been created or updated. This service overrides TicketBusinessService, to include the
call to CsTicketExportService whenever any operation is performed on a ticket.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c417… 9/54
3/5/2020

<alias name="sapDefaultTicketBusinessService" alias="ticketBusinessService" />

<bean id="sapDefaultTicketBusinessService"

class="com.sap.hybris.crm.sapcrmticketsystem.service.SapDefaultTicketBusinessService"

parent="defaultTicketBusinessService" scope="tenant">

<!-- Strategies -->

<property name="ticketEventStrategy" ref="ticketEventStrategy" />

<property name="ticketEventEmailStrategy" ref="ticketEventEmailStrategy" />

<property name="ticketUpdateStrategy" ref="ticketUpdateStrategy" />

<property name="ticketExportService" ref="ticketExportService" />

<property name="sapCoreSAPGlobalConfigurationService" ref="sapCoreSAPGlobalConfigurationService" />

</bean>

DataHubCsTicketEventTranslator
This translator creates a ticket event and saves it in the ticket whenever data is received from SAP back-end via Data Hub. This is done to save the ticket comments
in CsTicketEvent coming from SAP CRM. If the ticket received does not exist in SAP Commerce, the event is created only if ticket data has notes in it.

The translators have corresponding helper classes containing the business logic of the translation process. Helper class for
DataHubCsTicketEventTranslator is DataHubInboundCsTicketEventHelper.

<alias name="defaultSapDataHubInboundCsTicketEventHelper" alias="sapDataHubInboundCsTicketEventHelper" />

<bean id="defaultSapDataHubInboundCsTicketEventHelper"

class="com.sap.hybris.crm.sapcrmticketsystem.inbound.impl.DefaultDataHubInboundCsTicketEventHelper">

<property name="modelService" ref="modelService" />

<property name="ticketEventEmailStrategy" ref="ticketEventEmailStrategy" />

<property name="ticketEventStrategy" ref="ticketEventStrategy" />

<property name="ticketDao" ref="ticketDao" />

</bean>

DataHubCustomerTranslator
This translator looks for the customer corresponding to the customer ID received in the ticket from Data Hub. If the customer exists, an instance of userModel is
saved in the ticket. This is done because the customers are replicated in SAP CRM with customerID present in CustomerModel, and CsTicketModel
contains reference of UserModel.

Helper class for DataHubCustomerTtranslator is DataHubInboundCustomerHelper.

<bean id="defaultSapDataHubInboundCustomerHelper"

class="com.sap.hybris.crm.sapcrmticketsystem.inbound.impl.DefaultDataHubInboundCustomerHelper">

<property name="flexibleSearchService" ref="flexibleSearchService" />

<property name="modelService" ref="modelService" />

</bean>

DefaultCsTicketValidateInterceptor
This interceptor checks the availability of customer in SAP Commerce. If the replication of service ticket is triggered from SAP CRM through Data Hub, but the
customer associated with the service ticket is not present in SAP Commerce, then you may choose one of the following options:

Allow the service ticket to be replicated to SAP Commerce without the customer. In this case, the service ticket is available in Backoffice with customer eld
as null.

Stop the replication of service ticket by setting the following property to <true>.

sapcrmticketsystem.customer.required = true

You can set this property to <false> to allow the replication of service ticket.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 10/54
3/5/2020
KeyGenerator
The TicketId con guration is done by overriding csTciketCodeGenerator bean de ned in ticketsystem-spring.xml. This TicketId con guration
is mapped to SAP CRM ticket ID by maintaining the same con guration there.

<bean id="CsTicketPrepareInterceptor"

class="de.hybris.platform.ticket.interceptors.CsTicketPrepareInterceptor" scope="tenant">

<property name="initialTicketState">

<util:constant static-field="de.hybris.platform.ticket.enums.CsTicketState.NEW" />

</property>

<property name="keyGenerator" ref="sapCsTicketCodeGenerator" />

</bean>

<alias name="defaultSapCsTicketCodeGenerator" alias="sapCsTicketCodeGenerator" />

<bean id="defaultSapCsTicketCodeGenerator"

class="de.hybris.platform.servicelayer.keygenerator.impl.PersistentKeyGenerator" init-method="init" scope="tenant">

<property name="key" value="csticket_code" />

<property name="digits" value="${keygen.ticket.sap_ticket_id.digits}" />

<property name="start" value="${keygen.ticket.sap_ticket_id.start}" />

<property name="numeric" value="${keygen.ticket.sap_ticket_id.numeric}" />

<property name="template" value="${keygen.ticket.sap_ticket_id.template}" />

</bean>

sapcrmb2bticketsystem Extension
The sapcrmb2bticketsystem extension provides reusable functions for inbound and outbound processing of service tickets for B2B customer.

The sapcrmb2bticketsystem extension is an enhancement to sapcrmticketsystem extension. Within the sapcrmb2bticketsystem extension, the
bean sapDefaultTicketService is rede ned to support service ticket functionality for B2B customers.

Dependencies
The sapcrmb2bticketsystem extension depends on the following extension:

sapcrmticketsystem: Provides basic functions for the inbound and outbound mapping enhanced via this extension.

Features
For more information about features, see sapcrmticketsystem Extension.

B2B-Speci c Enhancements
As this extension enhances sapcrmticketsystem, the default interceptors, services, and contributors from sapcrmticketsystem are also used for the B2B
scenario. The sapcrmb2bticketsystem extension additionally contains CsTicketB2bExportService which extends CsTicketExportService.

Services
All services for the sapcrmb2bticketsystem extension are de ned in the spring con guration le sapcrmb2bticketsystem-spring.xml.

CsTicketB2bExportService

This service provides a mechanism to export the newly created or updated ticket to Data Hub. It prepares a map containing the ticket attributes and their values to
create a CSV le, and then sends it to Data Hub. You may override or extend this service to implement the additional data, such as attachments, media, and so on,
that you may want to send to SAP CRM system.

<alias alias="ticketExportService" name="defaultCsTicketB2bExportService" />

<bean id="defaultCsTicketB2bExportService"

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 11/54
3/5/2020
class="com.sap.hybris.crm.sapcrmb2bticketsystem.outbound.CsTicketB2bExportService"
parent=”defaultCsTicketExportService”>

</bean>

Related Information
sapcrmticketsystem Extension

crmcustomerticketingfacades Extension
The crmcustomerticketingfacades extension provides populators, façade and constants required to work with service requests and complaints.

SapCrmTicketFacade
Below is the list of few important methods exposed in this façade:

getWSTicket – fetches ticket by given ticketID

createTicket/createComplaint – creates ticket/complaint with given ticketData

updateTicket/updateComplaint – updates ticket/complaint as per given ticketData

populateTicketRelatedObjectList – creates list of Related Object Model from DTO list

getTicketsForIbase – gets all the tickets associated with IBase

Populators
DefaultCrmTicketPopulator – populates ticket TicketData with data from CsTicketModel for service ticket/complaint's detail page

DefaultCrmTicketListPopulator – populates TicketsData with data from CsTicketModel for service ticket/complaint's listing page

DefaultCrmCategoryUrlPopulator – converts category model to category data

DefaultCategoryReversePopulator – converts category data to category model

DefaultComplaintOrderEntryPopulator – populates ComplaintAssociatedOrderEntryData with data from AbstractOrderEntryModel

Related Information
sapcrmticketsystem Extension

sapcrmcategoryschema Extension
The sapcrmcategoryschema extension provides new item types, populators, façades and services required to work with the category schema used in service
requests and complaints.

Item Types
The following item types are added as part of this extension:

CategorySchema

The CategorySchema item type holds the category schema information. Each item of CategorySchema holds the information below, along with other details:

Code – code or name of the category schema

Level – level of the source category in schema

sourceCategory – CategorizationCategory code

parentcategory – parent CategorizationCategory code

validTo – validity date of the category schema

CategorizationCategory

CategorizationCategory holds information of individual category in CategorySchema. The list of attributes of CategorizationCategory are:

Code – holds code

categorizationGuid – holds GUID

name – holds name

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 12/54
3/5/2020
Populators
CategorizationCategoryPopulator – this class is used for populating CategoryData with values from CategorizationCategoryModel.

Façades
SapCrmCategoriesFacade – this façade exposes the following methods:

getDefaultCategories – gives the list of subject categories based on the catgeory level, schema type, and date

getSubCategoriesForCode – gives the list of all sub(child) categories for the category code

Services
SapCrmCategoriesService – the list of a few important methods exposed in this service are:

getDefaultCategoriesByLevel – gives the list of subject categories based on the catgeory level and ticket/complaint creation date

getRelatedCategories – gives the list of subcategories for a given category code

getSchemaIDForAttribute – gives category schema ID con gured in Base Store Con guration

Related Information
crmcustomerticketingaddon AddOn

crmcustomerticketingaddon AddOn
The crmcustomerticketingaddon AddOn introduces to the storefront the functionality of listing, creating new, and updating existing support tickets.

AddOn De nition

 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, contact your sales representative.

Name crmcustomerticketingaddon

Description Introduces to the storefront the functionality of listing, creating new, and updating existing support tickets.

Requires
addonsupport Extension

customerticketingaddon AddOn

sapcrmticketsystem Extension

commerceservices Extension

Author SAP Commerce

Supported Markets and Channels


The crmcustomerticketingaddon AddOn is designed for the B2B market.

Supported B2B Commerce

Market

Channel Responsive

Controllers

Controller Description

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 13/54
3/5/2020

Controller Description

AccountCrmSupportTicketsPageController Handles displaying the list of support tickets on the Support Tickets page. The list is populated with TicketData
objects returned by the TicketFacade. For more information, see the customerticketingfacades Extension document.

 Note
By default, the list of returned tickets is sorted by the Time Modi ed attribute. On the storefront, you can also select
to sort the list by the Ticket ID attribute. For more information, see the Pagination section of the ticketsystem
Extension.

AccountSupportTicketWSController Handles the request sent for updating the related object like serviceorder.

ImpEx
The Support Tickets page and all its subpages and other CMS components are imported into SAP Commerce Accelerator using an ImpEx script, as shown in the
following example from the cms-content.impex le:

$contentCatalog=powertoolsContentCatalog
$contentCV=catalogVersion(CatalogVersion.catalog(Catalog.id[default=$contentCatalog]),CatalogVersion.version[default='Staged'])[
$contentCatalogName=Powertools Content Catalog
$productCatalog=powertoolsProductCatalog
$productCatalogName=Powertools Product Catalog
$productCV=catalogVersion(catalog(id[default=$productCatalog]),version[default='Staged'])[unique=true,default=$productCatalog:St
$picture=media(code, $contentCV);
$image=image(code, $contentCV);
$media=media(code, $contentCV);
$page=page(uid, $contentCV);
$contentPage=contentPage(uid, $contentCV);
$product=product(code, $productCV)
$category=category(code, $productCV)
$jarResourceCms=jar:com.sap.hybris.crm.crmcustomerticketingaddon.constants.CrmcustomerticketingaddonConstants&/crmcustomerticket
$addonExtensionName=crmcustomerticketingaddon

INSERT_UPDATE JspIncludeComponent;$contentCV[unique=true];uid[unique=true];name;page;&componentRef
;;AccountSupportTicketsHistoryComponent;Account Support Tickets Component;/WEB-INF/views/addons/$addonExtensionName/responsive/p
;;AccountCRMAddSupportTicketComponent;Account AddSupport Ticket Component;/WEB-INF/views/addons/$addonExtensionName/responsive/p
;;AccountCRMUpdateSupportTicketComponent;Account UpdateSupport Ticket Component;/WEB-INF/views/addons/$addonExtensionName/respon
;;CrmSupportTicketRightComponent;Crm Support Ticket Right Component;/WEB-INF/views/addons/$addonExtensionName/responsive/pages/a

For localization purposes, the CMS components are imported separately for every storefronts.

Support Ticket Form


By clicking the Create Ticket button, a support ticket form with editable input elds is displayed. The logic behind this functionality is introduced in the
com.sap.hybris.crm.crmcustomerticketingaddon.forms, which extends
de.hybris.platform.customerticketingaddon.forms.SupportTicketForm (customerticketingaddon) class. Every support ticket has two
editable input elds and three dropdown lists:

Name Type Description

Subject String The subject of the ticket. Its length cannot exceed 255 characters.

Message String The body of the ticket. Its length cannot be less than 1 character.

Associated Dropdown The cart or the order the ticket is associated to. Only available when a customer has a cart or an order.
To

Category Dropdown The category of the ticket. Available categories include Enquiry, Complaint, and Problem. These labels visible on the storefront can be changed by
editing the base_en.properties le.

Priority Dropdown The Priority of the ticket. Available Priority include Low, Medium, and High. These labels visible on the storefront can be changed by editing the
base_en.properties le.

Message History
The Message History page displays the history of information sent between the customer and the customer support agent. The messages sent by the customer
are aligned to the left, while the messages send by the customer support agent are aligned to the right.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 14/54
3/5/2020
Technically, displaying and aligning the messages correctly is done by a for-each loop within the accountUpdateSupportTicketPage.jsp le:

<c:choose>
<c:when test="${not empty ticketData.messageHistory}">
<tr>
<td class="supportTicketBR">
<div class="control-group">
<div class="controls">
<textarea readonly="readonly" >${fn:escapeXml(ticketData.messageHistory)}</textarea>
</div>
</div>
</td>
</tr>
</c:when>
<c:otherwise>
<c:forEach items="${ticketData.messagesHistory}" var="messageData">
<tr>
<td class="supportTicketBR">
<div class="control-group">
<c:choose>
<c:when test="${messageData.author eq 'Customer Service'}">
<c:set var="cssClass" value="controls right" scope="page"/>
</c:when>
<c:otherwise>
<c:set var="cssClass" value="controls left" scope="page"/>
</c:otherwise>
</c:choose>

<div class="${cssClass }">


<textarea rows="3" cols="35" readonly="readonly" >${fn:escapeXml(messageData.displayText)}</textarea
</div>
</div>
</td>
</tr>
</c:forEach>
</c:otherwise>
</c:choose>

Related Object for the Ticket


The related object page displays the object for the tickets it belongs to, for example the ticket created for installed base, component, or service order. Currently we
have provision for the creation for installed base and component, which is currently in the crmSupportTicketRightSlot.jsp le:

<%@ page trimDirectiveWhitespaces="true"%>


<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="formElement"
tagdir="/WEB-INF/tags/responsive/formElement"%>
<%@ taglib prefix="ycommerce" uri="http://hybris.com/tld/ycommercetags"%>
<c:if test="${fn:length(ticketData.relatedObjects) > 0}">
<div class="account-section-right-header">
<spring:theme code="text.account.supporttickets.referencobject"
text="Reference Object" />

</div>
<div class="row customer-ticketing-body">
<div class="col-md-8 col-xs-10">

<c:forEach var="ticketRelatedObjectData"
items="${ticketData.relatedObjects}" varStatus="loopCounter">

<label
for="text.account.supporttickets.createTicket.${ticketRelatedObjectData.objectType}"
class="control-label"><spring:message

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 15/54
3/5/2020
code="text.account.supporttickets.createTicket.${ticketRelatedObjectData.objectT
text="${ticketRelatedObjectData.objectType}" /> </label>
<c:choose>
<c:when test="${not empty ticketRelatedObjectData.objectGuid}">
<c:url
value="${ticketRelatedObjectData.objectUrl}${ticketRelatedObjectData.obj
var="relObjecturl" />
<a href="${relObjecturl}"><p class="form-control-static">${ticketRelatedObjectDa
</c:when>
<c:otherwise>
<c:url
value="${ticketRelatedObjectData.objectUrl}${ticketRelatedObjectData.obj
var="relObjecturl" />
<a href="${relObjecturl}"><p class="form-control-static">${ticketRelatedObjectDa
</c:otherwise>
</c:choose>
</c:forEach>

</div>
</div>
</c:if>

Messages and Localization


In the base_en.properties le, you can nd a list of all the storefront messages and labels used by the components provided by this AddOn, which includes a
list of all statuses and their localizations.

CMS Components
The CMS components added by the crmcustomerticketingaddon AddOn using the ImpEx scripts support localization. For more information, see
Localization of ImpEx Using Build Time Generation. This AddOn changes/adds the following CMS components:

Support Tickets page for listing support tickets

Add/Edit Support Ticket Page for creating or editing support tickets

AccountSupportTicketHistoryNavigationComponent for navigating to the Support Ticket listing pages from the My Account Page

AccountSupportTicketsHistoryComponent, AccountCRMAddSupportTicketComponent,
AccountCRMUpdateSupportTicketComponent, and CrmSupportTicketRightComponent for resolving the actual JSPs to render the results.

How to Install
1. Add the crmcustomerticketingaddon AddOn to your localextensions.xml le, ensuring the listed required extensions are also included.

 Note
Storefront Name

If you have renamed your storefront extension, you need to include some web spring con guration to your local.properties le:

<mystorefrontextensionname>.additionalWebSpringConfigs.myaddon=classpath:/myaddon/web/spring/myaddon-web-spring.xml

2. Open the command prompt and navigate to the hybris/bin/platform directory.

On Microsoft Windows systems, open the setantenv.bat le. Do not close the command window.

On Unix-related systems (such as Linux or Mac OS), run setantenv.sh by entering setantenv.sh. Do not close the command window.

3. Call the following command:

ant addoninstall -Daddonnames="crmcustomerticketingaddon" -DaddonStorefront.yacceleratorstorefront="yacceleratorstorefront

When the installation is successful, the BUILD SUCCESSFUL noti cation is displayed in the command prompt.

4. Initialize or update the server. If performing an update, make sure the following options are selected:

Update running system

Create essential data

Localize types

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 16/54
3/5/2020

Complaints Management
A complaint is an expression of dissatisfaction that a customer makes in relation to a service, product, or a billing document.

Complaint Process Flow

The process begins when the customer is dissatis ed with the usage of a service or product and wants to create a complaint.

1. Customer logs into the SAP Commerce storefront.

2. Customer creates a complaint:

Complaints without reference to an order

Complaints with reference to an order

Complaints with reference to order entries

For more information on how to create a complaint, see Creating a Complaint in SAP Commerce.

3. The complaint is replicated to SAP CRM. Any updates made to the complaint in SAP CRM or SAP Commerce is replicated between the two systems. For
more information, see Replicating Complaints.

4. The complaint is processed in SAP CRM.

5. Customers can view the status of the complaint in SAP Commerce.

Making Settings in Backoffice for Complaints


Con gure the required settings in Backoffice to enable the replication of complaints from SAP Commerce to SAP CRM and vice versa.

Under SAP Integration SAP Base Store Con gurations Service Management , in the Complaint Con guration section, make the following settings:

Setting Description

Complaint Type Transaction type of the complaint request from SAP CRM

Complaint Organization Enter the ID of service organization

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 17/54
3/5/2020

Setting Description

Complaint Organization Responsible Enter the ID of service organization responsible

Complaint Organization Short Enter the text (code) of service organization

Complaint Catalog Type Enter the value for the complaint category, for example <ZY>. This would be required
to retrieve the catalog type, for example Enquiry, Complaint, or Problem, from SAP
CRM.

Complaint Category Code Group Enter the complaint schema code group, for example <ZCOMPL>. This would be
required to retrieve the reason category code group from SAP CRM.

Mapping Details
Complaints replication between SAP CRM and SAP Commerce requires the mapping of status and data.

A customer complaint created in SAP Commerce belongs to any of the category imported from the SAP CRM system during initial setup
(customization.impex). For category mapping, the respective category code, catalog type, and code group should be maintained in both SAP Commerce and
SAP CRM.

A Sample Category Mapping

Catalog type ZY

Code Group ZCOMPL

For information on creating categorization schema in SAP CRM, see Multilevel Categorization.

When a complaint updated in SAP CRM is replicated to SAP Commerce, only the following elds are replicated:

Subject

Message

Associated To

Category

Priority

Reference Objects – Refers to any associated service order, installed base or its components

Status Mapping
A complaint created in SAP Commerce starts with the NEW status. When the complaint is being acted upon, the status is changed to OPEN, and when the issue is
resolved the status is changed to CLOSED. The status of the replicated complaint in SAP CRM is summarized in the following table:

Complaint Status in SAP Commerce Complaint Status in SAP CRM

New New

Open In Process

Closed Completed

Data Mapping from SAP Commerce to SAP CRM


The following table shows how data is modeled in Data Hub when complaint data is replicated from SAP Commerce to SAP CRM.

SAP Commerce Complaint Attribute SAP CRM Segment SAP CRM Field

Mandatory in SAP Commerce

Headline E101CRMXIF_BUSTRANS Description

TicketID E101CRMXIF_BUSTRANS Object_id

Category E101CRMXIF_BUSTRANS-E101CRMXIF_SUBJECT_XT- Code


E101CRMXIF_SUBJECT

State E101CRMXIF_ORDER_SAVE_U07$E101CRMXIF_BUSTRANS Status


$E101CRMXIF_STATUS_XT$E101CRMXIF_STATUS

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 18/54
3/5/2020

SAP Commerce Complaint Attribute SAP CRM Segment SAP CRM Field

Customer E101CRMXIF_ORDER_SAVE_U07$E101CRMXIF_BUSTRANS Partner No


$E101CRMXIF_PARTNER_XT$E101CRMXIF_PARTNER

Non-Mandatory in SAP Commerce

Order Object_id

Priority E101CRMXIF_ORDER_SAVE_U07$E101CRMXIF_BUSTRANS Priority


$E101CRMXIF_ACTIVITY_X$E101CRMXIF_ACTIVITY

Reason Not Present

Comment E101CRMXIF_ORDER_SAVE_U07$E101CRMXIF_BUSTRANS Notes


$E101CRMXIF_TEXT_XT$E101CRMXIF_TEXT$E101CRMXIF_TLINE

Additional elds required in SAP CRM

SAP CRM Segment Attribute Value

E101CRMXIF_ORDER_SAVE_U07$EDI_DC40 TABNAM EDI_DC40

DOCNUM Some Random Value

IDOCTYP CRMXIF_ORDER _SAVE_U07

MESTYP CRMXIF_ORDER _SAVE_M

CRMXIF_ORDER_SAVE_U07$E101CRMXIF_BUSTRANS OBJECT_TYPE

PROCESS_TYPE CRMC

CRMXIF_ORDER_SAVE_U07$E101CRMXIF_BUSTRANS PARTNER_FCT 00000001


$E101CRMXIF_PARTNER_XT$E101CRMXIF_PARTNER
PARTNER_PFT X

CRMXIF_ORDER_SAVE_U07$E101CRMXIF_BUSTRANS SALES_ORG
$E101CRMXIF_ORGMAN_X$E101CRMXIF_ORGMAN
SALES_ORG_RESP

DIS_CHANNEL

SERVICE_ORG

SERVICE_ORG_RESP

SERV_ORG_SHORT

SER_ORGRESP_SHT

CRMXIF_ORDER_SAVE_U07$E101CRMXIF_BUSTRANS$E101CRMXIF_STATUS_XT USER_STAT_PROC
$E101CRMXIF_STATUS

CRMXIF_ORDER_SAVE_U07$E101CRMXIF_BUSTRANS TEXT_ID
$E101CRMXIF_TEXT_XT$E101CRMXIF_TEXT

Replicating Complaints
Once the complaint is created in SAP Commerce, it is replicated automatically through Data Hub to SAP CRM, where a corresponding complaint is created.

Data Hub Con guration


Make the following con gurations in the local.properties le of Data Hub:

Append the following:

SAPCRMCOMPLAINT_INBOUND_POOL, SAPCRMCOMPLAINT_OUTBOUND_POOL in sapcoreconfiguration.autocompose.pools

SAPCRMCOMPLAINT_OUTBOUND_POOL.SapCrmSystem, SAPCRMCOMPLAINT_INBOUND_POOL.HybrisCore in
sapcoreconfiguration.autopublish.targetsystemsbypools

The Ticket Replicated status in Backoffice, under Ticket System Tickets Administration tab, indicates the replication status of the ticket/complaint. The status
is set to false by default, and changes automatically to true, once the ticket is replicated to SAP CRM.

Complaints integration with SAP CRM requires the following extensions:

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 19/54
3/5/2020
sapcrmcomplaint (Data Hub extension)

sapcrmcomplaintexchange (SAP Commerce extension)

sapcrmcategoryschema (SAP Commerce extension)

crmcustomerticketingfacades (SAP Commerce extension)

crmcustomerticketingaddon AddOn

Replicating Complaint Notes from SAP CRM to SAP


Commerce
To replicate Complaint Notes from SAP CRM to SAP Commerce, you must maintain the required con gurations in SAP CRM.

Procedure
1. In CRM customizing (SPRO), navigate to Customer Relationship Management Basic Functions Text Management De ne Text Determination
Procedure .

 Note
The following is a sample con guration, and is customizable.

2. Select Text Object as CRM_ORDERH with text determination procedure COMP001.

3. Select Text Determination Procedure as COMP001, maintained for complaint transaction type.

4. Click De nition of Procedure.

5. Create a Log text type S005, if not already maintained, with sequence 0005 and enter the value R in the Changes column, as shown in the diagram.

6. For Complaint Text type C001 and Recomm. Solution text type C003, enter the value P in the Changes column to display them as log.

Creating a Complaint in SAP Commerce


B2B and B2C customers can create a complaint with reference to a service, product, or a billing document.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 20/54
3/5/2020
Procedure
1. Log in to the SAP Commerce storefront.

2. Choose My Account Support Tickets/Complaints .

3. Choose Add New Complaint .

The complaint creation page appears.

4. Enter the following elds:

Reason Category — Choose the complaints category. You can lter down the category to choose the speci c one.

Subject — Enter the subject of the complaint

Priority — Choose the priority such as Low, Medium, or High

Associated Order (optional) — Choose the associated order to which the complaint is associated

Associated Entries (optional) — Select the item entries to which the complaint is associated

Message — Enter a message

 Note
The Associated Order and Associated Entries elds appear only if there are any completed orders.

5. Click Submit.

The complaint is created and is listed in the Support Tickets/Complaints listing page. The status of the newly created complaint is set to Open.

sapcrmcomplaintexchange Extension
The sapcrmcomplaintexchange extension provides the data model and business logic for replicating the complaints to SAP CRM.

The B2C customer can create a complaint from the SAP Commerce storefront with the help of crmcustomerticketingaddon AddOn. The
sapcrmcomplaintexchange extension provides the functionality for sending any complaint created in SAP Commerce to the SAP CRM back end system.The
replication process is triggered as soon as the complaint is created or updated in SAP Commerce. The complaint, when updated from SAP CRM, will be replicated
to SAP Commerce.

Data Model
The sapcrmcomplaintexchange extension adds additional elds to CsTicketModel de ned in the ticketsystem extension. The
associatedOrderEntries eld determines the order entries for which the complaint is raised. This is an optional eld as the complaint may or may not be
associated to an order .

The eld isTicketReplicated determines whether the complaint is replicated to SAP CRM successfully or not. If the value of the eld is set to True, the
complaint is replicated to SAP CRM successfully.

The eld reasonCategory determines the category of complaint and will be replicated to SAP CRM system.

The eld reasonCategoryLevel determines the level of reason category that is associated to the complaint.

Services
All services for the sapcrmcomplaintexchange extension are de ned in the Spring con guration le sapcrmcomplaintexchange-spring.xml.

ComplaintExportService

This service provides a mechanism to export the newly created or updated complaint to Data Hub. It prepares a map containing the complaint attributes and their
values to create a CSV le, and then sends it to Data Hub. You may override or extend this service to implement the additional data, such as attachments, media,
and so on, that you may want to send to SAP CRM.

<!-- Complaint Export -->


<alias alias="complaintExportService" name="defaultComplaintExportService" />
<bean id="defaultComplaintExportService"
class="com.sap.hybris.crm.sapcrmcomplaintexchange.outbound.ComplaintExportService">
<property name="feed"
value="${sapcrmcomplaintexchange.outbound.datahub.feed}" />
</bean>

SapDefaultComplaintBussinessService

This service is used for triggering the export whenever a complaint is created or updated. This service overrides DefaultTicketBusinessService, to include
the call to ComplaintExportService whenever any operation is performed on a complaint.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 21/54
3/5/2020

<alias name="sapDefaultComplaintBussinessService" alias="sapComplaintBussinessService" />


<bean id="sapDefaultComplaintBussinessService"
class="com.sap.hybris.crm.sapcrmcomplaintexchange.service.impl.SapDefaultComplaintBussinessService"
parent="defaultTicketBusinessService" scope="tenant" />

Key Generator
The complaintId con guration is done by overriding CsTicketPrepareInterceptor. If CsTicketModel that is created is of "complaint" type, then
sapComplaintCodeGenerator is used to create TicketId in CsTicketModel. Otherwise, defaultkeygenrator is used. The TicketId
con guration is mapped to SAP CRM complaint ID by maintaining the same con guration.

<!-- Prepare interceptor -->


<alias name="defaultSapCsTicketPrepareInterceptor" alias="CsTicketPrepareInterceptor" />
<bean id="defaultSapCsTicketPrepareInterceptor"
class="com.sap.hybris.crm.sapcrmcomplaintexchange.interceptors.SapCsTicketPrepareInterceptor"
scope="tenant">
<property name="initialTicketState">
<util:constant static-field="de.hybris.platform.ticket.enums.CsTicketState.NEW" />
</property>
<property name="keyGenerator" ref="sapCsTicketCodeGenerator" />
<property name="complaintKeyGenerator" ref="sapComplaintCodeGenerator" />
</bean>
<!-- Complaint Key Generator -->
<alias name="defaultSapComplaintCodeGenerator" alias="sapComplaintCodeGenerator" />
<bean id="defaultSapComplaintCodeGenerator"
class="de.hybris.platform.servicelayer.keygenerator.impl.PersistentKeyGenerator"
init-method="init" scope="tenant">
<property name="key" value="complaint_code" />
<property name="digits" value="${keygen.ticket.sap_complaint.digits}" />
<property name="start" value="${keygen.ticket.sap_complaint.start}" />
<property name="numeric" value="${keygen.ticket.sap_complaint.numeric}" />
<property name="template" value="${keygen.ticket.sap_complaint.template}" />
</bean>

Populator
CrmComplaintPopulator

This populator populates associatedOrder and associatedOrderEntries from CsTicketParameter to CsTicketModel.

sapcrmb2bcomplaintexchange Extension
The sapcrmb2bcomplaintexchange extension provides reusable functions for inbound and outbound processing of service complaints for B2B customer.

The sapcrmb2bcomplaintexchange extension is an enhancement to sapcrmcomplaintexchange extension. Within the


sapcrmb2bcomplaintexchange extension, the bean defaultComplaintExportService is rede ned to support service complaint functionality for B2B
customer.

Dependencies
The sapcrmb2bcomplaintexchange extension depends on the following extension:

sapcrmcomplaintexchange: Provides basic functions for the inbound and outbound mapping enhanced via this extension.

Features
For more information about features, see sapcrmcomplaintexchange extension.

B2B-Speci c Enhancements
As this extension enhances sapcrmcomplaintexchange, the default interceptors, services, and contributors from sapcrmcomplaintexchange are also
used for the B2B scenario. The sapcrmb2bcomplaintexchange extension additionally contains DefaultComplaintB2bExportService which extends
defaultComplaintExportService.

Services
All services for the sapcrmb2bcomplaintexchange extension are de ned in the spring con guration le sapcrmb2bcomplaintexchange-
spring.xml.

ComplaintB2bExportService

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 22/54
3/5/2020
This service provides a mechanism to export the newly created or updated complaint to Data Hub. It prepares a map containing the complaint attributes and their
values to create a CSV le, and then sends it to Data Hub. You may override or extend this service to implement the additional data, such as attachments, media,
and so on, that you may want to send to SAP CRM system.

<alias alias="complaintExportService" name="defaultComplaintB2bExportService" />

<bean id="defaultComplaintB2bExportService"
class="com.sap.hybris.crm.sapcrmb2bcomplaintexchange.outbound.ComplaintB2bExportService"
parent=”defaultComplaintExportService”>

</bean>

Related Information
sapcrmcomplaint Data Hub Extension

Single Sign-On to Assisted Service Module


The assisted service module (ASM) assists the service agents and service managers to streamline the service process to resolve customer issues. The module
provides the agents with tools to process service requests during the interaction with the customer, avoiding unnecessary callbacks or follow-ups.

The assisted service module (ASM) enables employees to provide real-time customer sales and service support using the same storefront that their customers
use, both physically in-store, and virtually online. For example, when a customer gets stuck with a purchase request or with account administration, they can
contact customer sales and service support personnel and give them their cart ID or account name. The customer service agent uses ASM to nd and access the
customer’s cart or account, and provide sales or account administration support.

If the customer calls the service agent in SAP CRM Interaction Center, to get support with a purchase request or with account administration, the customer service
agent in SAP CRM may need to access the customer cart or related details on the storefront. The service agent can launch ASM from the Interaction Center by
clicking the Start Commerce Session button. A service agent gets created in ASM and the ʻasagent’ role is assigned to the service agent. The Single Sign-On (SSO)
feature provides the customer service agent a seamless login to ASM.

 Note
The single sign-on feature to launch SAP Commerce from SAP CRM is available only if you access the Interaction Center using the Web UI.

Scenarios
For a registered customer, if the customer ID is received from the interaction center, then that customer will automatically be picked by SAP Commerce ASM. If the
customer ID is not received, the agent enters the customer ID and starts the session for the customer.

If the customer is not a registered customer, then the agent either gets the cart ID from the customer (if customer already has product in cart), or creates a new
cart for the customer. If the agent creates an order on behalf of the customer, then the agent must register the customer before starting checkout process or must
perform the checkout as a guest customer.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 23/54
3/5/2020
To register a customer on SAP Commerce storefront:

1. The agent gets the rst name, surname, and the email address of the customer and creates a new account by clicking the Create New Account button in
ASM.

2. A registration e-mail is sent to the customer.

3. The system creates a customer account without any password. The customer can use the forgot password functionality to request for a new password.

Bene ts of using ASM


The advantages of using the Assisted Service Module are:

Improved and quicker customer service offering using the already existing storefront implementation

Allows the sales and service of much more complex products and services online

Higher conversion rates and revenue by reducing customer's abandoned shopping cart rates, by ability to help customers complete their online purchase
journey

Reduces initial and ongoing development, maintenance, and training costs compared to other customer service solutions

Improves customer satisfaction by increasing transparency and the overall user experience

Provides a vital missing link to connect organizations with their customers

Single Sign-On
Single sign-on can be enabled using Security Assertion Markup Language (SAML) which is an XML-based open standard for exchanging authentication and
authorization data between SAML authority, that is, an identity provider (IdP) and a SAML consumer, that is, a service provider. An IdP creates, maintains, and
manages identity information for principals (users, services, or systems) and provides principal authentication to other service providers (applications) within a
federation or distributed network.

A standard SAML implementation is based on a prede ned system of trust where a user is authenticated by the IdP initially, and only the user’s identity is passed
between the service providers. The trust relationship is built using certi cates that have been previously distributed between the IdP and the service providers.
These certi cates are used to sign the communication between the IdP and service providers.

Enabling Single Sign-On


SAP Netweaver is used as the Identity provider to build a trust relationship between the service providers, SAP CRM, and SAP Commerce.

Prerequisites
To con gure SAP Netweaver as the Identity provider, ensure that IDMFederation.SCA is deployed on AS JAVA. If not, deploy the SCA on AS JAVA and restart
the system. For more information on installing the federation software, see Downloading and Installing the Federation Software.

The samlsinglesignon extension allows you to connect SAP Commerce with external identity provider (IDP) systems. Before starting with the tasks in
this section, familiarize yourself with the samlsinglesignon Extension.

 Note
The following instructions are speci c to con guring SAP Netweaver as the identity provider. You could also use other IdPs to maintain the trust relationship.

Procedure
1. Con gure SAP Netweaver as SAML 2.0 identity provider, and generate a keypair for encryption and signing on behalf of the identity provider.

2. Export the certi cate and metadata of the IdP to con gure the service providers to trust the IdP.

3. On the IdP, con gure a trust relationship with SAP CRM as the service provider.

4. Con gure SAP CRM as an SAML service provider.

5. Establish a trust relationship between SAP CRM and SAP Netweaver as the IdP.

6. Con gure SAP Commerce as a SAML service provider.

7. Establish a trust relationship between SAP Commerce and SAP Netweaver as the IdP.

8. On the IdP, con gure a trust relationship with SAP Commerce as the service provider.

When customer service agents access the Interaction Center, they will be redirected to the login page on the identity provider. The trust relationship
between the IdP and the service providers help authenticate the user credentials, and the user can log in to the service providers without any additional

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 24/54
3/5/2020
logins.

 Note
If you use secureportaladdon for early login or for registration purposes, for ASM customer emulation, change the property <property
name="agentSessionAttribute" value="as_agent_id"/> to <property name="agentSessionAttribute" value="ASM"/> in the secureportaladdon-
web-spring.xml le.

Con guring SAP Netweaver as SAML 2.0 Identity


Provider
Con gure SAP Netweaver as SAML 2.0 identity provider, and generate a keypair for encryption and signing on behalf of the identity provider.

Prerequisites
To con gure SAP Netweaver as the Identity provider, ensure that IDMFederation.SCA is deployed on AS JAVA. If not, deploy the SCA on AS JAVA and restart the
system. For more information on installing the federation software, see Downloading and Installing the Federation Software.

Procedure
1. Open http(s)://<java server host>:<port>/nwa.

2. Log in as a user with administrative rights for the SAML2 user interface.

3. On the Con guration tab, click Authentication and Single Sign-On.

4. Navigate to the SAML 2.0 tab.

If you are con guring SAML for the rst time, then you will get the message System is not configured to support SAML 2.0. Click Enable
SAML 2.0 Support to enable SAML 2.0 support.

5. On the Initial Settings page, provide a unique name for the identity provider and set the operational mode to identity provider, and click Next.

6. On the General Settings page, click the Browse button next to Encryption Keypair eld to generate a keypair for encryption and signature on behalf of the
identity provider.

7. In the Select Keystore Entry window, click Create and enter the details such as entry name, validity of the keypair and click Next.

8. On the Subject Properties page, enter country name and common name, and click Finish.

9. On the General Settings page, click OK, and then click Next.

10. On the Identity Provider Settings page, click Finish.

Exporting Certi cate and Metadata of the Identity


Provider
Export the certi cate and metadata of the IdP to con gure the service providers to trust the IdP.

Procedure
1. Navigate to the Con guration tab on the IdP and click Authentication and Single Sign-On.

2. On the SAML 2.0 tab, click Download Metadata.

3. In the Metadata Download window, click Browse to select the keystore entry for download.

4. Click Export Entry, and in the Export Entry to File window select PKCS#8 Key Pair as the export format.

5. Click the Download option for the X.509 Certi cate File.

6. Click Close and then click OK in the Select Keystore Entry window.

7. Click Download Metadata to save the le and close the window.

Con guring Trust for SAP CRM on the Identity Provider


On the IdP, con gure a trust relationship with SAP CRM as the service provider.

Procedure
1. Navigate to the Con guration tab on the IdP and click Authentication and Single Sign-On.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 25/54
3/5/2020
2. On the SAML 2.0 tab, click Trusted Providers.

3. Click Add and select Uploading Metadata File option.

4. On the Select Metadata page, click Browse to select the SAP CRM metadata le.

5. On the Metadata Veri cation page, click Browse to select the signing certi cate for the SAP CRM system.

6. Keep the rest of the settings to default, and click Next.

7. On the Artifact Endpoints page, Click Finish.

8. Specify the Name ID format for the communication with the service provider by selecting the provider from the list of trusted providers and clicking Edit.

9. On the Identity Federation tab, click Add and select the name format from the dropdown list.

10. Click OK and then click Save.

Con guring SAP CRM as SAML Service Provider


Con gure SAP CRM as a SAML service provider.

Procedure
1. On the SAP CRM system, start the SAML 2.0 con guration application (transaction SAML2).

If you have never con gured your system for SAML 2.0, the system displays a message that the client is not con gured for SAML 2.0.

2. Choose the Enable SAML 2.0 Support push button.

3. Enter a name for the service provider.

4. Continue through the con guration wizard and enter data as required.

This procedure only covers enabling SAML 2.0. Once the service provider is enabled, you can con gure the bindings supported by the service provider, trust
an identity provider, con gure identity federation, and protect resources with SAML.

5. Click the Finish push button.

For more details, see Enabling SAML Service Provider.

Establishing Trust Between SAP CRM and the Identity


Provider
Establish a trust relationship between SAP CRM and SAP Netweaver as the IdP.

Procedure
1. On the SAML 2.0 Con guration page, navigate to the Trusted Providers tab.

2. Click Add and select the Uploading Metadata File option.

3. On the Select Metadata page, click Choose File to select the metadata le of the IdP.

4. On the Metadata Veri cation page, click Choose File to select the certi cate to verify the metadata.

5. On the Provider Name page, provide an alias name for the IdP.

6. Keep the rest of the settings to default, and click Next.

7. Click Finish on the Authentication Requirements page.

8. Specify the Name ID format for the communication with the service provider by selecting the provider from the list of trusted providers and clicking Edit.

9. On the Identity Federation tab, click Add and select E-mail from the list of name Id formats.

10. Click OK and then click Save.

11. Click Enable to enable the identity provider.

SAP Netweaver is enabled as the IdP.

12. Navigate to the Local Provider tab, click Metadata and then click the Download Metadata button in the SAML 2.0 Metadata window, to con gure trust with
the IdP.

Con guring SAP Commerce as SAML Service Provider


Con gure SAP Commerce as a SAML service provider.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 26/54
3/5/2020
Procedure
1. Go to the SAP Commerce download page and download SAP Commerce.

On the SAP Commerce command prompt, change current directory to installer directory and run the ASM recipe by executing the command
install.bat/install.sh -r <asm recipe>. For more information on ASM, see Assisted Service Module.

2. Navigate to the {HYBRIS_HOME}/hybris/config folder and open localextensions.xml for edit with any text editor, and add the
samlsinglesignon extension entry as <extension name='samlsinglesignon' />

3. Save the changes.

4. In the console run install.bat -r <asm recipe> initialize.

5. Add to your hosts le the line - 127.0.0.1 electronics.local.

6. Start SAP Commerce Server with recipe by executing install.bat -r <asm recipe> start.

7. Navigate to http://electronics.local:9001/yacceleratorstorefront/electronics/en/ to make sure that the storefront is up and


running.

8. Enable ASM by appending <?asm=true> to the URL.

9. Con gure the following properties in the local.properties le:

sso.mapping. <rolename_coming from IdP>.usertype=Employee

sso.mapping.<rolename_coming from IdP>.groups=asagentsalesmanagergroup

sso.usergroup.attribute.key=<Key of SAML response capturing the role of the user>

sso. rstname.attribute.key=<Key in SAML response for rst name>

sso.lastname.attribute.key=<Key in SAML response for last name>

sso.userid.attribute.key=<Key in SAML response for email name>

The username to log in to ASM is asagent and the password is 123456.

Establishing Trust between SAP Commerce and the


Identity Provider
Establish a trust relationship between SAP Commerce and SAP Netweaver as the IdP.

Procedure
1. To import the IdP certi cate to samlKeystore le, navigate to the java bin directory and run the command keytool -importkeystore -
srckeystore PATH_TO_CERTIFICATE\crm_hybris.p12 –srcstoretype pkcs12 -destkeystore samlKeystore.jks -
deststoretype JKS.

This will generate a samlKeystore.jks le, which holds the certi cate information.

2. Copy the generated samlKeystore.jks file to the saml single sign on extension under COMMERCE_SUITE_PATH/hybris/bin/ext-
commerce/samlsinglesignon/resources/security.

The password to access the samlKeystore.jks le is ʻchangeit’.

3. Copy the IdP metadata.xml le to the location Samlsinglesignon-


COMMERCE_SUITE_PATH/hybris/bin/extcommerce/samlsinglesignon/resources/security.

4. Re ect these con gurations to spring-security-config.xml le under


COMMERCE_SUITE_PATH/hybris/bin/extcommerce/samlsinglesignon/resources/security.

5. In the bean with ID <keyManager>, replace default value of <sso.keystore.privatekey.alias> and <sso.keystore.default.certi cate.alias> with the alias of the
certi cate in the samlKeystore.jks.

6. In bean with ID <metadata> update property <signingKey> value with IdP signing key, and add the property <sso.cookie.name=samlPassThroughToken> to
the local.properties le.

7. Start the SAP Commerce server and then access the URL https://<host>:<ssl_port>/samlsinglesignon/saml/metadata, to generate
metadata for SAP Commerce.

8. Update the binding URL in the metadata le from <localhost> to SAP Commerce system IP address.

9. Update <sso.redirect.url> property in local.properties le with system IP address. For example, sso.redirect.url=https://<host>:
<ssl_port>/.

10. Update <sso.entity.id> property in local.properties le to the value as de ned in the metadata le uploaded on IdP.

Con guring Trust for SAP Commerce on the Identity


Provider
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 27/54
3/5/2020
On the IdP, con gure a trust relationship with SAP Commerce as the service provider.

Procedure
1. Navigate to the Con guration tab on the IdP and click Authentication and Single Sign-On.

2. On the SAML 2.0 tab, click Trusted Providers.

3. Click Add and select the Uploading Metadata File option.

4. On the Select Metadata page, click Browse to select the SAP Commerce metadata le.

5. On the Provider Name page, provide an alias.

6. Keep the rest of the settings to default, and click Next.

7. On the Artifact Endpoints page, click Finish.

8. Specify the Name ID format for the communication with the service provider by selecting the provider from the list of trusted providers and clicking Edit.

9. On the Identity Federation tab, click Add and select the name format from the dropdown list.

10. Click OK and then click Save.

Service Contract Management


The service contract details are retrieved from SAP CRM and are made available on SAP Commerce storefront.

 Note
The service contracts can be viewed and renewed in SAP Commerce storefront, you cannot make any modi cations to the contract. You can also renew and
terminate the service contract at an item level.

In SAP CRM, service contracts are outline agreements with business partners, which de ne services offered for a particular period. They represent long-term
service agreements with customers in relation to the content and scope of services guaranteed within speci c tolerance limits for certain parameters, for example,
within a prede ned timeframe.

In a service contract, you specify detailed information that has been agreed upon with the service recipient, such as:

Routine tasks for devices that you have sold or rented to the customer

Prices for the routine tasks

Objects for which services can be claimed

Conditions under which the contract can be canceled

During the validity period of the service contract, you can use the service contract for the following:

To trigger regular automatic billing

To determine whether a service request made by the customer is covered by the service contract

To determine whether a cancellation request from a customer is valid

To trigger follow-up activities before the validity period of the service contract runs out

Related Information
Service Contract

Making Settings in Backoffice for Service Contract


Display
Con gure settings in Backoffice to enable the display of service contracts on SAP Commerce storefront.

In Backoffice, under SAP Integration SAP Base Store Con gurations Service Management , con gure the following settings for service contract display:

Setting Description

Service Contract RFC Destination Specify the RFC destination of the SAP CRM system to retrieve the service contract
details. This value overrides the RFC setting on the Core Data tab.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 28/54
3/5/2020

Setting Description

Service Contract Type Indicate the type of the service contract.

Service Contract Notes Speci es the notes type (code) in CRM.

Con gure any of the following values (in bold):

0001 — Header Note

0002 — Internal Note

0003 — Final Note

1000 — Customer Wishes

S001 — Problem Description

Maximum Number of Results Maximum number of contracts to be retrieved from SAP CRM.

Status Mapping for Service Contract


Status mapping is a part of Customizing Impex coming from CRM backend (initial data) with header SAPStatus.

The following two types of statuses can be con gured in CRM backend:

User Status

User status is the status mapping coming from CRM backend as part of initial data upload (Customizing Impex). User statuses are not con gured by default in CRM
backend. In such scenarios, fallback status is used, that is system status which are always con gured for any backend type. These type of status are generally used
for the display.

System Status

System statuses are statuses which are set by system whenever some modi cation is done in the contract. List of possible system statuses are now part of
servicecontractaddon/resources/import/data/common folder which is imported at the time of system update/initialization as a part of project data
update. These statuses are used for con guration and pre-con rmation check in Renewal/Termination of service contracts and also for display when user statuses
are not con gured in the CRM backend.

SAPStatus is a new item type de ned as a part of sapservicecontractservices extension in sapservicecontractservices-items.xml to


maintain the status mapping coming as a part of initial data upload from CRM backend. It has the following three attributes:

code: status code such as E0001 for Open.

userPro le: userPro le is a con guration attached with every status code. Same status code are con gured with different user pro les.

description: localized text for status code such as Released for E0003.

SAP CRM Speci c Con gurations for Service Contract


Make the standard SAP CRM con gurations for service contract as de ned in the documentation.

The standard con gurations for service contract is de ned in the building block. Check the con guration guide under
http://help.sap.com/bp_crmv12007/CRM_DE/BBLibrary/html/C26_EN_DE.htm

Date pro le and Status pro le must be con gured as per the standard documentation.

Change process BLEX and TERM must be con gured as per the standard.

Viewing Service Contracts in SAP Commerce Storefront


Service contracts for B2B and B2C scenarios can be viewed synchronously in SAP Commerce storefront in the My Account section. Only registered customers can
view the service contract details.

In SAP Commerce storefront, you can view and renew the service contract. You can also renew and terminate the service contract at an item level. The Service
Contracts page in the My Account section lists all the contracts:

For B2B, the service contracts for that B2B unit is listed.

For B2C, the contracts associated only with that logged in customer is listed.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 29/54
3/5/2020
A service contract contains a header and an items list. Items can be either Service Products or Service Packages.

The following details from the service contract can be viewed in SAP Commerce storefront:

Contract details such as contract number and validity

General data such as contract description and status

Contract total and any additional notes

Contract item details

Renewing Service Contract in SAP Commerce


The customers can renew a service contract in SAP Commerce when the contract expires. A service contract quotation is created in the process of renewing a
contract and a new contract is created based on the existing contract. The service contract has one or more items associated with it. The customer can also renew
the service contract at the item level.

Prerequisites
Released.

Procedure
1. Log in to the SAP Commerce storefront.

2. Choose My Account Service Contracts .

The list of service contracts for the logged in account appears.To renew a service contract or an item level service contract, the status must be

3. Click the service contract that you want to renew.

The details of the service contract appears.

4. Click the Renew button corresponding to the service contract that you want to renew.

As part of the service contract renewal process, the following actions take place:

a. A service contract quotation is created in SAP CRM.

b. The service agent accepts the contract in SAP CRM.

c. A new service contract is created in SAP CRM.

d. The service contract is displayed in SAP Commerce.

 Note
The new contract is created based on the existing contract details. For example, let us assume the start date of the existing contract is July 01, 2015 and
the end date of the contract is June 30, 2016. In this case, the contract runs for a period of 12 months. So, the newly created contract will start on July 01,
2016 and end on June 30, 2017, and will run for a period of 12 months.

5. To renew the service contracts at an item level, click the Renew button corresponding to the item.

A new contract item is added to the existing contract with a new contract period. The duration of the new contract item remains the same as the existing
contract item. The status of the new contract item is set to Open.

Terminating Item Level Service Contract in SAP


Commerce
Customers can terminate a service contract at an item level in SAP Commerce for various reasons such as bad customer service, poor service delivery, and so on.

Prerequisites
To terminate a service contract at an item level, the status of the item must be Released. You cannot terminate the service contract, if the contract has not started
or if the contract has ended.

Procedure
1. Log in to the SAP Commerce storefront.

2. Choose My Account Service Contracts .

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 30/54
3/5/2020
The list of service contracts for the logged in account appears.

3. Click the service contract for which you want to do an item level termination.

The details of the service contract appears.

4. Click the Terminate button corresponding to the item for which you want to terminate the service contract.

The service contract for the item is terminated. The end date of the contract is changed to the current date on which the contract is terminated.

Extensions and AddOns for Service Contracts


The sapservicecontractbol, sapservicecontractservices, sapservicecontractfacades extensions and sapservicecontractaddon
AddOn provide technical information required to enable the display, renewal, and termination of service contracts from SAP CRM, on to the SAP Commerce
storefront.

The following graphic illustrates the high-level architecture of service contract display on SAP Commerce storefront:

The sapservicecontractaddon AddOn assists the display of service contracts that are fetched from SAP CRM. The sapservicecontractbol is
responsible for managing connection, making GENIL and RFC calls to SAP CRM. The sapservicecontractservices extension provides the back-end
services and the sapservicecontractfacades extension provides facades to view and perform operations on service contracts.

To enable service contract on SAP Commerce storefront, following extensions are required:

sapservicecontractaddon AddOn

sapservicecontractfacades extension

sapservicecontractservices extension

sapservicecontractbol extension

sapservicecontractaddon AddOn
The sapservicecontractaddon AddOn introduces the functionality of displaying, renewing, and terminating service contracts that are fetched from SAP
CRM, to the SAP Commerce storefront.

AddOn De nition

Name sapservicecontractaddon

Description Introduces to the storefront, the functionality of displaying, renewing, and terminating service contracts from the SAP CRM back-end.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 31/54
3/5/2020

Requires
addonsupport extension

sapservicecontractfacades extension

acceleratorstorefrontcommons extension

Author SAP

Supported Markets and Channels


The sapservicecontractaddon AddOn is designed for the B2C and B2B markets.

Supported B2C Commerce B2B Commerce

Market

Channel Desktop Responsive Desktop Responsive

Controllers

Controller Description

AccountServiceContractsPageController Handles displaying the list of service contracts on service contract listing page, and displaying contract details on service
contract detail page. It also handles displaying of renewal of service contracts, and renewal and termination of service
contract items. The list is populated with ServiceContractData objects returned by the ServiceContractFacade.
For more information, see the sapservicecontractfacades extension document.

System Setup
ServiceContractAddonSystemSetup: Service contract implementation of DefaultAddonSystemSupportSetup for import of service contract
speci c core data and sample data at the time of system initialization and update.

ImpEx
The Service Contract listing page and detail page are imported into SAP Commerce Accelerator using an ImpEx script.

For Desktop: cms-content.impex

For Responsive: cms-responsive-content.impex

SAP status mapping for possible system statuses are imported using the following impex le as part of essential data:

statuses.impex

Messages and Localization


In the base.properties le, you can nd a list of all the storefront messages and labels used by the components provided by this AddOn, which includes a list
of all statuses.

CMS Components
This AddOn changes/adds the following CMS components:

Service Contract page for listing service contracts.

Service Contract Detail Page to display service contract details with product items.

AccountServiceContractsNavigationComponent for navigating to the Service Contract listing pages from My Account Page for B2C and B2B
Desktop channel.

AccountServiceContractsNavigationComponent for navigating to the Service Contract listing pages from home page navigation for B2C
Responsive channel.

AccountContractDetailsHeadlineComponent, AccountContractDetailsItemsComponent,
AccountContractDetailsTotalsComponent, AccountContractDetailsGeneralDataComponent for resolving the actual JSPs to render
the results for B2C and B2B Desktop channel.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 32/54
3/5/2020
AccountContractDetailsHeadlineComponent, AccountContractDetailsTotalsComponent,
AccountContractDetailsItemsComponent, AccountContractDetailsActionsComponent,
AccountContractDetailsGeneralDataComponent for resolving the actual JSPs to render the results for B2C Responsive channel.

Modi cations Checklist


The modi cations that this AddOn makes to the Accelerator are listed below:

ImpEx Con guration Scripts Service Layer Page Controllers

Core Data Listeners Facade DTO Tags

Model Layer Facade Layer TLD

Model Interceptors CMS Components Filters

Cockpit Con guration Page Templates MVC Interceptors

Cockpit Beans JavaScript Spring Security

Validation Rules CSS Message Resources

Installing the sapservicecontractaddon AddOn


The sapservicecontractaddon is installed for managing service contracts that are fetched from SAP CRM, to the storefront.

Procedure
1. Add sapservicecontractaddon to your localextensions.xml, ensuring that the listed required extensions are also included.

2. Open the command prompt and navigate to the hybris/bin/platform directory:

On Microsoft Windows systems, open the setantenv.bat le. Do not close the command window.

On Unix-related systems (such as Linux or Mac OS), run setantenv.sh by entering ./setantenv.sh. Do not close the command window.

3. Call the following command:

ant addoninstall -Daddonnames=" sapservicecontractaddon " -DaddonStorefront.yacceleratorstorefront="yacceleratorstorefront

When the installation is successful, the BUILD SUCCESSFUL noti cation is displayed in the command prompt.

4. Initialize or update the server. If performing an update, make sure that the following options are selected:

Update running system

Clear the Backoffice con guration from the database

Create essential data

Localize type

5. For desktop storefront only:

a. Log in to the CMS cockpit http://<server-ip-address>:<port>/cmscockpit/ using the username cmsmanager and password 1234.

b. In left navigation pane, under websites, select the staged content catalog and then select Account Page. Click the Edit icon next to Body Content
Slot for My Account Homepage.

c. In the editor area on the right side, add a service contract component in the Editorial section.

d. In the pop-up window, select Account Service Contracts Navigation Component-staged version, and click Done.

e. Synchronize Body Content Slot for My Account Homepage.

f. Click the Edit icon next to Side Content Slot for My Account Homepage. In editor area on right side, click the Edit icon next to Navigation Node.

g. In the pop-up window, navigate to Hierarchy Links section and add the Service Contracts - ELE-S link.

h. Synchronize the content catalog version in the Backoffice, and check the My Account page on the storefront. The new component and link for service
contracts appear.

sapservicecontractfacades Extension
The sapservicecontractfacades extension provides the facade suite to access service and BOL (business object layer) layer to handle requests related to
service contracts for B2C scenarios.

Overview

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 33/54
3/5/2020
The sapservicecontractfacades extension uses service and BOL layer to create Data Object (POJO) response which can be used by storefront. The
extension provides response adjusted to meet the sapservicecontractaddon requirement.

Data Model

 Note
The classes in blue color are SAP Commerce out of the box classes.

Facade Layer

All beans for the sapservicecontractfacades extension are de ned in the sapservicecontractfacades-spring.xml spring con guration le.

ServiceContractFacade

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 34/54
3/5/2020
This is the facade layer which uses the services and the BOL layers to ful ll storefront requirement related to service contract. The ServiceContractFacade
interface provides generic methods used for various operations related to service contracts, including:

Method Signature Function

getPagedServiceContractData( nal PageableData pageableData) Get the list of contracts by calling service layer API

getPagedSynchronizedContractData( nal PageableData pageableData) Get the list of contracts by making call to BOL layer API

getServiceContractDataForIBase(String iBaseID) Get the list of contracts related to an IBase by making call to BOL layer API

getSynchronizedServiceContractDetails( nal String contractId) Get the contract details for a given contract ID by making call to BOL layer API

renewContract( nal String guid) Renew contract for a given GUID by calling BOL layer API

renewItem( nal String contractGuid, nal String itemGuid) Renew contract item for a given contract GUID and item GUID by calling service layer
API

terminateContractItem( nal String contractGuid, nal String itemGuid) Terminate the contract item for a given contract GUID and item GUID by calling
service layer API

DefaultServiceContractFacade is the default implementation for ServiceContractFacade.

<alias name="defaultServiceContractFacades" alias="serviceContractFacade" />


<bean id="defaultServiceContractFacades"
class="com.sap.hybris.sapservicecontractfacades.facade.impl.DefaultServiceContractFacade">
<property name="userService" ref="userService" />

<property name="contractService" ref="contractService" />


<property name="serviceContractConverter" ref="serviceContractConverter" />
<property name="typeService" ref="typeService" />
<property name="serviceContractSearchResultConverter" ref="serviceContractSearchResultConverter" />
</bean>

Populators

Name Description

DefaultServiceContractPopulator Populates the elds of ServiceContractData objects with information taken from
ServiceContractModel objects.

ServiceContractSearchResultPopulator Populates ServiceContractData DTO with ServiceContractSearchResult


contract data coming from BOL layer

ServiceContractItemResultPopulator Populates ServiceProductData DTO with ServiceContractItemResult


contract item data coming from BOL layer

sapservicecontractfacadesb2b Extension
The sapservicecontractfacadesb2b extension provides the facade suite to access service and BOL (business object layer) layer to handle requests related
to service contracts for B2B speci c scenario.

The sapservicecontractfacadesb2b extension is an enhancement to sapservicecontractfacades. This extension uses B2B speci c service and
BOL layer to create Data Object (POJO) response which can be used by B2B storefront. The extension provides response adjusted to meet the
sapservicecontractaddon requirement which is speci c for B2B scenarios.

Dependencies
The sapservicecontractfacadesb2b extension depends on the following extension:

sapservicecontractfacades: Provides response adjusted to meet the sapservicecontractaddon requirement.

Features
For more information about features, see sapservicecontractfacades extension.

B2B-Speci c Enhancements
As this extension enhances sapservicecontractfacades extension, the default converters and populators from sapservicecontractfacades are
also used for the B2B scenario. The mapping is enhanced for fetching and storing B2B speci c data of the customer, if the customer is an instance of B2B

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 35/54
3/5/2020
customer model. For this, new B2B populators are merged with other B2C populators in the converter bean from the sapservicecontractfacades
extension.

Populators

Name Description

DefaultB2BServiceContractPopulator Populates the B2B related elds (B2B unit) of ServiceContractData objects with
information taken from ServiceContractModel objects.

B2BServiceContractSearchResultPopulator Populates ServiceContractData DTO with B2B speci c (B2B unit)


ServiceContractSearchResult contract data coming from BOL layer.

Related Information
sapservicecontractfacades Extension
sapservicecontractaddon AddOn

sapservicecontractbol Extension
The sapservicecontractbol extension provides the back-end services to interact with SAP CRM to fetch, renew, and terminate service contracts.

Overview
The sapservicecontractbol extension makes RFC calls and uses GenIL API to interact with SAP CRM to fetch, renew, and terminate service contracts. The
extension provides implementation to ful ll service contract related requests coming from the sapservicecontractfacades extension. This extension uses
DTOs to transfer results of RFC calls and GENIL API to the façade layer.

Business Object Layer


All beans for the sapservicecontractbol extension are de ned in the sapservicecontractbol-spring.xml spring con guration le.

SapServiceContractBackendBusinessObject is the starting point for calling SAP CRM to get the service contract.

Method Description

SearchResultList getServiceContractsForCustomer(String UID, PageableData Get all service Contracts From CRM backend for current customer
pageableData, nal boolean reload)

getServiceContractsForIBase( nal String uid, nal String iBaseID) Get the service contracts related to an IBase from CRM backend for current customer

ServiceContractSearchResult getServiceContractDetails(String contractId) Get the contract details for the given contract ID

boolean isBackendDown(); Check if back-end connection is down or not

String renewContract(String guid) Renew service contract for given contract guid

String terminateContractItem( nal String contractGuid, nal String itemGuid) Terminate service contract item for given contract guid and item guid

String renewItem( nal String contractGuid, nal String itemGuid) Renew service contract item for given contract guid and item guid

The default implementation of this service is DefaultSapServiceContractBackendBusinessObject.

<alias alias="sapCrmbackendBusinessObject" name="sapCrmbackendBusinessObject" />


<bean id="sapCrmbackendBusinessObject" parent="sapCoreBusinessObject" class="com.sap.hybris.sapservicecontractbol.backendbusines
<property name="moduleConfigurationAccess" ref="sapServiceContractConfigurationAccess" />
<property name="sessionService" ref="sessionService"></property>
</bean>

This class uses SapCRMServiceContractBackend to manage the connection between SAP CRM and SAP Commerce and to call the API to fetch, renew, and
terminate service contracts based on various search parameters.

Method Description

SearchResultList getContracts( nal String uId, nal String queryParam) Get contracts for the given customer ID

getContractsForIBase( nal String uid, nal String iBaseID) Get contracts for an IBase by making call to CRM backend

ServiceContractSearchResult getContractsforContractId( nal String contractId) Get the contract details for the given contract ID

boolean isBackendDown(); Check if back-end connection is down or not

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 36/54
3/5/2020

Method Description

String renewContract(String guid) Renew service contract for the given contract GUID

String terminateContractItem( nal String contractGuid) Terminate service contract item for given contract GUID and item GUID

String renewItem( nal String contractGuid, nal String itemGuid) Renew service contract item for given contract GUID and item GUID

public List<SortData> getSearchSort() Get the sort options for the pageable data

The default implementation is DefaultSapCRMServiceContractBackend.

<alias name="defaultSapCRMServiceContractBackend" alias="sapCRMServiceContractBackend" />


<bean id="defaultSapCRMServiceContractBackend" class="com.sap.hybris.sapservicecontractbol.service.backend.impl.DefaultSapCRMSe
<property name="moduleConfigurationAccess" ref="sapServiceContractConfigurationAccess" />
<property name="managedConnectionFactory" ref="sapCoreJCoManagedConnectionFactory" />
<property name="defaultConnectionName" value="JCoStatefulServiceUser" />
<property name="defaultDestinationName" value="#{baseStoreService.getCurrentBaseStore().getSAPConfiguration().getSapServ
<property name="userService" ref="userService" />
<property name="baseStoreService" ref="baseStoreService" />
<property name="i18nService" ref="i18nService" />
<property name="jcoFunctionTerminate" value="CRM_HYB_SC_TERMINATE" />
<property name="jcoFuntionRenew" value="CRM_HYB_SC_QUOTATION_CREATE" />
<property name="jcoFuntionItemRenew" value="CRM_HYB_SC_EXTEND_I" /> </bean>

This class is responsible for connection handling between SAP CRM and SAP Commerce. It contains methods to fetch the list of contracts, renew, and terminate
the service contracts and to check status of back-end connection. This class makes use of JCoManagedConnectionFactory to establish connection.

BOL layer uses following pojo’s to handle and transfer results of GENIL and RFC calls:

Interface Default Implementation Description

SearchResultList DefaultSearchResultList BOL representation of contract search results and


provide implementation for various operations on it

ServiceContractGenilContainer DefaultServiceContractGenilContainer DTO to hold all the contract data coming from BOL layer

ServiceContractSearchResult DefaultServiceContractSearchResult DTO to store service contract details coming from SAP
CRM

ServiceContractItemResult DefaultServiceContractItemResult DTO to store service contract item details coming from
SAP CRM

The service contract implementation of the comparator class ServiceContractSearchResultComparator implements


omparator<ServiceContractSearchResult>.

The comparator class overrides Compare(obj O1,obj O2) for the UI based sorting of the result on various parameters such as Start Date, End Date, Contract
ID, Status, Net Value, and so on.

The SapServiceContractFactory class uses the GenericFactory instance to return the bean of SapServiceContractBackendBusinessObject
using the getBean method as genericFactory.getBean("sapCrmbackendBusinessObject").

sapservicecontractservices Extension
The sapservicecontractservices extension provides the back-end services to handle requests related to service contracts for B2C scenarios, coming from
the sapservicecontractfacades extension and uses the DAO layer to interact with database.

Overview
The sapservicecontractservices extension provides services and data modelling to perform various operations related to service contract such as fetch,
renew, and terminate. The sapservicecontractfacades extension uses this services to ful ll storefront requirement.

Services
All beans for the sapservicecontractservices extension are de ned in the sapservicecontractservices-spring.xml spring con guration le.

ContractService

This service provides a mechanism to handle service contracts. Service contract model can be changed and extended in the sapservicecontractservices-
items.xml le.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 37/54
3/5/2020

Method Description

String getUid( nal CustomerModel customer) Get UID for B2C customer

SearchPageData<ServiceContractModel> getAllContracts(CustomerModel customer, Get contracts for a given B2C customer asynchronously according to paging data
nal PageableData pageableData)

List<ServiceContractModel> getContracts(CustomerModel customer) Get all contracts for a given B2C customer asynchronously

List<SortData> getSortOptionsFromBol() Sort options which are stored in session

boolean checkBackendDown() Return whether back end connection is available or not

SearchResultList getServiceContractsForCustomerFromBol(PageableData Get all contracts from CRM backend for current customer
pageableData, nal boolean reload, nal CustomerModel customer)

ServiceContractSearchResult getServiceContractDetailsFromBol(String contractId) Get contracts for given contract

String renewContractFromBol(String guid) Renew contract for given contract GUID

String terminateContractFromBol( nal String contractGuid, nal String itemGuid) Terminate contract item with given contract GUID and Item GUID

String renewContractItemfromBol( nal String contractGuid, nal String itemGuid) Renew contract item with given contract GUID and Item GUID

The default implementation of ContractService is DefaultContractService. You may override or extend this service in order to implement your own
rules to work with service contracts.

<alias name="defaultServiceContractService" alias="contractService" />


<bean id="defaultServiceContractService" parent="abstractBusinessService"
class=" com.sap.hybris.sapservicecontractservices.service.impl.DefaultContractService">
<property name="serviceContractDao" ref="serviceContractDao" />
<property name="sapServiceContractFactory" ref="sapServiceContractFactory" />
</bean>

This service delegates retrieval of service contract to ServiceContractDao.

Method Description

List<ServiceContractModel> getContractsByCustomer( nal CustomerModel) Get contracts for a given customer

SearchPageData<ServiceContractModel> getAllContractsForCustomer( nal Get contracts for customer with SearchPageData Information
CustomerModel customer, nal PageableData pageableData)

DefaultServiceContractDao is the default implementation of ServiceContractDao. Many of the methods in DefaultServiceContractDao make
use of the PagedFlexibleSearchService.

<alias name="defaultServiceContractDao" alias="serviceContractDao" />


<bean id="defaultServiceContractDao"
class=" com.sap.hybris.sapservicecontractservices.dao.impl.DefaultServic eContractDao">
<property name="pagedFlexibleSearchService" ref="pagedFlexibleSearchService" />
</bean>

sapservicecontractservicesb2b Extension
The sapservicecontractservicesb2b extension provides the back-end services to handle requests related to B2B speci c service contract data coming
from the sapservicecontractfacadesb2b extension and also extends the dao layer to interact with database for fetching service contracts for the B2B
customer.

Overview
The sapservicecontractservicesb2b extension provides services to perform various operations related to service contract such as fetching service
contract for the B2B unit and so on. The sapservicecontractfacadesb2b extension uses this services to ful ll storefront requirement.

Services
All beans for the sapservicecontractservicesb2b extension are de ned in the sapservicecontractservicesb2b-spring.xml spring
con guration le.

B2BContractService

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 38/54
3/5/2020
This service overrides the DefaultContractService and provides a mechanism to handle service contracts for B2B customers. Service contract model can
be changed and extended in the sapservicecontractservices-items.xml le.

Method Description

String getUid( nal CustomerModel customer) Gets UID for a given B2B customer; otherwise, calls parent method.

List<ServiceContractModel> getContracts(CustomerModel customer) Gets all contracts for a given B2B customer asynchronously; otherwise, calls parent
method.

SearchPageData<ServiceContractModel> getAllContracts(CustomerModel customer, Gets contracts for a given B2B customer asynchronously according to paging data;
nal PageableData pageableData) otherwise, calls parent method.

This service delegates retrieval of service contract to B2BServiceContractDao.

Method Description

SearchPageData<ServiceContractModel> getAllContractsForUnit( nal B2BUnitModel Gets contracts for a given B2B unit with SearchPageData Information.
unit, nal PageableData pageableData)

List<ServiceContractModel> getServiceContractsForUnit( nal B2BUnitModel unit) Gets contracts for a given B2B unit.

DefaultB2BServiceContractDao is the default implementation of B2BServiceContractDao. Many of the methods in


DefaultServiceContractDao make use of the PagedFlexibleSearchService.

Service Order Management


A service order is used to record all the information needed to plan, execute, and bill for a service. Service order can be created as a follow-up from service
quotation, service contract, service request, or standalone.

 Note
To enable the service order functionality, you must activate the switch CRM_SERVICE_ASSIGNMENT_XIF under the business function
CRM_SERVICE_ASSIGNMENT.

The service order created in SAP CRM is replicated automatically to SAP Commerce and is made available on SAP Commerce storefront for viewing. This helps the
customers to follow-up on the status of the service ticket that is created in SAP Commerce.

For more information on service ticket, see Service Request Management.

 Note
The service orders can only be viewed on SAP Commerce storefront. You cannot make any modi cations to the service order.

Process Flow

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 39/54
3/5/2020

Service Order Process Flow

1. Customer creates a service ticket in SAP Commerce storefront.

2. Service ticket is replicated to SAP CRM.

3. Service agent creates a service order in SAP CRM as a follow-up activity of the service ticket.

4. The service order is replicated to SAP Commerce and is made available in SAP Commerce storefront.

5. The customer can view the status of the service order on the SAP Commerce storefront, and also see any associated service contract or service request.

6. If needed, service order scheduling is created in SAP CRM once the service order is released. The scheduling information is replicated to SAP Commerce.

7. The service agent attends to the customer at the scheduled time to resolve the queries.

8. Once the issue is resolved, the service agent closes the service order by setting the status to “Completed”.

 Note
This process ow is for a service order created as a follow-up activity of a service ticket. Similar process ows can be triggered as a follow-up activity of a service
quotation, service contract, or standalone.

For more information on service order management and con gurations in SAP CRM, see Service Order Management in SAP Help Portal.

Service Scheduling
Service scheduling is triggered as part of a service order. Once the service order is created and approved (released) by the service agent, a service schedule is
created. The service schedule is used for resolving the customer queries via site visit, phone call, email, and so on. Once the status of the service schedule is set to
"Completed" in SAP CRM, the service order is closed by setting the status to “Completed”.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 40/54
3/5/2020
 Note
The resource planner must manually set the status to Informed so that assignments can be transferred. For more information, see Service Employee
Assignments.

For more information on service scheduling and con gurations in SAP CRM, see Service Resource Planning.

Con gure in Backoffice for Service Order Display


You need to set the service order process type in Backoffice Administration Cockpit.

In Backoffice, under SAP Integration SAP Base Store Con gurations Service Management , enter SRVO as the service order process type for service order
display.

Mapping Details
The statuses and attributes in SAP CRM are mapped to SAP Commerce. The statuses in SAP Commerce are same as in SAP CRM.

SAP Commerce CRM Field Mapping


The following table shows how data is modeled in Data Hub when service order data is replicated from SAP CRM to SAP Commerce.

IDoc Type: CRMXIF_ORDER_SAVE_M01 (service order without scheduling information) / CRMXIF_ORDER_SAVE_U07 (service order with scheduling
information)

SAP Commerce Service Order Attribute SAP CRM Segment SAP CRM Field

Mandatory in SAP Commerce

Code E101CRMXIF_BUSTRANS Object_id

User E101CRMXIF_BUSTRANS-E101CRMXIF_PARTNER_XT-E101CRMXIF_PARTNER PARTNER_NO

date E101CRMXIF_BUSTRANS CREATED_AT

Currency E101CRMXIF_BUSTRANS-E101CRMXIF_PRICING_X-E101CRMXIF_PRICING CURRENCY_ISO

Non-Mandatory in SAP Commerce

servicecontractid E101CRMXIF_BUSTRANS-E101CRMXIF_DOC_FLOW_XT-E101CRMXIF_DOC_FLOW RELOBJ_OBJKEY

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 41/54
3/5/2020

SAP Commerce Service Order Attribute SAP CRM Segment SAP CRM Field

ibasecomponent E101CRMXIF_BUSTRANS-E101CRMXIF_REF_OBJECT_XT- IBASE_COMP_GUID


E101CRMXIF_REF_OBJECT

totalPrice E101CRMXIF_BUSTRANS-E101CRMXIF_CUMULATED_H_X- GROSS_VALUE


E101CRMXIF_CUMULATED_H

totalTax E101CRMXIF_BUSTRANS-E101CRMXIF_CUMULATED_H_X- TAX_AMOUNT


E101CRMXIF_CUMULATED_H

SAP Commerce Service Order Entry SAP CRM Segment SAP CRM Field
Attribute

Mandatory in SAP Commerce

order E101CRMXIF_BUSTRANS OBJECT_ID

product E101CRMXIF_BUSTRANS-E101CRMXIF_BUSTRANS_ITEM PRODUCT_GUID

quantity E101CRMXIF_BUSTRANS-E101CRMXIF_BUSTRANS_ITEM- ORDER_QTY


E101CRMXIF_SCHEDLIN_I_X-E101CRMXIF_SCHEDLIN_I

unit E101CRMXIF_BUSTRANS-E101CRMXIF_BUSTRANS_ITEM- PROCESS_QTY_UNIT_ISO


E101CRMXIF_PRODUCT_I_X-E101CRMXIF_PRODUCT_I

The values for catalog version is mapped to Sales Organization and Division. These values are con gured in Backoffice under SAP Global Con guration, and are
uploaded to Data Hub while performing system con guration.

Replicating Service Orders


The service order data from SAP CRM is pushed as IDoc in to Data Hub, where it is transformed and processed. Then the processed data is transferred to SAP
Commerce in the form of ImpEx, and the service orders are replicated to SAP Commerce.

Replication of Service Order

All the products in the service order must be replicated before the service order is replicated. In the service order entry, the catalog and version of the product is
determined by the setup done during product replication.

The catalog ID and version of the product in the service order is referenced with the online version of the catalog that is associated with the sales organization and
distribution channel.

In the following screenshot, all the products of sales organization "O 560061093" and distribution channel “01” would be associated with the “Online” version of
Powertools Product Catalog.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 42/54
3/5/2020

The service order replication requires the following extensions:

sapcrmserviceorderaddon (SAP Commerce)

sapserviceorderservices (SAP Commerce)

sapcrmserviceorder (Data Hub)

Viewing Service Orders in SAP Commerce Storefront


B2B and B2C customers can view the service orders in the SAP Commerce storefront in the My Account section. Only registered customers can view the service
order details.

Procedure
1. Log in to SAP Commerce.

2. Choose My Account Service Order .

The list of service orders appears.

3. Click the service order for which you want to view the details.

The following details of the service order appear:

Service order ID

Status of the service order

Date on which the order was created

Short description about the service order

Net price for the service order

Unique ID of the service request from which the order is created

Service items linked to the service order

The resource assignment (scheduling) details for each service item. (Date and Time of the visit)

The status of service order scheduling

A link to the service contract, if any, associted with the order

sapserviceorderservices Extension
The sapserviceorderservices extension contains services used for retrieving service orders from SAP Commerce database and making them available in
SAP Commerce. This extension provides two functionalities such as service order history (returns list of SearchPageData<ServiceOrderHistoryData>)

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 43/54
3/5/2020
and service orders details (returns ServiceOrderData).

Activation
To activate sapserviceorderservices extension, declare it in the localextensions.xml le. This extension also requires the commerceservices
and commercefacades extensions in the extensioninfo.xml le.

Spring De nition

The spring bean is de ned in the sapserviceorderservices-spring.xml le.

<alias name="serviceOrderFacadeImpl" alias="serviceOrderFacade" />


<bean id="serviceOrderFacadeImpl"
class="com.sap.hybris.crm.sapserviceorderservices.facade.impl.ServiceOrderFacadeImpl">
<property name="seriveOrderService" ref="seriveOrderService" />
<property name="serviceOrderHistoryConverter" ref="serviceOrderHistoryConverter" />
<property name="serviceOrderDetailsConverter" ref="serviceOrderDetailsConverter" />
<property name="sortValueProvider" ref="sortValueProvider" />

</bean>

<alias name="serviceOrderServiceImpl" alias="seriveOrderService" />


<bean id="serviceOrderServiceImpl"
class="com.sap.hybris.crm.sapserviceorderservices.services.impl.ServiceOrderServiceImpl">
<property name="serviceOrderDao" ref="serviceOrderDao" />
</bean>

<alias name="serviceOrderDaoImpl" alias="serviceOrderDao" />


<bean id="serviceOrderDaoImpl"
class="com.sap.hybris.crm.sapserviceorderservices.daos.impl.ServiceOrderDaoImpl">
<property name="pagedFlexibleSearchService" ref="pagedFlexibleSearchService" />
<property name="flexibleSearchService" ref="flexibleSearchService" />
<property name="modelService" ref="modelService" />

</bean>

The list of item types is de ned in the sapserviceorderservices-items.xml le for the service order extension.

Order History for Status


The order history function takes inputs such as Pageabledata, sort, sort order, list of lters and returns SearchPageData(ServiceOrderHistoryData)
which has paging information and sort data.

Sort

The list of sort information can be provided from the below bean de nition.

<alias name="serviceOrderSortProvider" alias="sortValueProvider" />


<bean id="serviceOrderSortProvider"
class="com.sap.hybris.crm.sapserviceorderservices.providers.ServiceOrderSortProvider">
<property name="properties">
<map>
<entry key="byDate" value="CREATIONTIME" />
<entry key="byOrderNumber" value="CODE" />
</map>
</property>
</bean>

The bean de nition maps the sort code with actual sort eld present in the service order model. This bean can be overridden with required sort value mapping.

Filter

You can pass list of lters at the time of fetching the list of orders. ServiceOrderFilterData contains lter key, value, and operator. The lter key is the
attribute quali er of service order type, and the lter value is the user input for that lter key. The order history service takes the list of
ServiceOrderFilterData to lter the order history data.

<bean class="com.sap.hybris.crm.sapserviceorderservices.data.ServiceOrderFilterData">
<property name="filterKey" type="String"/>
<property name="filterValue" type="String"/>
<property name="filterOperator" type="String"/>
</bean>

For example, if you want to lter out order history where service order type is order, you have to ll the ServiceOrderFilterData as below:

lterKey = “serviceOrderType”

lterValue= “order”

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 44/54
3/5/2020
lterOperator = “=”

Pagination

Pagination holds the information of current page, number of pages and total result count that can be shown in the SAP Commerce storefront.

Order Details
The order details function takes the input of order code and returns ServiceOrderData and it uses the serviceOrderDetailsConverter to populate
service order model data to ServiceOrderData.

To restrict the service order visibility, we have not implicitly passed the user information or unit information (B2B) to the service order services. This can be done
using search restriction on type service order as below.

 Sample Code
B2B

INSERT_UPDATE
SearchRestriction;code[unique=true];name[lang=en];query;principal(UID);restrictedType(code);active;generate
;b2bserviceorder_restriction;Restrict B2BUserGroup visibility for service orders;
({item:Unit} IN (?session.branch) OR ({item:Unit} is NULL AND {item:User}=?session.user));b2bgroup;ServiceOrder;true;true;

 Sample Code
B2C

INSERT_UPDATE
SearchRestriction;code[unique=true];name[lang=en];query;principal(UID);restrictedType(code);active;generate
;b2cserviceorder_restriction;Restrict Cutomer Group visibility for service orders;
({item:User}=?session.user);customergroup;ServiceOrder;true;true;

The above content can be imported using impex in your extension. This is not added as part of serviceorderservices extension.

sapcrmserviceorderaddon Addon
The sapcrmserviceorderaddon AddOn added the functionality of showing the list of service orders that are associated with customer (B2B and B2C) and
showing the details of each service order with scheduling information into the storefront.

AddOn De nition
A 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, contact your sales representative.

Name sapcrmserviceorderaddon

Description Introduces the functionality of showing service order history and individual service
order details

Requires addonsupport Extension

acceleratorstorefrontcommons AddOn

sapserviceorderservices Extension

Author SAP Commerce

Controllers

Controller Description

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 45/54
3/5/2020

Controller Description

ServiceOrderController Handles displaying the list of service orders on the Service Order History page. The list
is populated with SearchPageData <ServiceOrderHistoryData> objects
returned by sapserviceorderservices and handles Service Order Details page.
The service order details page populates ServiceOrderData object returned by the
sapserviceorderservices Extension.For more information, see the
sapserviceorderservices Extension document.

 Note
By default, the list of returned service orders is sorted by the code attribute. On the
storefront, you can also sort the list by the custom sort attribute which can be
con gured by bean. Pagination and ltering can be applied to the order history list.
For more information about pagination and ltering, see the
sapserviceorderservices Extension document. For order details and order history,
search restrictions can be applied to restrict the result. For more details, see the
sapserviceorderservices Extension document.

ImpEx
The service order history and details pages and all its subpages are imported into Commerce Accelerator using an ImpEx script:

 Sample Code
cms-content.impex

;;serviceorders;Service Order History Page;AccountPageTemplate;serviceorders


;;serviceorder;Service Order Details Page;AccountPageTemplate;serviceorder

To restrict the service order visibility, the user information or unit information (B2B) is not passed to the service order services. The visibility of the service orders
can be restricted using search restriction as below:

 Sample Code
B2B

INSERT_UPDATE
SearchRestriction;code[unique=true];name[lang=en];query;principal(UID);restrictedType(code);active;generate
;b2bserviceorder_restriction;Restrict B2BUserGroup visibility for service orders;
({item:Unit} IN (?session.branch) OR ({item:Unit} is NULL AND {item:User}=?session.user));b2bgroup;ServiceOrder;true;true;

 Sample Code
B2C

INSERT_UPDATE
SearchRestriction;code[unique=true];name[lang=en];query;principal(UID);restrictedType(code);active;generate
;b2cserviceorder_restriction;Restrict Cutomer Group visibility for service orders;
({item:User}=?session.user);customergroup;ServiceOrder;true;true;

This above content be imported using impex in your extension. This is added as part of this adddon extension.

Messages and Localization


In the base.properties le, you can nd a list of all the storefront messages and labels used by the components provided by this AddOn, which includes a list
of all statuses and their localizations.

CMS Components
This AddOn changes/adds the following CMS components:

Service Order History Page for listing service orders.

Service Order Details Page for details of individual service order

ServiceOrderLink for navigating to the Service Order listing pages from My Account Page

ServiceOrderDetailsHeadlineComponent,ServiceOrderDetailsInfoComponent,ServiceOrderDetailShippingInfoComponent
and ServiceOrderDetailItemsComponent for resolving the actual JSPs to render the service order details

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 46/54
3/5/2020
AccountServiceOrderHistoryComponent for resolving the actual JSPs to render the service order history

Installing the sapcrmserviceorderaddon AddOn


The sapcrmserviceorderaddon AddOn added the functionality of showing the list of service orders that are associated with customer (B2B and B2C) and
showing the details of each service order with scheduling information into the storefront.

1. Add the sapcrmserviceorderaddon AddOn to your localextensions.xml le, ensuring the following extensions are also included:

acceleratorstorefrontcommons

addonsupport

sapserviceorderservices

2. Before installation, modify the sapcrmserviceorderaddon.content.import.applicationtype property to install the AddOn in B2B or B2C
scenario or in both. Currently, this property is set as sapcrmserviceorderaddon.content.import.applicationtype=b2c,b2b to install this
AddOn in B2B or B2C storefront.

 Note
The serviceOrderInitialDataSystemSetup le is added to import B2B or B2C speci c content. This le can be overridden based on custom
storefront.

3. Open a command prompt and navigate to the hybris/bin/platform directory.

4. Do the following:

On Microsoft Windows systems, execute setantenv.bat. Do not close the command window.

On Unix-related systems (such as Linux or Mac OS), execute setantenv.sh. Do not close the command window.

5. Install the sapcrmserviceorderaddon AddOn to your storefront extensions based on the yacceleratorstorefront template with the following
ant command:

ant addoninstall -Daddonnames=" sapcrmserviceorderaddon " -DaddonStorefront.yacceleratorstorefront="<mystorefrontextension

When the installation is successful, the BUILD SUCCESSFUL noti cation is displayed in the command prompt.

Product Registration
Customers can register the products of their interest or the products that they have purchased, on the B2C storefront.

The product need not be purchased on the storefront to register it. Registering a product provides you access to product related information and updates, special
offers, promotions or other e-mail marketing communications, product support resources as well as warranty details.

 Note
To register a product, the B2C customer must be registered on SAP CRM as well as SAP Commerce systems. The product to be registered must also be
replicated from SAP CRM to SAP Commerce.

Making Settings in the Backoffice for Product


Registration
Con gure the required settings in the Backoffice to register a product from the SAP storefront. These settings are for B2C online stores, con gured for registered
customers.

Procedure
1. In Backoffice Administration Cockpit, navigate to SAP Integration RFC Destination , and create an RFC Destination for the SAP CRM back-end system.

2. On the SAP Base Store Con guration Product Con guration tab, specify the RFC destination for product registration.

If not speci ed, the RFC destination de ned on the Core Data tab will be used.

3. On the SAP Global Con guration Product Replication tab, add the sales area data for the B2C storefront.

Registering Products on the B2C Storefront


Register a product on the B2C storefront, to get access to product related information and updates.

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 47/54
3/5/2020
Procedure
1. On the B2C storefront navigate to My Account Product Registration .

Product Registration page lists the products that have already been registered for the customer.

2. Click Register Product.

3. In the Product Details eld, enter product ID, product name or any other details relevant for the product.

4. Click Submit.

The product gets registered and it shows up in the list of registered products. An error message appears if the product is not available on the SAP CRM
system.

During product registration an RFC call is made to the back-end system, and the details of the registered product along with the sales area details of the
registered customer are recorded.

 Note
Product Registration page is a template, and can be extended to add more elds, restrictions or validations as required.

Viewing the Details of the Registered Products


View the product and the warranty details of your registered products on the B2C storefront.

Procedure
1. On the B2C storefront navigate to My Account Product Registration .

The products that have already been registered are displayed.

2. Click a row in the list to view the details of the registered product.

Product Registration Details page shows the following information:

Product Details – details of the registered product like the product name and product code

General Details – details of the registration like the registration number, date of registration, and validity

Warranty Details – warranty information is displayed only if the sales area data is maintained

Extensions and AddOns for Product Registration


To enable the registration of products on the SAP CRM back end, activate the required extensions and AddOns.

To activate the extensions, declare them in the localextensions.xml le. The extensions and AddOns for product registration are as follows:

productregistrationaddon AddOn

productregistrationservices Extension

productregistrationfacades Extension

sapcrmproductregistrationbol Extension

productregistrationaddon AddOn
The productregistrationaddon extension introduces to the storefront the functionality of registering new products, listing the registered products, and
viewing the details of existing product registrations.

AddOn De nition

Name productregistrationaddon

Description Introduces to the storefront the functionality of registering new products, listing the
registered products, and viewing the details of existing product registrations

Requires
addonsupport Extension

acceleratorcms Extension

acceleratorstorefrontcommons Extension

productregistrationfacades Extension

sapcorejco

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 48/54
3/5/2020

Author SAP Commerce

Supported Markets and Channels


The productregistrationaddon AddOn is designed for B2C markets.

Controllers

Controller Description

ProductRegistrationPageController Handles displaying the list of product registrations on the Product Registrations page.
The list is populated with ProductRegistrationData objects returned by
ProductRegistrationFacade. For more information, see the
productregistrationfacades Extension document.

ImpEx
The Product Registration page and all its subpages are imported into the Commerce Accelerator using an ImpEx script.

 Sample Code
cms-content.impex

#cms-content.impex
INSERT_UPDATE

ContentPage;$contentCV[unique=true];uid[unique=true];name;masterTemplate(uid,$contentCV);label;defaultPage[default='true'];ap

;;registered-products;Register Products Listing Page;AccountPageTemplate;registered-products

;;add-registered-products;Add Register Products Page;AccountPageTemplate;add-registered-products

;;register-product-details;Update Register Products Page;AccountPageTemplate;register-product-details

Product Registration Form


On the B2C storefront, when you click the Register Product button, a product registration form with an editable input eld is displayed. The logic behind this
functionality is introduced in the com.sap.hybris.productregistrationaddon.forms.RegisterProductForm class. Product registration page has
only one editable input eld:

Name Type Description

productID String The product details. It may be the product Id or any


other text relevant to the product, such as the product
name or description.

Messages and Localization


In the base_en.properties le, you can nd the list of all the storefront messages and labels used by the components provided by this AddOn, which includes
a list of all statuses and their localizations.

CMS Components
This AddOn adds or changes the following CMS components:

Product Registration page for listing registered products

Add Product Registration Page for creating Product Registrations

CreateProductRegistrationComponent for rendering the button for registering the product

AccountRegisterProductsHistoryComponent for navigating to the Product Registration listing page from My Account page

AccountRegisterProductsDetailsComponent and AccountAddRegisterProductsComponent for resolving the actual JSPs to render the results

System Setup Hook

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 49/54
3/5/2020
System setup class ProductRegistrationAddonSystemSetup is used in order to import the ImpEx les during the system update.

How to Install
1. Add the productregistrationaddon AddOn to your localextensions.xml le, ensuring that the listed required extensions are also included.

If you have renamed your storefront extension, you need to include the following web spring con guration to your local.properties le:

 Sample Code
local.properties

<mystorefrontextensionname>.additionalWebSpringConfigs.myaddon=classpath:/myaddon/web/spring/myaddon-web-spring.xml

2. Open the command prompt and navigate to the hybris/bin/platform directory

a. On Microsoft Windows systems, open the setantenv.bat le. Do not close the command window.

b. On Unix-based systems (such as Linux or Mac OS), run setantenv.sh by entering . ./setantenv.sh. Do not close the command window.

3. Run the following command:

ant addoninstall -Daddonnames="productregistrationaddon" -DaddonStorefront.yacceleratorstorefront="yacceleratorstorefront"

When the installation is successful, the BUILD SUCCESSFUL noti cation is displayed in the command prompt.

4. Initialize or update the server. If performing an update, make sure the following options are selected:

Update running system

Create essential data

Localize types

productregistrationservices Extension
The productregistrationservices extension organizes functionality from one or more SAP Commerce platform services. It provides a generic Registration
API for creating a new product registration, getting the list of registered products, and fetching the details of registered products based on registration GUID.

Overview of Services
The following sections are a guide to all the services and service enhancements provided with the productregistrationservices extension. Dependencies
on extensions outside of the core platform are highlighted for your reference.

ProductRegistrationService
The following sections describe the catalog services of the commerceservices extension.

The ProductRegistrationService is responsible for creating, vieweing and listing the product registrations from the back-end system. It makes a call to the Business
Object Layer that in turn makes a call to the SAP CRM back-end system via JCO calls. The products that have been registered are not stored on the SAP Commerce
side. They are synchronously sent to SAP CRM. However this behavior can be customized by having a custom implementation for ProductRegistrationService.

 Note
The default implementation adds a dependency to the sapcore and sapcorejco extensions.

Method Signature Function

getRegisteredProducts( nal String userID) Gets the list of already registered products

createProductRegistration( nal String productGuid, nal String customerID) Creates a product registration

getRegisteredProductByGuid( nal String registrationNumber, nal String Returns a registered product as a ProductRegistrationData object
customerID)

getBackendType() Determines the back-end type

Product Registration BO Factory


This class is responsible for determining the back-end Business Object. It fetches the bean of the back-end class from the GenericFactory.

 Sample Code

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 50/54
3/5/2020

@Override
public ProductRegistrationBO getProductRegistrationBO() {
return (ProductRegistrationBO) genericFactory
.getBean(ProductregistrationservicesConstants.SAP_PRDUCT_REGISTRATION_BO);

Data Access Objects


ProductRegistratinDao allows making calls to the database. It provides two methods useful in product registration.

Method Signature Function

getProductByGuid( nal String GUID) Gets the productModel by its GUID

getProductMappingByCatalogVersion( nal CatalogVersionModel catalogVersion) Determines the SAP Product sales area to catalog mapping

 Note
The sales area data is required while registering a new product. This is to associate warranty with the product registration. The warranty attached to the
products in the back-end system is speci c to the sales area data.

Spring Con guration


There are several Spring beans introduced in the productregistrationservices extension. In order to introduce custom behavior, inject your custom
classes instead of the default ones:

 Sample Code
<alias alias="productRegistrationService" name="defaultProductRegistrationService"/>
<bean id="defaultProductRegistrationService" class="com.sap.hybris.productregistrationservices.service.impl.DefaultPro
<property name="productRegistrationDao" ref="productRegistrationDao"/>
<property name="sapCoreConfigurationService" ref="sapCoreConfigurationService"/>
<property name="productRegistrationBOFactory" ref="productRegistrationBOFactory"/>
<property name="productConverter" ref="productConverter"/>
<property name="baseStoreService" ref="baseStoreService"/>
</bean>

<alias alias="productRegistrationDao" name="defaultProductRegistrationDao"/>


<bean id="defaultProductRegistrationDao" class="com.sap.hybris.productregistrationservices.dao.impl.DefaultProductRegi
parent="abstractItemDao">
</bean>

<alias name="defaultProductRegistrationBOFactory" alias="productRegistrationBOFactory" />


<bean id="defaultProductRegistrationBOFactory" class="com.sap.hybris.productregistrationservices.service.impl.DefaultP
<property name="genericFactory" ref="sapCoreGenericFactory" />
</bean>

<bean id="productRegistrationConfigurationAccess" parent="sapCoreModuleConfigurationAccess">


<property name="moduleId" value="productregistrationservices" />
</bean>

<bean id="sapcrmservprodregistraddonSampleDataEventListener" parent="abstractGenericAddOnSampleDataEventListener" >


<property name="extensionName" value="productregistrationaddon" />
</bean>

productregistrationfacades Extension
The productregistrationfacades extension provides a generic Registration API for creating a new product registration, getting the list of registered
products, and fetching the details of registered products based on registration GUID.

Facades
The Product Registration API is designed to be as generic as possible in order to allow easy customization. You can connect to any third party ticketing system by
simply creating your custom implementation of the ProductRegistrationFacade interface.

The ProductRegistrationFacade interface provides generic methods used for various operations on customer product registrations:

Method Signature Function

getRegisteredProducts (PageableData pageableData) Gets the list of already registered products

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 51/54
3/5/2020

Method Signature Function

createProductRegistration(ProductRegistrationData Creates a product registration


populateProductRegistrationData)

getRegisteredProductByGuid(String encodeHTML) Returns a product registration as a ProductRegistrationData object.

Services
The productregistrationfacades extension uses the default implementation of the ProductRegistrationService interface, the
DefaultProductRegistrationService class.

ProductRegistrationData
On the SAP Commerce side, the ProductRegistrationData object is de ned as a Spring bean in the
/productregistrationfacade/resources/productregistrationfacade-beans.xml le.

 Sample Code
productregistrationfacade-beans.xml

<bean class="de.hybris.platform.productregistrationfacades.data.ProductRegistrationData">
<property name="registrationNumber" type="String"/>
<property name="product" type=" de.hybris.platform.commercefacades.product.data.ProductData"/>
<property name="validTo" type="java.util.Date"/>
<property name="validFrom" type="java.util.Date"/>
<property name="productCode" type="String"/>
<property name="registrationGuid" type="String"/>
<property name="user" type="de.hybris.platform.core.model.user.CustomerModel"/>
<property name="warrantyDescription" type="String"/>
<property name="warrantyStart" type="java.util.Date"/>
<property name="warrantyEnd" type="java.util.Date"/>
<property name="warrantyBasis" type="String"/>
</bean>

Spring Con guration


There are several Spring beans introduced in the productregistrationfacades extension. In order to introduce custom behavior, inject your custom classes
instead of the default ones.

 Sample Code
productregistrationfacades -spring.xml

<alias name="defaultProductRegistrationFacade" alias="productRegistrationFacade"/>


<bean id = "defaultProductRegistrationFacade" class="com.sap.hybris.productregistrationfacades.registration.impl.DefaultProduc
<property name="userService" ref="userService"/>
<property name="productRegistrationService" ref="productRegistrationService"/>
<property name="productService" ref="productService"/>
</bean>

sapcrmproductregistrationbol Extension
The sapcrmproductregistrationbol extension contains the BOL and back-end integration objects needed to work synchronously with product
registrations in the SAP CRM back end system.

Overview
This extension consists of entities representing the new registration, or the registration list search result in a user session. These objects are called BOL objects.
Their scope is limited to the user session.

In addition, there are back-end objects that establish the connection to the SAP CRM back end (see sapcrmproductregistrationbol-spring.xml).
These back-end objects have session scope as well.

All of these objects can be extended using standard spring techniques: Create a custom extension and create custom beans, most likely via subclassing the
standard implementations. Register the custom bean in a spring.xml le, and assign your custom bean to the alias registered for the standard implementation.

 Sample Code

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 52/54
3/5/2020

<alias alias="productRegistrationBO" name="defaultProductRegistrationBO" />


<bean id="defaultProductRegistrationBO" parent="sapCoreBusinessObject"
class="com.sap.hybris.crm.sapcrmproductregistrationbol.businessobject.impl.DefaultProductRegistrationBO">
<property name="moduleConfigurationAccess" ref="sapCommonConfigurationAccess"/>
<property name="baseStoreService" ref="baseStoreService"/>
</bean>

The default implementation of ProductRegistrationBO invokes the back-end class that makes jco connection to the back end. The back-end class is determined by
generic factory wherein the back-end type is passed in resolution of the back-end class.

 Sample Code
final ProductRegistrationBackend sapProductRegistrationBackend = (ProductRegistrationBackend) genericFactory
.getBean(PREFIX.concat(backendType));

Integrating with SAP CRM


We integrate with SAP CRM using the RFC destination of SapCore. In addition to the RFC Destination in common settings of SAPCoreCon guration, a new RFC
destination is de ned for Product Registration. While connecting to the back-end system, the connection is made by the RFC destination speci c to product
registration: productRegistrationRfcDestination. If there is no such RFC destination de ned, then the one from common settings is used. This logic is written in
ProductRegistrationService while fetching backendType.

 Sample Code
private String getBackendType() {
String backendType;
final SAPRFCDestinationModel defaultDestination = this.baseStoreService.getCurrentBaseStore()
.getSAPConfiguration().getRegistrationRfcDestination();
if (null != defaultDestination) {
backendType = defaultDestination.getBackendType().getCode();
} else {
backendType = this.sapCoreConfigurationService.getBackendType();
}

return backendType;
}

The following table provides a description of the function modules, including their relevance for extensions.

RFC function module Description

CRM_HYBRIS_CREATE_IOBJECT Creates a product registration in SAP CRM system corresponding to the user. The
product GUID is passed as input parameter in addition to the sales area data and
division.The sales area data is fetched from the productToCatalogMapping de ned in
Global Con guration.

CRM_HYBRIS_GET_IOBJECT_LIST This RFC module is responsible for fetching the list of product registrations
corresponding to the user. The customer ID is passed as a parameter.

CRM_HYBRIS_GET_IOBJECT_DETAIL This RFC module gets the details of product registrations by GUID. It also fetches the
warranty details. However the warranty details will be fetched only if sales area data is
passed as a parameter whlle creating a new product registration.

 Sample Code
Spring Con guration (sapcrmproductregistrationbol-spring.xml)

<alias alias="productRegistrationBackend" name="defaultProductRegistrationBackend" />


<bean id="productRegistrationBackendTypeCRM" class="com.sap.hybris.crm.sapcrmproductregistrationbol.backend.impl.Defaul
<property name="jcoFunctionCreate" value="CRM_HYBRIS_CREATE_IOBJECT"/>
<property name="jcoFunctionFetch" value="CRM_HYBRIS_GET_IOBJECT_LIST"/>
<property name="jcoFunctionDetails" value="CRM_HYBRIS_GET_IOBJECT_DETAIL"/>
<property name="defaultDestinationName" value="#{baseStoreService.getCurrentBaseStore().getSAPConfiguration().ge
</bean>

Speci c Extension Tasks


For certain tasks, we recommend the following approaches, to keep the custom code minimal and clearly separated from the standard code.

Backoffice Con guration Settings

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 53/54
3/5/2020
The sapcrmproductregistrationbolextension controls the display of con guration settings for product registration in the Backoffice. The settings are part
of the SAP Base Store Con guration and are displayed on a dedicated tab. This tab contains the RFC destination for product registration to make call to the back-
end system.

Related Information
Making Settings in the Backoffice for Product Registration

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=7a7ae881235a4884b2dc547c41… 54/54

Вам также может понравиться