Billing Integration
Billing Integration
PUBLIC
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.
SAP Commerce Billing provides consistent and contextual engagement with customers across every touch-point and channel. It fully integrates in the SAP Commerce Billing solution,
allowing you to make your subscriptions, offers, and pricing available to your customers for ordering across all channels and monetizing through SAP Commerce Billing. It offers your
customers self-services, such as control over their orders and contracts, or the ability to trigger contract change processes that are completely integrated into SAP Commerce Billing.
Scenarios
SAP Commerce Billing Integration supports the following scenarios:
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e6… 1/74
3/5/2020
The following is an overview of the B2B scenarios covered by SAP Commerce Billing Integration:
The following is an overview of the B2C integration scenarios covered by SAP Commerce Billing integration:
Prerequisites
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e6… 2/74
3/5/2020
SAP Commerce integration with SAP Commerce Billing is available as an additional package on SAP Commerce. It is based on a SAP CRM 7.0 EhP4 SP05 or higher, and SAP Commerce
CRM Integration 2.5. Before you install the package, carry out the following checks:
Procedure
1. Check the system requirements for your scenario to ensure that your installation and any added functionality meet the requirements.
2. Check that your SAP CRM System has all the RFC modules and business functions needed to integrate SAP Commerce with SAP Commerce Billing.
Recommendation
SAP recommends that you install or upgrade to SAP CRM 7.0 EhP4 SP05, or higher. It has all the remote function calls and business functions you need for the integration.
3. Check that the following business functions are activated. If they are not, go to transaction SFW5 and activate them in this sequence:
Procedure
1. Perform steps described in the SAP CRM: Installing the Integration Package;
2. Go to SAP Service Marketplace . Search for SAP HYBRIS BILLING COMMERCE INTEGRATION, then choose SAP HYBRIS BILLING COMMERCE INTEGRATION
2.10 Comprised Software Component Versions SAP HYBRIS COMMERCE INTEG 2.10 ). Unzip the les, then copy the content as follows:
How you proceed from here depends on which version you are working with, and what you want to do. The options are as follows:
Non-Production Purposes to: If installing for non-production purposes (for example, for testing or demonstrations) you can use the installer recipe.
Production Purposes: If installing for production purposes, install only the extensions and AddOns that you need for your scenario; perform steps 1 - 3 as described in the
SAP Commerce topic on 'Installing the Integration Package' (see related links);
3. To set up and initialize, execute recipe sap_hbci_b2b_b2c by executing the following commands in the installer directory:
On Linux:
On Windows:
4. Download the Datahub extensions from SAP Service Marketplace . Search for SAP HYBRIS BILLING COMMERCE INTEGRATION, then choose SAP HYBRIS BILLING
COMMERCE INTEGRATION 2.10 Comprised Software Component Versions HYBRIS BILL INTEG DH 2100 . Save the zip le to a directory of your choice. Extract the zip le.
If you use the embedded Data Hub server, copy the extracted .jar les to this directory:
installer/work/datahub-tomcat/webapps/datahub-webapp/WEB-INF/lib
For standalone Data Hub installation only, copy the extracted .jar les to this directory:
${TOMCAT_HOME}/webapps/datahub-webapp/WEB-INF/lib
5. Set up the system connections you need for your system landscape and scenario as described in SAP CRM: Setting up System connections.
6. Con gure your master data replication as described in SAP CRM: Con guring Master Data Replication.
For B2B, you need to set up data replication for the following objects:
CRM customers
Contact persons
Products
Catalog Prices
For B2C, you need to set up data replication for the following objects:
Products
Bundles
Replication of bundle structures (material & service products, incl. sales and dependent components);
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e6… 3/74
3/5/2020
Catalog prices
B2C customers
Consumers are replicated to SAP CRM as B2C customers (business partner with consumer role);
Business agreements
Next Steps
CRM price master data replication is not part of the SAP CRM Integration or the SAP Commerce Billing Integration. In order the use the SAP Commerce Billing Integration speci c price
features in bundle personalization and during checkout, the SAP Commerce Price Master Data (price rows) must contain the SAP Commerce Billing Integration speci c attributes.
hybris/bin/ext-integration/hbci/saphbciordermgmtservices/resources/saphbciordermgmtservices-items.xml
recurringPriceDuration and recurringPriceDurationUnit are mandatory for recurring items, for handling different price dimensions (items with different duration units)
in SAP Commerce, and for replicating the prices to CRM (see also "Con guring Asynchronous Provider Order Management”). The bundleID is used to de ne a speci c price for a
bundle.
de ned in Backoffice;
The following is an example of an ImpEx le used to import pricing data from CRM into SAP Commerce:
Sample Code
INSERT_UPDATE
PriceRow;$catalogVersion;product(code,$catalogVersion)
[unique=true];unit(code[unique=true,default=pieces]);currency(isocode)
[unique=true];price;minqtd;unitFactor;net;recurringPriceDuration;recurringPriceDur
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e6… 4/74
3/5/2020
ationUnit(code);bundleId[unique=true];
;;<Product Identifier>;PCE;USD;94.00;1;1;1;1;MON;;
;;<Product Identifier>;PCE;USD;940.00;1;1;1;1;MON;<Bundle Identifier 1>; # If
there is a specific price for the product if sold as part of Bundle 1
;;<Product Identifier>;;PCE;USD;470.00;1;1;1;1;MON;<Bundle Identifier 2>; # If there is a specific price for the product if sold as part of Bun
So, an ImpEx le for a Product HY_CH_HD which has different prices, depending on what bundle it is sold in (Bundle YHY_TV_BUNDLE_XL, or Bundle HY_TV_BUNDLE_SP) could look
like this:
Sample Code
INSERT_UPDATE
PriceRow;$catalogVersion;product(code,$catalogVersion)
[unique=true];unit(code[unique=true,default=pieces]);currency(isocode)
[unique=true];price;minqtd;unitFactor;net;recurringPriceDuration;recurringPriceDur
ationUnit(code);bundleId[unique=true]; ;;HY_CH_HD;PCE;USD;94.00;1;1;1;1;MON;;
;;HY_CH_HD;PCE;USD;940.00;1;1;1;1;MON;HY_TV_BUNDLE_XL;
;;HY_CH_HD;PCE;USD;470.00;1;1;1;1;MON;HY_TV_BUNDLE_SP;
Related Information
SAP CRM: Installing the Integration Package
SAP CRM: Setting Up System Connections
SAP CRM: Con guring Master Data Replication
Installing SAP Commerce Manually
Con guring Asynchronous Provider Order Management
recurringNetValue
recurringTaxValue
recurringGrossValue
recurringPriceDuration
recurringPriceDurationCode
recurringPriceDurationUnit
nonRecurringNetValue
nonRecurringTaxValue
nonRecurringGrossValue
Builds on (or extends) the functionality provided by sapcrmorder Data Hub extension of the standard SAP Commerce CRM integration (see "sapcrmorder Data Hub Extension"
for details)
Creates IDocs of type to capture Provider Order relevant data and sends them to SAP CRM asynchronously, to replicate SAP Commerce Billing B2C orders to SAP CRM as
provider orders.
Note
If you want to use asynchronous order management for SAP Commerce Billing Commerce Integration 2.5, this is a mandatory component.
The saphbcicrmorder Data Hub extension acts as a parent extension for the following extensions:
saphbcicrmorder-raw
saphbcicrmorder-canonical
saphbcicrmorder-target
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e6… 5/74
3/5/2020
This split follows the Data Hub archetype structure. The saphbcicrmorder Data Hub extension was split into separate extensions to allow for greater exibility and modularity.
Dependencies
The saphbcicrmorder Data Hub extension depends on the following Data Hub extensions:
sapidocintegration
sapidocoutboundadapter
sapcrmorder
Overview
The following graphic gives an overview of the order-related integration between SAP Commerce and an SAP CRM system via Data Hub.
The orders created in SAP Commerce are sent as CSV les to Data Hub, which stores them as raw items. During composition, the raw items are converted into canonical orders and
subordinate items. During publication, the canonical orders are converted into target items that correspond to IDoc segments. Using the IDoc outbound adapter, the corresponding
target items are assembled in IDocs that are sent as XML over HTTP(S) to the SAP CRM system, which starts order ful llment.
When the system replicates sales orders from SAP Commerce to SAP CRM, SAP CRM provisional orders are created automatically. Once a provider order is submitted a corresponding
provider contract is created and the SAP CRM system sends corresponding con rmations back as IDoc XML documents to Data Hub. Using the IDoc inbound adapter built into the
sapidocintegration extension, the raw items for these noti cations are extracted from the received XML documents. Again, they are converted to canonical noti cation items. The
publication of these items to SAP Commerce creates ImpEx les, imported via standard core functionality (handled by the standard Data Hub extension sapcrmorder).
The saphbcicrmorder Data Hub extension contains the raw, canonical, and target item de nitions, the mapping and custom composition and publication handlers.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e6… 6/74
3/5/2020
The following graphic shows the items related to order inbound processing (reused from sapcrmorder Data Hub extension), and how they correspond to each other.
The mapping xmls de ne the dependencies to the respective sapcrmorder child extensions.
Sample Code
<dependencies>
<dependency>
<extension>sapcrmorder-canonical</extension>
</dependency>
</dependencies>
Additions/Enhancements in saphbcicrmorder
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e6… 7/74
3/5/2020
The following is a list of data type additions and enhancements.
Raw Items
RawCrmHybrisOrder
This represents an order coming from the SAP Commerce core system. It contains all subordinate information (order entries, payment, addresses, and so on) as well.
saphbcicrmorder extends the existing raw item type from sapcrmorder by adding the following new attributes:
Name Description
parentEntryNumber Item number for the parent bundle item the item belongs to
selType Selection Type value to be used while creating the provider order item
Canonical Items
The canonical items in this context are designed to facilitate the mapping between the SAP Commerce domain model and the SAP CRM domain model. The structure of the canonical
items has elements of both models: the overall item structure is close to the SAP Commerce domain model, but the structure of the price information & contract data is optimized for the
SAP CRM conditions.
CanonicalCrmOrder
This represents an order header. In addition to the expected attributes (order ID, currency, and so on) the store name and the channel (B2B or B2C) are also stored. The store name is
used during publication, to infer store speci c con guration properties (transaction type, sales area).
Note
No changes in this type; The existing implementation from sapcrmorder is reused.
CanonicalCrmOrderItem
This represents one item or entry of an order. Like all subordinate objects of an order, the order ID is part of the (compound) key. The entry number is the same as in SAP Commerce. The
existing type from sapcrmorder has been extended in saphbcicrmorder by adding the following new attributes:
CanonicalCrmOrderCreationNoti cation
This represents a noti cation saying that the order has been created successfully in the ful llment system. No further details are provided at header level.
Note
No changes in this type; The existing implementation from sapcrmorder is reused.
saphbcicrmorder uses the existing sapcrmorder extension for handling all the inbound process ows without any additions or modi cations.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e6… 8/74
3/5/2020
CRMXIF_ORDER_SAVE_U07$...
All target items starting with the pre x CRMXIF_ORDER_SAVE_U07$ belong to the same IDoc type CRMXIF_ORDER_SAVE_U07. This IDoc is used to create a provider order on the
SAP CRM side. In the following text, this pre x will be omitted in the section headings. All currency and unit codes are expected to be ISO codes. In addition to the default mapping
provided by the IDoc outbound adapter, only the message type is lled. Message type is expected in Java property.
All target items sharing this pre x have the eld OBJECT_ID in common, which is used to determine the correct IDoc instance for a given target item instance. See exportCode
element:
<exportCode>idockeyfield=OBJECT_ID</exportCode>
EDI_DC40
sapcrmorder.ordermessagetype.
E101CRMXIF_BUSTRANS
This is the IDoc control header. In addition to the default mapping provided by the IDoc. The full name is CRMXIF_ORDER_SAVE_U07$E101CRMXIF_BUSTRANS (root segment for the
provider order). It contains the order ID, object task, process type and object type. All following segments are child segments of this. The pre x (CRMXIF_ORDER_SAVE_U07$)
E101CRMXIF_BUSTRANS) are omitted in the section headings of the child segments.
...$E101CRMXIF_PARTNER_XT
The full name is CRMXIF_ORDER_SAVE_U07$ E101CRMXIF_BUSTRANS$E101CRMXIF_PARTNER_XT. It represents the partner header. Since it is a header whose child segment
contains the information regarding different partner roles, it contains only the order Id and the DATAX (whose value is X). Only those segments are taken into account for the inbound
processing for which the DATAX ag is set (for example, E101CRMXIF_SALES_X-DATAX = 'X').
...$E101CRMXIF_PARTNER
The full name is CRMXIF_ORDER_SAVE_U07$ E101CRMXIF_BUSTRANS $E101CRMXIF_PARTNER_XT$ E101CRMXIF_PARTNER. Contains all the information for different
partners, that is, the partner functions, partner role codes (sold to party, ship to party, bill to party) etc. It represents the partner de nition for a sales order. Since an order has several
partners with different roles, the partner role ( eld PARTNER_FCT) is de ned as a segment key.
…$E101CRMXIF_PARTNER_F
...$E102CRMXIF_ADDRESS
...$E104CRMXIF_ADDRESS
...$E102CRMXIF_ADDRESS_F
In this address replication, we do not replicate the sold to party address, and a check is done to verify that sold to party address elds are not replicated. SAP CRM picks and shows the
address from the master data for sold to party.
...$E101CRMXIF_ORGMAN_X
The full name is CRMXIF_ORDER_SAVE_U07$ E101CRMXIF_BUSTRANS $ E101CRMXIF_ORGMAN_X. It represents the segment for sales organization related information. It is
the Header segment for sales organization related information, contains the order ID.
...$E101CRMXIF_ORGMAN
The full name is CRMXIF_ORDER_SAVE_U07$ E101CRMXIF_BUSTRANS $ E101CRMXIF_ORGMAN_X$E101CRMXIF_ORGMAN. This segment contains all the information related
to the sales area such as sales organization, distribution channel, division and sales organization responsible, and so on.
....$E101CRMXIF_PRICING_X
The full name is CRMXIF_ORDER_SAVE_U07$ E101CRMXIF_BUSTRANS$ E101CRMXIF_PRICING_X. It represents the segment for pricing related information (currency only). It
is the header segment for pricing related information and contains the order ID.
....$E101CRMXIF_PRICING
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e6… 9/74
3/5/2020
The full name is CRMXIF_ORDER_SAVE_U07$ E101CRMXIF_BUSTRANS$ E101CRMXIF_PRICING_X$ E101CRMXIF_PRICING. This segment is used for passing the currency
information. It contains only one eld in addition to the order ID, that is, CURRENCY.
...$E101CRMXIF_PRICING_F
The full name is CRMXIF_ORDER_SAVE_U07$ E101CRMXIF_BUSTRANS$ E101CRMXIF_PRICING_X$ E101CRMXIF_PRICING$ E101CRMXIF_PRICING_F. It is the child
segment of E101CRMXIF_PRICING. This segment contains elds with ag values. All the elds which are present in its parent segment should be marked with the ag value ʻX’,
otherwise their values will not be accepted in SAP CRM.
...$E101CRMXIF_SHIPPING_X
The full name is CRMXIF_ORDER_SAVE_U07$ E101CRMXIF_BUSTRANS$ E101CRMXIF_SHIPPING_ X. It represents the segment for shipping information. It is the Header
segment for shipping related information, contains the order ID.
...$E101CRMXIF_SHIPPING
The full name is CRMXIF_ORDER_SAVE_U07$ E101CRMXIF_BUSTRANS$ E101CRMXIF_SHIPPING_ X$ E101CRMXIF_SHIPPING. By shipping condition, here we mean the
delivery mode. This segment is used for passing on delivery mode information.
...$E101CRMXIF_SHIPPING_F
The full name is CRMXIF_ORDER_SAVE_U07$ E101CRMXIF_BUSTRANS$ E101CRMXIF_SHIPPING_ X$ E101CRMXIF_SHIPPING$ E101CRMXIF_ SHIPPING_F. This
segment contains elds with ag values. All the elds which are present in its parent segment should be marked with the ag value ʻX’, otherwise their values will not be accepted in SAP
CRM.
...$E101CRMXIF_SALES_X
The full name is CRMXIF_ORDER_SAVE_U07$ E101CRMXIF_BUSTRANS$E101CRMXIF_SALES_X. It represents the segment for sales information at header level and it contains
the order ID.
...$E101CRMXIF_SALES
The full name is CRMXIF_ORDER_SAVE_U07$ E101CRMXIF_BUSTRANS$E101CRMXIF_SALES_X$E101CRMXIF_SALES. This segment is used for passing requested delivery
date for the order.
...$E101CRMXIF_SALES_F
...$E101CRMXIF_BILLING_X
The full name is CRMXIF_ORDER_SAVE_U07$ E101CRMXIF_BUSTRANS$E101CRMXIF_BILLING_X. Represents the segment for business agreement related information at
header level and it contains the order ID.
...$E101CRMXIF_BILLING
The full name is CRMXIF_ORDER_SAVE_U07$ E101CRMXIF_BUSTRANS$E101CRMXIF_BILLING_X$E101CRMXIF_BILLING. This segment is used for passing the business
agreement ID (if any ID is sent from SAP Commerce, otherwise it is left blank) for the order.
...$ E101CRMXIF_BILLING _F
..$E101CRMXIF_BUSTRANS_ITEM
The full name is CRMXIF_ORDER_SAVE_U07$ E101CRMXIF_BUSTRANS $E101CRMXIF_BUSTRANS_ITEM. It represents a provider order item. Note that both the internal and
external item numbers are set: Both item numbers are set to the SAP Commerce order entry number which starts from 1 (as the SAP CRM order does not support item numbers starting
with 0). Note that since there is a to-n cardinality from the provider order root segment to the provider order item segment, the item number ( eld ITM_NUMBER) is de ned as the
segment key.
Source Code
<attribute>
<name>ITEM_NUMBER</name>
<localizable>false</localizable>
<collection>false</collection>
<transformationExpression>entryNumber</transformationExpression>
<exportCode>keyfield=true</exportCode> <!-- Key -->
<mandatoryInHeader>true</mandatoryInHeader>
</attribute>
It represents the schedule line for a provider order item. The quantities are set on schedule line level. The same mapping of the order item number is carried out as for the order item.
Only one schedule line is created per provider order item. For the provider order item, the eld ITEM_NUMBER is de ned as a segment key. This needs to be adjusted if several schedule
lines are created per item.
...$E101CRMXIF_PRCD_COND_XT
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 10/74
3/5/2020
The full name is CRMXIF_ORDER_SAVE_U07$ E101CRMXIF_BUSTRANS $E101CRMXIF_BUSTRANS_ITEM$E101CRMXIF_PRCD_COND_XT. It represents the pricing condition
segment. It is the header segment for pricing conditions. It contains the order ID and item number.
...$E101CRMXIF_PRCD_COND
...$E101CRMXIF_BT_PRCD_COND_F
...$E101CRMXIF_PRODUCT_I_X
The full name is CRMXIF_ORDER_SAVE_U07$ E101CRMXIF_BUSTRANS $ E101CRMXIF_BUSTRANS_ITEM$E101CRMXIF_PRODUCT_I_X. It represents the segment for
product related information. It is the header segment for product related information. It contains the order ID and item number.
...$E101CRMXIF_PRODUCT_I
...$E101CRMXIF_SCHEDLIN_I_X
...$E101CRMXIF_SCHEDLIN_I
...$E101CRMXIF_SCHEDLIN_I_F
...$E101CRMXIF_SCHEDLIN_ XT
...$E101CRMXIF_SCHEDLIN
...$E101CRMXIF_SCHEDLIN_F
....$E102CRMXIF_SALES_X
The full name is CRMXIF_ORDER_SAVE_U07$ E101CRMXIF_BUSTRANS $ E101CRMXIF_BUSTRANS_ITEM$E102CRMXIF_SALES_X. It corresponds to the header segment
for sales related information at item level. It contains the order ID and item number.
...$E102CRMXIF_SALES
...$E102CRMXIF_ SALES _F
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 11/74
3/5/2020
…$E101CRMXIF_IST_ITA3_X
The full name is CRMXIF_ORDER_SAVE_U07$ E101CRMXIF_BUSTRANS$ E101CRMXIF_BUSTRANS_ITEM$ E101CRMXIF_IST_ITA3_X. It corresponds to the header
segment for product group related information at item level. It contains the order ID and item number.
…$E101CRMXIF_IST_ITA3
…$E102CRMXIF_APPOINTMENT_XT
…$E102CRMXIF_APPOINTMENT
sapcrmCompositionHandlerOrderItemNotification Overrides the composition handler to stop the item from having
no decrement process
Composition Handlers
The saphbcicrmorder extension provides the following custom composition handler to process the inbound ow:
The process of generating item numbers for B2C scenarios has been modi ed in the current SAP Commerce Billing release. It now always starts from 1 instead of 0 (as was the case in
previous releases). Hence, saphbcicrmorder overrides this composition handler to suppress the decrement of item numbers for the order noti cation received from CRM to SAP
Commerce.
Publication Handlers
The saphbcicrmorder extension provides the following custom publication handler to process the outbound ow:
AppointmentPublicationHandler
Helps create multiple E102CRMXIF_APPOINTMENT target segments by adding contract data to multiple segments with different appointment types but with similar set of data;
crmAbapDate
This converts a Java date stored as a string into the ABAP date format. The format pattern of the Java date representation can be freely de ned by injecting into the corresponding
Spring bean. By default, the pattern yyyy-MM-dd HH:mm:ss.S is used.
sapCrmShippingCondition
This converts the SAP Commerce delivery mode code into the corresponding SAP shipping condition. This is done via the following lookup: Store name of order (expression parameter) --
> Read con guration key from canonical item SAPBaseStoreConfigurationMapping (pool name: expression parameter) --> Read canonical item DeliveryModeMapping via
composite key deliveryMode (expression parameter) + store con guration Key --> Return attribute sapCrmShippingCondition.
Note
No changes in these objects; The existing implementation from sapcrmorder is reused.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 12/74
3/5/2020
Con guration of the saphbcicrmorder Data Hub Extension
No additional con guration settings are required for saphbcicrmorder other than the ones provided by sapcrmorder Data Hub extension. (see con guration section of
sapcrmorder Data Hub extension.)
See the "Feeds & Pools" section of the sapcrmorder Data Hub extension.
Related Information
sapcrmorder Data Hub Extension
sapcrmcustomer Data Hub Extension
The following describes the asynchronous order management process in a B2C scenario:
1. Master data (products, bundles) is replicated from the SAP back end to SAP Commerce.
2. Customers can browse the product catalog or use the product search.
Pricing in product lists (such as the product catalog or the product search result) are list prices. These prices are replicated from CRM via a scheduled CronJob and stored as list
prices in SAP Commerce.
3. Customers choose products and/or personalize their bundle products. Customers add products or bundles to the cart.
5. Customers go to the checkout, place the order, and receive an order con rmation. As soon as the order is placed in SAP Commerce, the order is replicated to CRM through the
Data Hub
6. Customers can search for orders created for their company within a speci c time period, and display the order details from the result list.
7. After the provider contract is created (after submitting the provider order in CRM), the SAP Commerce order is updated
8. Follow-up processes, such as delivery, usage and subscription based services, and billing are processed in SAP Commerce Billing in the SAP back end.
For contract-related process steps, see "Overview of Synchronous Provider Contract Management".
Related Information
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 13/74
3/5/2020
Overview of Synchronous Provider Contract Management
Features in Invoice Management
Feature Description
Late logon Customers do not need to log on until place an order / check out the shopping cart.
Bundles Customers can add bundles to the cart, which they can then personalize.
Bundles can contain multiple products (simple tangible products, one-time services, subscription products);
Bundles can contain optional and alternative products which can be de ned during personalization;
Catalog
Search result
The customer can choose between alternative components, select additional options, and change contract start dates and durations.
Checks on item price validity and stock to determine whether or not a bundle can be added to the cart.
In Catalog and Search, the bundle itself is available, but not the bundle components.
Note
Nested bundles (bundles within bundles) are not supported.
Pricing
Product list prices are shown in the catalog and the search result list.
Bundle-speci c prices are shown for bundles as part of the personalization and checkout process.
Multiple price dimensions are supported (for example, one time, monthly, yearly).
If multiple dimensions are used in the same bundle, the individual price components are converted into one dimension for the price summary (for example,
monthly).
Bundles and their sub-items are displayed in the cart, during checkout, and in the order history.
Actions in the cart For simple products, customers can change the quantities in the cart. For bundles (and their sub-items), the quantities cannot be changed.
For both bundles and simple products, customers can delete items (but not sub-items).
Customers can navigate to bundles personalization to adapt and update their bundles.
Navigation from and to cart When customers add products to the cart, navigate to the order history and return to the cart later within the same session, the cart is retained.
Payment methods in The only payment method supported is payment by payment card.
checkout
Customers can add a new payment card during checkout, or use an existing one.
Delivery types in checkout All SAP back-end delivery types (called shipping conditions in the back end) are supported.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 14/74
3/5/2020
Feature Description
Alternative shipping
Customers can select an alternative shipping address in checkout.
addresses in checkout
Adding new addresses is supported with SAP CRM integration.
Note
In the asynchronous B2C scenario, provider change orders are not shown in the order history.
Self Service in My Account The customer can add a new payment card, or replace an existing one.
Different sort criteria are supported (Invoice Number, Invoice Date, Date for Payment, Total Amount, Payment Method).
Invoice display
Note
Asynchronous provider order management is placed on top of asynchronous order management (CRM). As a result, all functions that are not supported in asynchronous order
management are also not supported in asynchronous provider order management.
SAP Commerce
Asynchronous provider order management does not support synchronous pricing.
The mini cart total is not displayed next to the shopping cart link.
Related Information
Payment Card Integration (B2C)
Bundle-Speci c Pricing
SAP Commerce pricing has been enhanced to include bundle speci c price de nition and determination for a product.
Bundle speci c price for a product can be maintained either via impex import or by directly creating a price row in Backoffice.
PROD-001 $ 50
PROD-001 BUNDLE-A $ 30
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 15/74
3/5/2020
Note
Payment card integration is supported in B2C scenarios only.
Related Information
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 16/74
3/5/2020
Features in Payment Card Integration
Con guring Payment Card Integration
Structures and Extensions for Payment Card Integration
Related Information
Con guring Payment Card Integration
2. Go to your con guration element and select the Synchronous Order Management tab.
2. Go to your con guration element and select the Common Settings tab.
3. In eld Order Type, enter the provider order type used in SAP Commerce Billing.
4. In elds Sales Organization, Distribution Channel, and Division, enter the CRM organizational units to be used to create the provider order.
Setting up Pricing
1. In Backoffice Administration Cockpit, choose SAP Integration SAP Base Store Con guration .
2. Go to your con guration element and select the Pricing tab and make the following entries in section SAP Pricing Procedure Con guration:
SAP Pricing Procedure: Enter the CRM Pricing Procedure to be used as part of provider order creation.
Product Price: Enter how you want the product price to be displayed (Net value, Gross value).
3. Select the Asynchronous Order Management tab and make the following settings under Pricing Condition Types for Sales Orders:
Item Price: One-time item prices are replicated into the con gured CRM pricing condition type
Shipping Costs: Shipping costs are replicated into the con gured CRM freight condition type.
Condition Types for Recurring Item Prices: Recurring item prices are replicated into the con gured CRM pricing condition type.
2. Go to your con guration element and select the Hybris Billing tab and make the following entry in section Rate Plan Mapping:
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 17/74
3/5/2020
Rate Plan Classi cation: Enter the SAP Commerce classi cation that corresponds to the CRM set type Cross Catalog Mapping. This assignment allows you to identify rate
plan products.
Bundle Categories: Enter one or more CRM product categories that are assigned to products that can be bundles,
2. Go to your con guration element and select the Common Settings tab and make the following entry in section Shipping:
Shipping Method Mapping: Map the relevant Hybris Shipping Methods to the SAP Shipping Values.
1. In CRM customizing, choose Customer Relationship Management Master Data Business Partner Business Agreement De ne Basic Settings
2. Check that there is a setting FI-CA Active. If there is no such setting, choose New Entries and add a setting with Active Account 2 FI CA-Active in eld Active Account..
Various dependencies exist between the extensions, as illustrated in the diagram below. The colors used for the various boxes are explained as follows:
Yellow boxes represent extensions that belong to SAP Commerce Billing order management.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 18/74
3/5/2020
Related Information
Structures and Extensions for Asynchronous Order Management
saphbciorderexchangebackoffice Extension
saphbciordermgmtservices Extension (Asynchronous)
saphbciordermgmtfacades Extension (Asynchronous)
saphbcibusinessagreementaddon AddOn
saphbcibusinessagreementfacades
saphbcibusinessagreementservices
saphbciorderexchange Extension
The saporderexchange extension provides reusable functionality related outbound sales orders in asynchronous order management. The saphbciorderexchange extension is
an enhancement to sapcrmorderexchange.
HBCIDefaultOrderEntryContributor provides SAP Commerce Billing Integration speci c attributes to the order entry such as the following:
PARENT_ENTRY_NUMBER
CONTRACT_DURATION
CONTRACT_DURATION_UNIT
CONTRACT_START
SC_GROUP
SELTYPE
DefaultSalesConditionsContributor provides SAP Commerce Billing Integration speci c price-relevant data, such as recurring and non-recurring item prices depending on
your Backoffice condition type to duration unit mapping.
saphbciorderexchangebackoffice Extension
The saphbciorderexchangebackoffice extension adds the relevant SAP Commerce Billing Integration order exchange con guration parameters to Backoffice Administration
Cockpit.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 19/74
3/5/2020
Bundle Personalization
Asynchronous provider order management includes the personalization of bundles.
The sequence diagrams in this section and the following sections use the color coding described below:
When a webshop customer clicks on Personalize on a product search page for a bundle or rate plan product, the prepareBundleSelection method of
ProductBundleSelectionPageController.java is invoked. The following diagram describes the interaction between objects that handle the display of a bundle in
asynchronous as well synchronous order management scenarios.
For each action performed on the personalization screen (for example, selection or deselection of a bundle item, selecting a contract start date or the contract duration of a rate plan
product), the prepareProductBundleSelection method of class ProductBundleSelectionPageController.java is invoked.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 20/74
3/5/2020
The following diagram describes the interaction between objects that handle the personalization of a bundle in asynchronous as well synchronous order management scenarios.
Personalize Bundle
In the B2C asynchronous order management scenario, the information displayed on the bundle personalization page is rendered by HBCIDefaultPersonalizeBundleService.
This class provides implementation for SAP Commerce Billing Integration product bundles for the asynchronous order management scenario. It manages updates on bundles. The bean
with ID sapHbciDefaultPersonalizeBundleService is de ned in saphbciordermgmtservices-spring.xml.
This bean is used by HBCIDelegateAddBundleToCartService.java (see bean de nition sapHbciDelegatePersonalizeBundleService) to call the
HBCIDefaultPersonalizeBundleService.java implementation.
The personalized bundle information is stored in the user session. This is achieved by storing personalized bundles with the bundle identi er as key in a map with scope SAP Session.
Note
The personalized bundle information is held in session only during personalization. As soon as the bundle is added to the cart, or if user refreshes the screen, the bundle is reset to its
default values.
Pricing
Asynchronous provider order management includes bundle-speci c price de nition and determination for a product.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 21/74
3/5/2020
The prices displayed for a product on the product search page (PSP) are rendered by Solr search. The default price to be displayed is determined as per the lter logic implemented in
Europe1PriceFactory:
If there is a standalone (not speci c to a bundle) price maintained for a product, it is displayed on the PSP.
If no price rows exist for the product, then no price is displayed and the product cannot be added to cart due to missing price.
This is checked in the beforeAddToCart hook method. The bean with ID sapHbciAddToCartMethodHook is de ned in saphbciordermgmtservices-spring.xml to add
the bean to the commerceAddToCartMethodHooks list.
This con guration ensures that whenever the addToCart(CommerceCartParameter) method of DefaultCommerceCartService is called, rst the beforeAddToCart
method in HBCIAddToCartMethodHook is executed
The bean with id sapHbciAddToCartMethodHook is de ned in saphbciordermgmtservices-spring.xml to add the bean to the commerceAddToCartMethodHooks
list.
This con guration ensures that whenever addToCart(CommerceCartParameter) method of DefaultCommerceCartService is called, rst the beforeAddToCart
method in HBCIAddToCartMethodHook is executed.
Bundle Prices
If a product is added to cart as part of a bundle, the calculation must take into account the bundle-speci c price (if any) maintained for the product.
Inside the setPricingInfoForBundleItem method, a call to the getPriceRowForProduct method of HBCIDefaultPriceService is made using product model and
bundle identi er as parameters. When a matching price has been found for the product, this method returns a PriceRowModel object.
If a bundle identi er is provided as a parameter, the price rows found are ltered for bundle-speci c price.
If no bundle speci c price is found, the standalone or customer-speci c price is returned for the product.
This SAP Commerce Billing Integration speci c logic is implemented in the findBasePrice method of the HBCIFindPricingWithCurrentPriceFactoryStrategy class.
FindPricingWithCurrentPriceFactoryStrategy provides implementation for price, taxes, and discounts resolver strategies to be used by
DefaultCalculationService (the default SAP implementation for cart calculation). SAP Commerce Billing Integration speci c implementation, such as class
HBCIFindPricingWithCurrentPriceFactoryStrategy, extends this default implementation. To ensure that the findBasePrice method of the SAP Commerce Billing
Integration speci c strategy implementation is called by DefaultCalculationService, the bean de nition with alias currentFactoryFindPricingStrategy (de ned in
order-spring.xml in the platform extension) is overwritten in the saphbciordermgmtservices-spring.xml le.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 22/74
3/5/2020
order-spring.xml
saphbciordermgmtservices-spring.xml
Cart Management
Adding Bundles
When the Add to Cart button is clicked, the addBundleToCart method of HBCIDefaultAddBundleToCartService.java is invoked. The following diagram describes the
interaction between objects to handle addition of a bundle to cart in in an asynchronous order management scenario.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 23/74
3/5/2020
To extend or enhance the add to cart functionality following classes and respective bean de nitions in saphbciordermgmtservices-spring.xml need to be enhanced.
The bean with id sapHbciAddToCartMethodHook is de ned in saphbciordermgmtservices-spring.xml to add the bean to the commerceAddToCartMethodHooks list.
This con guration ensures that whenever addToCart(CommerceCartParameter) method of DefaultCommerceCartService is called, rst the beforeAddToCart
method in HBCIAddToCartMethodHook is executed
Removing Bundles
The following sequence diagram describes the interaction between objects when handling the removal of bundle from a cart.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 24/74
3/5/2020
It is possible to remove a bundle from a cart on the checkout page. Removing a bundle from a cart implies removing the parent entry as well as all child entries of the bundle from the
cart.
To extend or enhance the remove from cart functionality, the following classes and respective bean de nitions in saphbciordermgmtservices-spring.xml need to be
enhanced.
This con guration ensures that whenever the updateQuantityForCartEntry(CommerceCartParameter) method of DefaultCommerceCartService.java is called,
the afterUpdateCartEntry method in HBCIUpdateCartEntryHookImpl.java is executed afterwards.
Repersonalizing Bundles
The following sequence diagram describes the interaction between objects for personalization of bundle from cart in both asynchronous (ASOM) and synchronous (SOM) order
management scenarios.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 25/74
3/5/2020
To lter bundle speci c price and display only standalone price, HBCIProductPricePopulator, a subclass of ProductPricePopulator is called instead of the default price
populator from commerce façade layer (ProductPricePopulator itself).
In the populate method, a call to HBCIDefaultPriceService is made with null value as bundle identi er to return only the standalone price in this scenario.
Calls to the cart, the checkout, or the order history are directly routed to the back end. Provider orders are not persisted in SAP Commerce.
Synchronous provider order management allows you to use a commerce solution based on SAP Commerce without having to remodel your SAP Commerce Billing process.
The SAP CRM back end is the leading system in the entire cart and order process. Requests to carts and provider orders are sent synchronously to the back end.
Master data, such as product data and customer data must be replicated to SAP Commerce.
Safeguarding heavy investments made in SAP Commerce Billing. For example, the implementation of complex pricing, product bundles and change processes.
The following describes the synchronous order management process in B2B scenario:
1. Master data is replicated from the SAP back end to SAP Commerce.
a. Customers log on to the online store. To nd products, they either browse the product catalog or use the product search.
b. Pricing in product lists (such as the product catalog or the product search result) are list prices. These prices are replicated from CRM via a scheduled CronJob and stored
as list prices in SAP Commerce.
Note
Pricing in the product detail is synchronous. Price components are con gured and calculated in the SAP back end. The latest price components are called directly from
the back end and are displayed in the online store without any replication delay.
2. Customers choose products and/or personalize their bundle products. Customers add products or bundles to the cart. SAP back-end functionality is used for cart and checkout
(for example, the SAP Commerce functionality for pricing and bundles is bypassed completely). As soon as customers add products to the cart, an order is created in the back
end.
Note
SAP Commerce functions (such as quotations, vouchers and promotions, budget allocation, cost center assignment, and approval work ow) are not available.
3. Customers go to the checkout, place the order, and receive an order con rmation. As soon as the order is placed in SAP Commerce, the back-end order is updated and saved.
4. Customers can search for orders created for their company within a speci c time period, and display the order details from the result list.
5. Follow-up processes, such as delivery, usage and subscription based services, and billing are processed in SAP Commerce Billing in the SAP back end.
6. For contract-related process steps, see "Overview of Synchronous Provider Contract Management".
Related Information
Overview of Synchronous Provider Contract Management
Note
Synchronous provider order management is placed on top of synchronous order management with SAP CRM reusing multiple features.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 27/74
3/5/2020
Feature Description
Early logon Customers must log on before they can add a product to the shopping cart. If you use out-of-the-box functionality (secureportaladdon extension), they must log on
before they can even enter the online store.
In product detail screens, during personalization, in the cart, or during checkout: Complex, customer-speci c prices;
Bundles Customers can add bundles to the cart, which they can then personalize.
Bundles can contain optional and alternative products which can be de ned during personalization.
During personalization, the SAP back end calculates product prices in the bundle, including complex pricing logic.
Bundles can contain subitems and dynamically derived items calculated by the SAP backend.
Note
Nested bundles (bundles within bundles) are not supported.
Bundles and their subitems are displayed in the cart, during checkout, and in the order history.
As soon as customers add a product to the cart, an order is created in the SAP back end. As soon as they place the order in the online store, the order in the
back end is updated and saved.
Discounts are calculated on item total level but are not shown separately.
The pricing information given in the cart and checkout is determined dynamically based on multiple criteria. It fully renders complex pricing available in the SAP
back end.
Actions in the cart For simple products, customers can change the quantities in the cart. For bundles (and their subitems), the quantities cannot be changed.
For both bundles and simple products, customers can delete items (but not subitems).
Customers can navigate to bundles personalization to adapt and update their bundles.
Navigation from and to cart When customers add products to the cart, navigate to the order history and return to the cart later within the same session, the cart is retained.
Cart handling between For more information, see "Cart Handling in Synchronous Order Management".
sessions and with planned
downtimes
Purchase order number (PO Customers may enter a purchase order number.
no.)
Delivery types in checkout All SAP back-end delivery types (called shipping conditions in the back end) are supported.
Alternative shipping
Customers can select an alternative shipping address in checkout. The shipping addresses available in SAP Commerce include the address of the sold-to party
addresses in checkout
in the SAP back end, and the addresses of all ship-to parties belonging to the sold-to party. All addresses belong to one and the same B2B unit in SAP
Commerce and are retrieved from the SAP Commerce address book.
Changing existing addresses and adding new addresses is not supported with SAP integration.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 28/74
3/5/2020
Feature Description
The result list is sorted by creation date and order number, in descending order. Customers can also sort by order number or PO number.
The result list displays the following information: SAP order number, PO number, creation date, order status.
Note
Synchronous provider order management is placed on top of synchronous order management. As a result, all functions that are not supported in synchronous order management are
also not supported in synchronous provider order management.
SAP Commerce
Vouchers and promotions
The mini cart total is not displayed next to the shopping cart link.
SAP CRM
Product hierarchies
Product variants
Replenishment orders
Quotations
Related Information
Setting RFC Destinations and HTTP Destinations
Related Information
Cart Handling in Synchronous Order Management
1. In Backoffice Administration Cockpit, choose SAP Integration SAP Base Store Con guration .
2. Go to your con guration element and select the Common Settings tab.
4. Go to your con guration element, and select the Hybris Billing tab.
In eld Rate Plan Classi cation, enter the SAP Commerce classi cation that corresponds to the CRM set type Cross Catalog Mapping. This assignment allows you
to identify rate plan products.
This works by taking the classi cation classes of the product which is being evaluated, and comparing them to the classi cation class that is con gured in the eld Rate
Plan Classi cation in Backoffice Administration Cockpit. If there is a match, then the product is a rate plan product.
In eld Bundle Categories, enter one or more CRM product categories that are assigned to products that can be bundles.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 29/74
3/5/2020
For Submit Order, choose either true or false:
For provider orders, any orders submitted in the shop UI are automatically released in the back end.
For provider contracts, any change orders created as a result of a change process are automatically released in the back end.
3. In the eld Max. Number of results, enter the maximum number of provider orders you want to select (0 = unlimited).
4. In the eld Creation Period (Number of Days), enter the time period you want to use to select provider orders. Only provider orders dated up to this number of days into the past
are selected from the CRM backend system.
You will not always see the most recent provider orders at the top of the list.
If, in the Backoffice (Tab Synchronous Order Management, section Search For Orders), you have speci ed a maximum number of results to be displayed, the most recently
created provider orders might be dropped from the results list.
To change the sorting of the provider orders so that the most recent provider orders are displayed at the top of the results list, implement SAP Note 1614769 and apply the solution
proposed for case 2: ʻRecords found when max. hits has been reached'.
Note
Adding sort criteria can have an effect on the performance of the list display.
The mapping of messages is de ned in messages.xml that belongs to the saphbcicommon extension. After a back end call, the messages coming from SAP CRM are checked
against the rules de ned in messages.xml to determine if the messages are supposed to be processed before being displayed on the UI. Examples of mapping rule de nitions are
explained in the sections “sapordermgmtbol Extension" and "Mapping Messages from SAP ERP”.
The mapping rules are de ned in XML format and apply to E (Error), W (Warning), I (Information), and S (Success) messages. If a message with severity A (Abort) is raised from the back
end, a runtime exception should be thrown to abort the current process.
You can de ne your own messages.xml in your customer extension and map messages according to your needs. A custom messages.xml can be loaded during runtime by de ning
your own rulesContainerFile in <yourextension>-spring.xml:
Sample Code
<alias alias="sapCrmOrdermgmtMessageMappingRulesLoader" name="sapHBCIOrdermgmtDefaultMessageMappingRulesLoader" />
<bean id="sapHBCIOrdermgmtDefaultMessageMappingRulesLoader" parent="sapCrmOrdermgmtDefaultMessageMappingRulesLoader"
class="com.sap.hybris.hbci.model.transaction.salesdocument.backend.impl.messagemapping.HBCIMessageMappingCRMRulesLoaderImpl">
<property name="rulesContainerFile" value="saphbcimessagemapping/messages.xml" />
</bean>
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 30/74
3/5/2020
To make sure that orders and contracts are selected correctly for display (for example in the order history), you need to parse the date and times used in SAP Commerce to those used
by the RFC (Remote Function Call) user in the SAP CRM back end.
Context
To specify the date and time format used in the CRM back end, you need to de ne the property saphbcicommon.search.datetimepattern in the local.properties le in
SAP Commerce:
Procedure
1. To see the date and time format used in the SAP CRM back end, call up transaction SU01, enter the RFC user and switch to the Default tab.
You can see the formats used in elds Date Format and Time Format (12/24h).
3. Copy the following lines from the le and paste them into the local.properties le.
Sample Code
# Date/Time pattern used to parse Dates in the result of the order/contract search
#saphbcicommon.search.datetimepattern=dd.MM.yyyy HH:mm:ss
4. Take out the # at the beginning of the second line. If necessary, change the sample date time format dd.MM.yyyy HH:mm:ss to match the format used by the RFC user.
Context
Carry out the following procedure only if one of the following cases apply in the CRM backend system:
The personal time zone de ned for the RFC user is different to the time zone used in SAP Commerce.
In this case, you need to enter the personal time zone in property saphbcicommon.search.timezone in the local.properties le.
(To see the personal time zone, call up transaction SU01, enter the RFC user and switch to the Default tab.)
The RFC user does not have a personal time zone de ned, but the CRM back end system time zone is different to the time zone used in SAP Commerce.
In this case, you need to enter the system time zone in property saphbcicommon.search.timezone in the local.properties le.
To specify that the CRM back end uses a different time zone, you need to de ne the property saphbcicommon.search.timezone in the local.properties le in SAP
Commerce.
Procedure
1. Open your project.properties le in extension saphbcicommon.
2. Copy the following lines from the le and paste them into the local.properties le.
Sample Code
3. Take out the # at the beginning of the second line. If necessary, change the sample time zone CET to match the time zone used in the CRM back end.
The diagram below illustrates the extension dependencies. The colors used for the various boxes are explained as follows:
Yellow boxes represent extensions that belong to SAP Commerce Billing synchronous order management
Orange boxes represent extensions that belong to SAP synchronous order management
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 31/74
3/5/2020
How to Deploy
If you run SAP Commerce Billing order management within the Hybris B2B Accelerator, see saphbciordermgmtaddon AddOn.
You can also use parts of this functionality to build a custom online store that accesses SAP Commerce Billing synchronously. In this case, you can activate the extension
saphbciordermgmtservices without the facades and AddOn extension.
Related Information
saphbciordermgmtaddon AddOn
saphbciordermgmtservices Extension
saphbcicommon Extension
The saphbcicommon extension is the base extension for SAP Commerce Billing integration.
It is used by ordermanagement and contractmanagement. It can be reused by applications / synchronous scenarios. It contains, for example, model extensions such as attributes
speci c to SAP Commerce Billing Integration for SapConfiguration or AbstractOrderEntry.
saphbciordermgmtbol Extension
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 32/74
3/5/2020
The saphbciordermgmtbol extension provides the Business Object Layer (BOL) implementation for SAP Commerce Billing. The BOL implementation is required for the sales
process, business and back-end objects, and related interfaces and classes.
The extension consists of entities that represent the bundles, current cart, order, or order history search result in a user session. These objects are called BOL objects. They can be found
in saphbciordermgmtbol-bo-spring.xml. They have user session scope.
In addition, there are so-called back-end objects that establish the connection to the SAP CRM back end (see saphbciordermgmtbol-be-spring.xml). These back-end objects
have session scope as well.
All helper objects, mostly with scope prototype, are registered in saphbciordermgmtbol-spring.xml.
1. Create a custom extension and create custom beans (most likely by subclassing the standard implementations).
3. Assign your custom bean to the alias registered for the standard implementation.
Activation
To integrate synchronous order management with SAP CRM, activate saphbciordermgmtbol. In this case, the extension needs to be declared in localextensions.xml.
The backend strategies and mapper classes de ned by this extension are as follows:
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 33/74
3/5/2020
Sample Code
<alias alias="sapOrdermgmtSalesdocHeader" name="sapHBCIOrdermgmtDefaultSalesdocHeader" />
<bean id="sapHBCIOrdermgmtDefaultSalesdocHeader" scope="prototype" parent="sapOrdermgmtDefaultSalesdocHeader"
class="com.sap.hybris.hbci.saphbciordermgmtbol.transaction.header.businessobject.impl.HBCIHeaderSalesDocument">
</bean>
Order History
This contains the implementation HBCISearchBackendCRM of the SearchBackend interface
de.hybris.platform.sap.sapordermgmtbol.transaction.salesdocument.search.backend.interf.
The default implementation executes Remote Function Call (RFC) CRM_HYB_PROV_SEL to get a list of provider orders from the back end.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 34/74
3/5/2020
Method public SearchResultList getSearchResult (final SearchFilter searchFilter) throws a BackendException.
Bundle Integration
This contains the class TransientGetBundleDataProvider.java (which by default handles calls to the back end RFCs) to the function module
CRM_HYB_PROV_ORDER_SC_SIM_MNT. This function modules handles the bundle selection (creation of a new selection; adding/removing items; setting durations and start dates) and
returns a BundleDataModel. BundleDataModel is a data structure which is generated from the saphcimodel-beans.xml of the saphbcicommon extension and contains the
entire structure of the function module.
To alter this behavior following entry points can be used (all classes are de ned as spring beans and can be enhanced)
Method read converts the JCo result into the structure which was de ned in saphbcicommon-beans.xml. This method is usually called after the execution of the RFC
call
Method write converts the above mentioned structure to JCo data before executing the RFC in the back end.
Orchestrates the usage of the mapper (to manage the JCo data structures) and the call to the execution of the RFC call in
CrmHybProvOrderScSimMntStrategy.java.
Extension Points
You can use the following extension points to add your own implementation logic to bundle integration:
Sample Code
<alias alias="sapHbciGetBundleBol" name="sapDefaultHbciGetBundleBol"/>
<bean id="sapDefaultHbciGetBundleBol"
class="com.sap.hybris.hbci.saphbciordermgmtbol.getbundledata.impl.TransientGetBundleDataProviderImpl" scope="sapSession" parent="sapCoreBac
<property name="moduleConfigurationAccess" ref="sapGetBundleDataAccess" />
<property name="defaultConnectionName" value="JCoStatefulServiceUser" />
<property name="bundleDataStrategy" ref="sapGetBundleDataStrategy"/>
<property name="defaultDestinationName" value="#{baseStoreService.getCurrentBaseStore().getSAPConfiguration().getSappricing_RFCDestination(
<property name="genericFactory" ref="sapCoreGenericFactory"/>
</bean>
saphbciordermgmtservices Extension
The saphbciordermgmtservices extension contains services that are used for integrating synchronous order management for SAP Commerce Billing into SAP Commerce
applications.
It tries to hide the structure of the Business Object Layer (BOL) and back-end access layer (part of extension saphbciordermgmtbol). It provides a simple interface to cart,
checkout, and order handling that is close to standard SAP Commerce terminology and can easily be consumed from standard or custom-built facades. It contains the mapping between
the BOL representation of entities (such as cart or order) and the SAP Commerce representation (such as CartData, OrderData or OrderEntryData).
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 35/74
3/5/2020
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 36/74
3/5/2020
The Order Details also displays the lifecycle status of the provider order from the CRM back end. The status is mapped as follows:
Bundle Integration
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 37/74
3/5/2020
The process contains the entry points to the bundle selection process. Every class is de ned as a spring bean and can be enhanced by altering the saphbciordermgmtservices-
spring.xml:
This service contains all the functionality needed to select a bundle or a rate plan:
getBundleData is used to start a new selection. It requires only a product ID and returns the initial state of the selection.
addRemoveComponentFromSelection adds or removes an item from the selection. It requires the orderGuid (which is created by the back end during the
getBundleData call) and some other information on the item to be selected (product GUID, instance ID of the item in the current selection, instance ID of its parent
item and (if there is one) the group it belongs to).
To select a date or duration, the addRemoveComponentFromSelection method is also used. The only added information it requires is the desired timeframe.
Note
Select the item rst, then the speci c time frame.
Note
During selection the HBCIGetBundleDataService.java accesses some information which is usually maintained in the SAP Commerce Order Management Cockpit or in
the Backoffice Administration Cockpit, such as:
Currency
Language
ERPCutomerID
SalesOrg, Division
Distribution channel
SalesOrg Responsible
This service starts a process to add a bundle to the current cart. It only requires the orderGuid of the selected bundle.
Read the current state of the selection from the backend by using the provided orderGuid.
Add the items to the cart using the SAP Commerce CartService.addItemsToCart method.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 38/74
3/5/2020
Extension Points
You can use the following extension points to add your own implementation logic to bundle integration:
Sample Code
<alias name="sapDefaultGetBundleDataService" alias="sapHbciGetBundleDataService" />
<bean id="sapDefaultGetBundleDataService"
class="com.sap.hybris.hbci.getbundledataservice.impl.HBCIGetBundleDataServiceImpl">
<property name="genericFactory" ref="sapCoreGenericFactory" />
<property name="providerBeanId" value="sapHbciGetBundleBol" />
<property name="bolCartFacade" ref="sapOrdermgmtBolCartFacade" />
<property name="baseStoreService" ref="baseStoreService" />
<property name="flexibleSearchService" ref="flexibleSearchService" />
<property name="userService" ref="userService" />
<property name="i18nService" ref="i18nService" />
<property name="commonI18NService" ref="commonI18NService" />
<property name="moduleConfigurationAccess" ref="sapHbciOrdermgmtservicesConfigurationAccess" />
</bean>
<alias name="sapDefaultAddBundleToCartService" alias="sapHbciAddBundleToCartService" />
<bean id="sapDefaultAddBundleToCartService"
class="com.sap.hybris.hbci.addtocartservice.impl.HBCIAddBundleToCartServiceImpl">
<property name="bundleDataService" ref="sapHbciGetBundleDataService" />
<property name="cartService" ref="sapOrdermgmtCartService" />
<property name="genericFactory" ref="sapCoreGenericFactory" />
<property name="commerceCartService" ref="commerceCartService" />
<property name="cartRestorationService" ref="sapOrdermgmtCartRestorationService" />
<property name="productConfigurationService" ref="sapOrdermgmtProductConfigurationService" />
<property name="productService" ref="productService" />
<property name="modelService" ref="modelService" />
</bean>
saphbciordermgmtfacades Extension
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 39/74
3/5/2020
The saphbciordermgmtfacades extension contains the facades that form the layer closest to the UI. They encapsulate the business logic speci c to the SAP Commerce Billing
integration scenario.
The interaction with the facades is executed through UI controllers. While the facades are responsible for the orchestration of the services, the conversion between the Business Object
Layer (BOL) and SAP Commerce is in the responsibility of the services.
Bundle Integration
This process is handled by the BundleDetailsFacade.java (and its implementation BundleDetailsImpl.java). Its main purpose is to act as a wrapper to the
saphbciordermgmtservices bundle integration processes. The most important functions in this context are:
addBundleToCart: Ends the bundle selection process and adds the selected bundle to the cart;
removeBundleFromCart: Removes a bundle from the cart; This process is used during the update bundle from cart scenario. On updating the selection, the old bundle will be
removed and the new one added.
In addition to acting as a wrapper, the BundleDetailsFacade.java handles the conversion of the RFC-related bundle data structure to a UI-related structure called BundleData
(which is de ned in the saphbciordermgmtfacades-beans.xml). To achieve this, multiple populators are used:
HBCIBundleDataPopulator.java: Main populator; Converts the data retrieved from the backend.
HBCIBundleProductDataPopulator.java: Gathers additional product data from the local SAP Commerce database (description, graphics…);
Extension Points
You can use the following extension points to add your own implementation logic to bundle integration:
Sample Code
<alias name="sapDefaultHbciBundleDataFacade" alias="sapHbciBundleDataFacade" />
<bean id="sapDefaultHbciBundleDataFacade"
class="com.sap.hybris.hbci.saphbciordermgmtfacades.bundledetails.impl.BundleDetailsFacadeImpl">
<property name="bundleDataService" ref="sapHbciGetBundleDataService" />
<property name="bundleDataPopulator" ref="bundleDataPopulator" />
<property name="bundleProductDataPopulator" ref="bundleProductDataPopulator" />
<property name="bundleMessageDataPopulator" ref="sapHBCIBundleDataMessageDataPopulator" />
<property name="genericFactory" ref="sapCoreGenericFactory" />
<property name="addBundleToCartService" ref="sapHbciAddBundleToCartService" />
<property name="cartFacade" ref="cartFacade" />
<property name="cartRestorationFacade" ref="sapOrdermgmtCartRestorationFacade" />
<property name="cartService" ref="sapOrdermgmtCartService" />
</bean>
<bean id="bundleDataPopulator"
class="com.sap.hybris.hbci.saphbciordermgmtfacades.bundledetails.converters.populator.HBCIBundleDataPopulator">
<property name="priceFactory" ref="priceDataFactory" />
<property name="baseStoreService" ref="baseStoreService" />
</bean>
<bean id="bundleProductDataPopulator"
class="com.sap.hybris.hbci.saphbciordermgmtfacades.bundledetails.converters.populator.HBCIBundleProductDataPopulator">
<property name="productFacade" ref="productFacade" />
</bean>
saphbciordermgmtaddon AddOn
The saphbciordermgmtaddon AddOn is a template which extends a target storefront with order management functionality that is speci c to SAP Commerce Billing integration order
management.
The AddOn depends technically hereby on content which is provided by the ysapordermgmtb2baddon and the b2bacceleratoraddon to the target storefront.
Note
The AddOn’s user interface does not necessarily enhance the dependent AddOns' user interface, rather it partly replaces them. The saphbciordermgmtaddon AddOn focuses
exclusively on HBCI functionality. Certain features of the dependent AddOns (like, for example, stock availability of hardware products or promotions) are not supported in the cart
and checkout process by the saphbciordermgmtaddon AddOn’s user interface
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 40/74
3/5/2020
If you are installing SAP Commerce Billing for non-production (for example evaluation or demo) purposes, the target storefront is the yacceleratorstorefront for the power tools
store. (See also "Installing the Integration Package").
AddOn De nition
Name saphbciordermgmtaddon
Description This AddOn is a template which extends a target storefront with SAP Commerce Billing order
management speci c functionality.
Directory bin/ext-integration/hbci/saphbciordermgmtaddon
Requires
ysapordermgmtb2baddon
b2bacceleratoraddon
saphbciordermgmtfacades
New UI where you can personalize product bundles and rate plan products.
Changes to the appearance of the following pages (provided by the AddOns ysapordermgmtb2baddon and b2bacceleratoraddon.
Product details
Prices are shown as net or gross prices, depending on the con guration of the Base Store.
Once a product bundle or rate plan product is placed in the cart, it can be personalized (that is, updated) again from within the cart (see Section Cart and Checkout below.)
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 41/74
3/5/2020
Note
Products that do not require personalization can be added directly to the cart.
Product Details
Product bundles and rate plan products can also be personalized from the product details page.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 42/74
3/5/2020
Remove items;
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 43/74
3/5/2020
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 44/74
3/5/2020
Contents
This section provides references for developers to the most interesting les, le locations and con guration of the saphbciordermgmtaddon.
This AddOn access SAP Commerce Billing integration bundle functionality via the saphbciordermgmtfacades extension by its product bundle selection page controller and product
bundle selection rest controller.
Page controllers from other extensions are not touched. Presenting adjusted pages instead of the original ones in the user’s browser is done by intercepting the HBCI Before View
Handler (see the saphbciordermgmtaddon-web-spring.xml for con guration details).
JSP les
Sample Code
<dir>\acceleratoraddon\web\webroot\WEB-INF\views\responsive\pages
\account
\cart
\checkout\multi
\error
\layout
\product
<dir>\acceleratoraddon\web\webroot\WEB-INF\views\responsive\fragments
\cart
<dir>\acceleratoraddon\web\webroot\WEB-INF\views\responsive\cms
Tag les:
Sample Code
<dir>\acceleratoraddon\web\webroot\WEB-INF\tags\responsive
\bundle
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 45/74
3/5/2020
\cart
\checkout\multi
\order
\product
Language-dependent texts
<dir>\acceleratoraddon\web\webroot\WEB-INF\messages
<dir>\acceleratoraddon\web\webroot\_ui\responsive\common\css
JavaScript les
<dir>\acceleratoraddon\web\webroot\_ui\responsive\common\js
Page Controllers
<dir>\acceleratoraddon\web\src
com.sap.hybris.hbci.saphbciordermgmtaddon.controllers.pages.ProductBundleSelectionPageController
com.sap.hybris.hbci.saphbciordermgmtaddon.controllers.pages.ProductBundleSelectionRestController
Interceptor
<dir>\src
com.sap.hybris.hbci.saphbciaddon.interceptor.HBCIBeforeViewHandler
Con guration
CMS action for the Personalize button (DefineProductBundleAction), action renderer, page controllers, before view handler and view map.
<dir>\resources\saphbciordermgmtaddon-item.xml
<dir>\resources\saphbciordermgmtaddon\web\spring\saphbcicontractmgmtaddon-web-spring.xml
ImpEx Files
The following ImpEx le contains the assignments of the CMS Action for Personalize button (DefineProductBundleAction) to the corresponding components to be displayed on
content pages. This ImpEx le also provides a new page template (ProductBundleSelectionPageTemplate) that sets the full width of the page.
<dir>\resources\saphbciordermgmtaddon\import\contentCatalogs\powertoolsContentCatalog
cms-content.impex
Sample Code
<dir>\src
com.sap.hybris.hbci.saphbciaddon.initialdata.setup.InitialDataSystemSetup
com.sap.hybris.hbci.saphbciaddon.services.dataimport.impl.HbciAddOnSampleDataImportService
<dir>\resources\saphbcicontractmgmtaddon-spring.xml
<from> \bin\ext-
integration\hbci\saphbciordermgmtaddon\acceleratoraddon\web\webroot
<to> \bin\ext-template\yacceleratorstorefront\web\webroot
Tag les
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 46/74
3/5/2020
<from>\WEB-INF\tags\responsive\product\productAddToCartPanel.tag
<to>\WEB-INF\tags\addons\b2bacceleratoraddon\responsive\product \productAddToCartPanel.tag
JavaScript les
<from>\_ui\responsive\common\js\cms\defineproductbundleaction.js
<to>\_ui\responsive\common\js\cms\
This le is a saphbciordermgmtaddon speci c dummy le to prevent "JavaScript le not found" error in the browser.
For a contract start the requested contract start date is sent by the user’s browser to the product bundle selection page controller. The expected (by the controller) string format of this
receiving date is de ned in the following con guration le:
<dir>\project.properties
saphbciordermgmtaddon.form.input.date.dateformat=dd.MM.yyyy
In addition, saphbciordermgmtaddon requires the following JavaScript les to be present on storefront to avoid error messages:
jquery-ui.min.js
bootstrap.min.js
jquery.blockUI.min.js
Sample Code
<mystorefrontextensionname>.additionalWebSpringConfigs.myaddon=classpath:/myaddon/web/spring/myaddon-web-spring.xml
Manual Installation
To manually install the saphbciordermgmtaddon AddOn (as opposed to out-of-the-box installation), carry out the following steps:
1. Ensure that AddOn saphbciordermgmtaddon along with its required extensions is added to your localextensions.xml le.
4. Start the SAP Commerce server and perform a platform update with the following options selected:
Localize types
saphbciordermgmtaddon
Model Layer
Model Interceptors
Cockpit Beans
Validation Rules
Service Layer
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 47/74
3/5/2020
Facade DTO
Facade Layer
CMS Components
Page Templates
JavaScript
CSS
Page Controllers
Tags
TLD
Filters
MVC Interceptors
Spring Security
Message Resources
Contents
This section provides references for developers to the most interesting les, le locations and con gurations of the saphbciordermgmtaddon AddOn.
This AddOn accesses SAP Commerce Billing “bundle” functionality via the saphbciordermgmtfacades extension by its product bundle selection page controller and product
bundle selection rest controller.
Page controllers from other extensions are not touched. Presenting adjusted pages instead of the original ones in the user’s browser is done by intercepting the HBCI Before View
Handler (see the saphbciordermgmtaddon-web-spring.xml for con guration details).
JSP les:
<dir>\acceleratoraddon\web\webroot\WEB-INF\views\desktop\pages
<dir>\acceleratoraddon\web\webroot\WEB-INF\views\desktop\fragments
dir>\acceleratoraddon\web\webroot\WEB-INF\views\desktop\cms
Tag les:
<dir>\acceleratoraddon\web\webroot\WEB-INF\tags\desktop
Language-dependent texts:
<dir>\acceleratoraddon\web\webroot\WEB-INF\messages
<dir>\acceleratoraddon\web\webroot\_ui\desktop\common\css
JavaScript les:
<dir>\acceleratoraddon\web\webroot\_ui\desktop\common\js
in particular saphbciordermgmtaddon.js)
Page Controllers
<dir>\acceleratoraddon\web\src
com.sap.hybris.hbci.saphbciordermgmtaddon.controllers.pages.ProductBundleSelectionPageController
com.sap.hybris.hbci.saphbciordermgmtaddon.controllers.pages.ProductBundleSelectionRestController
Interceptor
<dir>\src
com.sap.hybris.hbci.saphbciordermgmtaddon.interceptor.HBCIBeforeViewHandler
Con guration
CMS action for Personalize button (DefineProductBundleAction), action renderer, page controllers, before view handler and view map.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 48/74
3/5/2020
<dir>\resources\saphbciordermgmtaddon-item.xml
<dir>\resources\saphbciordermgmtaddon\web\spring\saphbcicontractmgmtaddon-web-spring.xml
If the installation recipe for non-production purposes was used for an out-of-the-box installation, then the following les are replaced by copying in the yacceleratorstorefront:
<from> \bin\ext-
integration\hbci\saphbciordermgmtaddon\acceleratoraddon\web\webroot
<to> \bin\ext-template\yacceleratorstorefront\web\webroot
Tag les
<from>\WEB-INF\tags\desktop\product\productAddToCartPanel.tag
<to>\WEB-INF\tags\addons\b2bacceleratoraddon\desktop\product \productAddToCartPanel.tag
JavaScript les
from>\_ui\desktop\common\js\cms\defineproductbundleaction.js
<to>\_ui\desktop\common\js\cms\
This le is a saphbciordermgmtaddon speci c dummy le to prevent a JavaScript le not found error in the browser.
Related Information
Installing the Integration Package
Customers can carry out the following actions as part of contract management:
Directly con rm the change process without adding the change order to the cart;
Each line item represents a speci c time period of a contract. The current contract is always represented by the most recently de ned time period.
The integration of provider contracts in SAP Commerce begins with the search for the contract item that corresponds to the most recent time period.
In SAP Commerce, a user can select a contract and display the contract details.
If a contract is still active in the back end, a user can choose to terminate it or extend it by triggering the corresponding change process from the Contract Detail page:
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 49/74
3/5/2020
A termination displays a new screen on which the user can enter a Requested End Date. After the user con rms the change request, a contract change order is created and saved
in the back end. In SAP Commerce, the change order can be found and displayed from the Order History. In the Order Details view a change order is marked with the text
CHANGE ORDER.
If the change order is automatically released, a new contract item is created. The new contract item can now be displayed in SAP Commerce.
An extension displays a new screen on which the user can enter an Extension Period. After the user con rms the change request, a contract change order is created and saved in
the back end. In SAP Commerce, the change order can be found and displayed from the Order History. In the Order Details view a change order is marked with the text CHANGE
ORDER.
If the change order is automatically released, a new contract item is created. The new contract item can now be displayed in SAP Commerce.
The following table provides the features in synchronous provider contract management
Feature List
Feature Description
Searching contracts Customers can search for contracts created for their company (within a time period de ned in
Backoffice Administration Cockpit), and view the contract items.
Executing a change process Customers can start change processes from Contract Details. They can choose between
processes such as contract extension or contract termination.
Change process: Termination Customers can start this process by choosing Terminate in Contract Details. They can enter a
requested contract end date. Con rm sends the change order to the back end, where the contract
change is processed.
Change process: Extension Customers can start this process by choosing Extend in Contract Details. They can choose a
contract extension period. Con rm sends the change order to the back end, where the contract
change is processed.
Displaying Change Orders Customers can see their change orders in Order History.
1. In Backoffice Administration Cockpit, choose SAP Integration SAP Base Store Con guration .
2. Go to your con guration element, and select the Hybris Billing tab.
a. In the eld Contract Transaction Type, set the required contract transaction type.
b. In the eld MAX ContractHits, enter the maximum number of provider contracts you want to select (0 = unlimited).
c. In the eld Contract date Range(number of days), enter the time period you want to use to select invoices. Only provider contracts dated up to this number of days into
the past are selected from the CRM backend system.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 50/74
3/5/2020
3. Save your entries.
You will not always see the most recent provider contracts at the top of the list.
If, in the Backoffice (Tab Hybris Billing, section Process Control), you have speci ed a maximum number of results to be displayed, the most recently created provider contracts
might be dropped from the results list.
To change the sorting of the provider contracts so that the most recent provider contracts are displayed at the top of the results list, implement SAP Note 1614769 and apply the
solution proposed for case 2: ʻRecords found when max. hits has been reached'.
Note
Adding sort criteria can have an effect on the performance of the list display.
Context
Carry out the following steps only if:
You want to use the sample coding provided for terminating contracts.
The time zone of the date type CANCREQUEST in SAP CRM is different to the time zone used in SAP Commerce.
Procedure
1. Open your project.properties le in extension saphbcicontractmgmtservices.
2. Copy the following lines from the le and paste them into the local.properties le.
Sample Code
# Time-zone used to format the Requested Contract End Date from the Termination Contract change process UI
# before it is sent to the CRM back-end.
# This time-zone has to match the time-zone, which is configured in CRM for the CANCREQUEST (Cancellation Request)
# date type.
# If this property is not given, the time-zone from the hybris I18N Service is used
#saphbcicontractmgmtservices.changeproc.cancel.datetype.cancrequest.timezone=CET
4. Change the sample time zone CET to match the time zone used in the date type CANCREQUEST in SAP CRM.
Dependencies between the extensions are illustrated in the diagram following. The colors used for the various boxes have the following meaning:
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 51/74
3/5/2020
Yellow boxes represent extensions that belong to HBCI synchronous contract management and change processes
Orange boxes represent extensions that belong to SAP synchronous contract management
saphbcicontractmgmtbol Extension
The saphbcicontractmgmtbol extension contains HBCI-speci c implementation for synchronous contract management. It provides implementation for functions such as contract
search, reading contract details, and executing contract change processes.
This implementation forwards the calls from the HBCI-speci c service layer to back end objects, which execute Remote Function Modules (RFCs) to retrieve provider contracts from the
SAP back-end (CRM) system and to change provider contracts in the SAP back-end (CRM) system.
Activation
Activate the saphbcicontractmgmtbol extension to integrate the synchronous management of provider contracts with SAP CRM. For this integration scenario, the extension needs
to be declared in localextensions.xml.
Contract History
This contains the implementation SearchBackendImpl of the SearchBackend interface
com.sap.hybris.hbci.saphbcicontractmgmtbol.transaction.contract.search.backend.
The default implementation executes Remote Function Call (RFC) CRM_HYB_PROV_SEL to get a list of provider contracts from the back end.
Contract Details
This contains the implementation ContractBackendImpl of the ContractBackend abstract class
com.sap.hybris.hbci.saphbcicontractmgmtbol.transaction.contract.backend.
The default implementation executes Remote Function Call (RFC) CRM_HYB_PROV_ORDER_GET to get a list of provider contracts from the back end.
The default implementation executes Remote Function Call (RFC) CRM_HYB_PROV_CONT_CHANGE to execute a change process on a provider contract in the back end.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 52/74
3/5/2020
saphbcicontractmgmtservices Extension
Extension saphbcicontractmgmtservices includes service interfaces for provider contracts, which are used to delegate the calls from the facade layer to the Business Object
Layer (BOL).
Activation
Activate the saphbcicontractmgmtservices extension to integrate synchronous management of provider contracts with SAP CRM. In this case, the extension needs to be
declared in localextensions.xml.
saphbcicontractmgmtfacades Extension
Extension saphbcicontractmgmtfacades contains SAP Commerce integration speci c façade interfaces for synchronous contract management. Their implementations include
logic to populate the contract DTO from data of the contract business object and other SAP Commerce objects.
Activation
Activate saphbcicontractmgmtfacades extension to integrate synchronous management of provider contracts with SAP CRM. In this case, the extension needs to be declared in
localextensions.xml.
DefaultContractHistoryPopulator populates the ContractHistoryData DTO with data from the SearchResult object.
DefaultContractItemDataPopulator populates the ContractItemData DTO with data from the ContractItem object.
DefaultContractChangeModelOrderDataPopulator populates the OrderData DTO with data of the change order from the ContractChangeModel object.
saphbcicontractmgmtaddon AddOn
The saphbcicontractmgmtaddon AddOn is a template, which extends a target storefront with SAP Commerce Billing integration-speci c functionality for provider contract
management. It complements the functionality provided by the saphbciordermgmtaddon AddOn.
The AddOn enhances the My Account area of the target storefront. It also provides new UIs for provider contract history and provider contract details, as well as UIs for extending or
terminating provider contracts.
In case of SAP Commerce Billing installations for non-production (for example, evaluation or demo) purposes, the yacceleratorstorefront for the power tools store is the out-of-
the-box target storefront (see "Installing the Integration Package").
Note
A SAP Commerce extension may provide functionality that is licensed through different SAP Commerce modules. Make sure that you limit your implementation to the features
de ned in your contract license. In case of doubt, please contact your SAP Commerce sales representative.
AddOn De nition
Name saphbcicontractmgmtaddon
Description This AddOn is a template which extends a target storefront with HBCI provider order management
speci c functionality.
Directory bin/ext-integration/hbci/saphbcicontractmgmtaddon
Requires
acceleratorstorefrontcommons
saphbcicontractmgmtfacades
New UIs:
My Account Area
The saphbcicontractmgmtaddon adds a corresponding new subsection Provider Contracts to the My Account area. This new subsection contains a Manage provider contracts
link. The provider contracts history page is accessible via both these links.
Note that the saphbcicontractmgmtaddon AddOn does not provide or check any speci c authorization requirements for accessing provider contracts. An authenticated B2B user
with permission to enter the My Account area implicitly also has permission to access and manage provider contracts of the corresponding B2B unit.
The contracts history page displays all the user's provider contracts (that is, the provider contracts that are assigned to the same B2B unit as the user). In order to see details for a
speci c provider contract, the user needs to click on the contract number.
The provider contract details page displays a speci c provider contract. There is exactly one contract item associated with a provider contract. If a provider contract is active and the
contract (item) is not canceled, then the user can choose to extend or terminate it.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 54/74
3/5/2020
The provider contract extension page enables the user to extend a speci c provider contract.
The SAP Commerce system receives the following information for the contract (item) in question from the CRM back end (synchronous communication):
Request a different extension period by choosing one from the period drop down list and clicking Apply. This triggers a new simulation in the CRM back end with the selected
extension period. The end user can then choose to either con rm, or to leave the page.
The provider contract termination page enables the user to terminate a speci c provider contract.
The SAP Commerce system receives the following information for the contract (item) in question from the CRM back end (synchronous communication):
The default requested contract end date for the contract item
Request a different termination date and clicking Apply. This triggers a new simulation in the CRM back end with the selected termination date. The end user can then choose to
either con rm, or to leave the page.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 55/74
3/5/2020
Contents
This section provides references for developers to the most interesting les, le locations and con gurations of the saphbcicontractmgmtaddon AddOn.
The AddOn accesses SAP Commerce Billingg contract order management functionality via the saphbcicontractmgmtfacades extension by its account provider contract page
controller.
JSP les
<dir>\acceleratoraddon\web\webroot\WEB-INF\views\responsive\pages\account
Tag les
<dir>\acceleratoraddon\web\webroot\WEB-INF\tags\responsive\account
Language-dependent texts
• <dir>\acceleratoraddon\web\webroot\WEB-INF\messages
<dir>\acceleratoraddon\web\webroot\_ui\responsive\common\css\ saphbcicontractmgmtaddon.css
Sample Code
<dir>\acceleratoraddon\web\src
com.sap.hybris.hbci.contract.addon.controllers.pages.AccountProviderContractPageController
com.sap.hybris.hbci.contract.addon.forms.validation.ExtensionPeriodValidator
com.sap.hybris.hbci.contract.addon.forms.validation.TerminationValidator
<dir>\resources\saphbcicontractmgmtaddon\web\spring\saphbcicontractmgmtaddon-web-spring.xml
ImpEx Files
The following ImpEx les contain the AddOn-speci c My Account area con gurations as well as the assignment of the content pages to the account page template:
<dir>\resources\saphbcicontractmgmtaddon\import\contentCatalogs\powertoolsContentCatalog
cms-content.imp
Sample Code
<dir>\src com.sap.hybris.hbci.saphbcicontractmgmtaddon.initialdata.setup.InitialDataSystemSetup
com.sap.hybris.hbci.saphbcicontractmgmtaddon.services.dataimport.impl.HbciContractAddOnSampleDataImportService <dir>\resources\saphbcicontractmgmtaddon-spring.xml
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 56/74
3/5/2020
Further Con guration
For a provider contract termination, the requested contract end date is sent by the user’s browser to the account provider contract controller. The string format expected (by the
controller) of this receiving date is de ned in the following con guration le:
<dir>\project.properties
1. 1.Ensure that saphbcicontractmgmtaddon along with its required extensions is added to your localextensions.xml le.
4. Start the SAP Commerce server and perform a platform update with the following options selected:
Localize types
saphbcicontractmgmtaddon
<mystorefrontextensionname>.additionalWebSpringConfigs.myaddon=classpath:/myaddon/web/spring/myaddon-web-spring.xml
Model Layer
Model Interceptors
Cockpit Beans
Validation Rules
Service Layer
Facade DTO
Facade Layer
CMS Components
Page Templates
JavaScript
CSS
Page Controllers
Tags
TLD
Filters
MVC Interceptors
Spring Security
Message Resources
Note
With respect to JavaScript there are two small snippets contained in providerContractExtension.jsp and providerContractTermination.jsp to trigger a speci c
form submit (con rmation), respectively.
Related Information
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 57/74
3/5/2020
Installing the Integration Package
Self-Services
With SAP Commerce Billing the customer can go into My Account to con gure certain aspects of the payment procedure and invoice management.
Customers can search for invoices created for them in the component SAP Convergent Invoicing and view the invoice pdf.
Customers can carry out the following actions as part of synchronous invoice management:
Related Information
Con guring Invoice Management
Payment Card Integration (B2C)
Note
The integration of a Payment Service Provider is not part of SAP Commerce Billing integration. It is mandatory to integrate a Payment Service Provider as part of an implementation
project. For testing purpose, mock services are available in ECP.
Related Information
Accelerator Payment Mock
CyberSource Con guration
Mocked Con guration
Checkout PCI Strategies
SAP CRM: Con guring Master Data Replication
B2C Scenario: Consumer Replication
Con guring Basic Settings for Data Replication
SAP CRM: Business Agreement
sapbusinessagreement Data Hub Extension
The payment card information is transferred to a Payment Service Provider (PSP). SAP Commerce receives a token, which is transferred to the backend. The payment card number is not
stored in the CRM backend.
The following diagram shows the steps involved in the process, as well as the interaction between SAP Commerce, the PSP, Data Hub and the CRM backend:
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 58/74
3/5/2020
Change card for existing contracts, that changes will be valid for all future processes like authorization or settlement processes for this business agreement;
As with the 'add new card' scenario, the payment card information is transferred to a Payment Service Provider (PSP). SAP Commerce receives a (new) token, which is transferred to the
backend. The payment card number is not stored in the CRM backend.
Choose the B2C scenario in the SAP Commerce Backoffice Administration Cockpit.
Decide whether to use hosted order pages (HOPs) or Silent Order Posts (SOPs).
2. Choose the store in question. On the Properties tab, go to the Websites section and double-click on the site in question.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 59/74
3/5/2020
With Hosted Order Page (HOP) integration, a secure page hosted by a third-party payment provider is used for collecting a customer's card details. Here, the payment card screen
is part of the PSP network.
With Silent Order Post (SOP) integration, a payment details form is provided that POSTs to an external service for creating the subscription. Here, the payment card elds are
integrated in the checkout process screens.
To nd out more about PCI strategies and the Accelerator Payment Mock, see the following related topics:
1. Set the PCI strategy for the PSP with the applicable property (in this example, hosted order pages are being used):
site.pci.strategy=HOP
hop.post.url=<Gateway url>
a. Create populators by inheriting AbstractRequestPopulator. Implement logic to ll elds required by the PSP.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 60/74
3/5/2020
b. Override the spring bean paymentDataConverter with custom populators for creating the subscription request.
a. Create populators by inheriting AbstractResultPopulator. Interpret the elds sent by PSP into CreateSubscriptionResult.
saphbcibusinessagreementservices
Extension saphbcibusinessagreementservices contains SAP Commerce Billing Commerce integration speci c services for update payment card scenarios.
Activation
Activate saphbcibusinessagreementservices to enhance the credit card scenarios. To use the extension, you need to be declare it in localextensions.xml.
DefaultHbciCustomerExportService
saphbcibusinessagreementfacades
Extension saphbcibusinessagreementfacades contains SAP Commerce Integration speci c facade for updating payment card. Their implementations include logic to populate
the payment subscription DTOs.
Activation
Activate saphbcibusinessagreementfacades to enhance the payment card scenarios. To use the extension, you need to declared it in localextensions.xml.
saphbcibusinessagreementaddon AddOn
The saphbcibusinessagreementaddon AddOn is a template which extends a target storefront with payment options functionality that is speci c to SAP Commerce Billing
integration.
The AddOn enhances the MyAccount area of the target store front with add or change payment options. It also provides new UIs for the checkout step Payment & Billing Address.
sapbusinessagreementaddon
acceleratorstorefrontcommons
saphbcibusinessagreementfacades
If you are installing SAP Commerce Billing for non-production purposes (for example evaluation or demo), the target storefront is yacceleratorstorefront for the electronics
store.
Enhancement of Payment Details under the My Account area for adding and editing credit cards.
Enhancement of the Payment & Billing Address step of checkout, so the webshop customer can select an existing card during checkout in a hosted order page (HOP) scenario.
New UIs:
Payment Options
Payment Details
The saphbcibusinessagreementaddon AddOn adds buttons Add Payment and Update Payment. Depending on system settings the user is then directed to payment card
maintenance either SOP or HOP based on the PCI strategy.
A user can add a new credit card or update an existing credit card.
Note
There is a limitation that a default card cannot be updated if multiple cards exist for an account.
The saphbcibusinessagreementaddon AddOn also provides the UI with the functionality needed to maintain a payment card with SOP as a part of the mock service.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 62/74
3/5/2020
A user can also select an existing address to easily populate the billing address as show below.
The saphbcibusinessagreementaddon AddOn enhances the Payment & Billing Address step the checkout to enable the webshop customer to reuse a payment card which is
stored under their account even in a HOP PCI strategy.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 63/74
3/5/2020
<dir>\acceleratoraddon\web\webroot\WEB-INF\views\responsive\pages\account
<dir>\acceleratoraddon\web\webroot\WEB-INF\views\responsive\pages\checkout\multi
Language-dependent texts
<dir>\acceleratoraddon\web\webroot\WEB-INF\messages
Display of the HOP page when Add Payment or Update Payment is clicked.
Display of the SOP page when Add Payment or Update Payment is clicked.
com.sap.hybris.hbci.businessagreement.addon.controllers.pages.checkout.steps.PaymentMethodCheckoutStepBuAgController
Method enterStep: Used to display the UI for selecting an existing payment card or adding a new one.
Method displayHopPage: Used to display the HOP page of the product search page.
com.sap.hybris.hbci.businessagreement.addon.validators.SilentOrderFormValidator
ImpEx Files
The following ImpEx les contain the AddOn-speci c Payment Details enhancement:
saphbcibusinessagreementaddon/resources/saphbcibusinessagreementaddon/import/contentCatalogs/electronicsContentCatalog/cms-
content.impex
saphbcibusinessagreementaddon/resources/saphbcibusinessagreementaddon/import/contentCatalogs/electronicsContentCatalog/cms-
responsive-content.impex
Javascript Files
The following Javascript le contains the AddOn-speci c Payment Details enhancement:
saphbcibusinessagreementaddon.js
Con guration
The following le contains con guration:
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 64/74
3/5/2020
resources/saphbcibusinessagreementaddon/web/spring/multi-step-checkout-config.xml
The checkout steps are altered to display the card selection screen for the HOP PCI strategy.
1. Ensure that the saphbcibusinessagreementaddon AddOn along with its required extensions are added to your localextensions.xml le.
Start the SAP Commerce server and perform a platform update with checkboxes marked as shown.
Related Information
Payment Card Integration (B2C)
Invoice Management
The invoice self-service allows web shop users to display their invoice history and to display individual invoices in Portable Document Format (PDF).
Note
Invoice management is exclusively integrated with invoice management of SAP Convergent Invoicing together with SAP FI-CA.
In SAP Convergent Invoicing, the invoicing documents are printed, as for other print processes, in Contract Accounts Receivable and Payable – with the Print Workbench. Invoicing
documents can be stored in an optical archive.
Only invoices stored in this way can be accessed and displayed in SAP Commerce.
B2B: Logged-on users synchronously retrieve invoices issued to the root B2B unit they belong.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 65/74
3/5/2020
Out of the box, invoices on the invoice history page can be sorted by invoice number, invoice date, due date, payment method or total amount.
If the invoice PDF does not (yet) exist, the customer is informed accordingly.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 66/74
3/5/2020
1. In Backoffice Administration Cockpit, choose SAP Integration SAP Base Store Con guration .
3. In eld RFC Con guration, enter the RFC destination of the system that runs the component SAP Convergent Invoicing where your invoices are managed.
In eld Creation Period (Number of Days), enter the time period you want to use to select invoices. Only invoices dated up to this number of days into the past are
selected from the ERP backend system.
In eld Max. Number of Results, enter the maximum number of invoices you want to select (0 = unlimited).
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 67/74
3/5/2020
In B2C scenarios, the sold-to party is the currently logged-on user as customer.
In B2B scenarios, the sold-to party is the root B2B unit of the user currently logged on. This B2B unit is determined by the SAP partner service of SAP Commerce extension
sapordermgmtb2bservices (which is one of the extensions required by saphbciinvoicemgmtservices).
The scenario (B2C or B2B) itself is determined by the SAP Commerce platform’s base site service, more precisely by the channel (which must be B2C or B2B) of the current base site of
the logged-on user’s session. Therefore, you need to maintain the correct channel indicator for a site in the Backoffice Administration Cockpit:
1. In Backoffice Administration Cockpit, choose SAP Integration SAP Base Store Con guration .
saphbciinvoicemgmtaddon
saphbciinvoicemgmtfacades
This extension provides the access point for the saphbciinvoicemgmtaddon’s page controller.
saphbciinvoicemgmtservices
This extension provides the sorting logic and delegates invoice selection and paging.
saphbciinvoicemgmtbol
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 68/74
3/5/2020
This extension integrates with the SAP ERP backend system for invoice selection.
saphbcicommon
saphbciinvoicemgmtbackoffice
Dependencies between the extensions are illustrated in the diagram following. The colors used for the various boxes have the following meaning:
Related Information
saphbciinvoicemgmtaddon AddOn
saphbciinvoicemgmtfacades Extension
saphbciinvoicemgmtservices Extension
saphbciinvoicemgmtbol Extension
saphbcicommon Extension
saphbciinvoicemgmtbackoffice Extension
saphbciinvoicemgmtbol Extension
The Business Object Layer (BOL) and backend implementation considers the back-office con gurations described in the saphbciinvoicemgmtbackoffice extension and fetches
invoices from a corresponding SAP ERP back-end system.
The following gure shows this implementation which consists mainly of InvoiceManagementImpl (the business object of BOL and backend integration) and
InvoiceManagementERPImpl (the back-end object of BOL).
BOL Layer
The InvoiceManagementERPImpl class implements access to the following remote function modules (from function group FKKINV_CRM_FCC):
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 69/74
3/5/2020
FKK_INV_CRM_INVDOC_SEL
FKK_INV_CRM_INVDOC_GET_PDF
An instance of InvoiceManagementImpl keeps invoices that were once retrieved for further access (see "saphbciinvoicemgmtbackoffice Extension"). This holds until the
user session is expired or the instance receives a refresh indicator from the service layer
sapHbciInvoiceMgmtRFCDestination
sapHbciInvoiceMgmtMaxHits
sapHbciInvoiceMgmtPeriodOfDays
The back-office con gurations described in "Con guring Invoice Management" are based on these item type attributes as well as the Spring con gurations below.
Source Code
<alias alias="sapHbciInvoiceManagementBO" name="sapHbciDefaultInvoiceManagementBO" />
<bean id="sapHbciDefaultInvoiceManagementBO" parent="sapCoreBusinessObject" scope="sapSession"
class="com.sap.hybris.hbci.saphbciinvoicemgmtbol.invoice.impl.InvoiceManagementImpl">
<property name="moduleConfigurationAccess" ref="sapHbciInvoiceManagementConfigurationAccess" />
<property name="backendType" value="#{baseStoreService.getCurrentBaseStore().getSAPConfiguration().getSapHbciInvoiceMgmtRFCDestination()?
</bean>
saphbciinvoicemgmtbol/resources/saphbciinvoicemgmtbol-be-spring.xml
Source Code
<alias alias="sapHbciInvoiceManagementBeERP" name="sapHbciDefaultInvoiceManagementBeERP" />
<bean id="sapHbciDefaultInvoiceManagementBeERP" parent="sapCoreBackendObjectJCo" scope="sapSession"
class="com.sap.hybris.hbci.saphbciinvoicemgmtbol.invoice.backend.impl.InvoiceManagementERPImpl">
<property name="moduleConfigurationAccess" ref="sapHbciInvoiceManagementConfigurationAccess" />
<!-- defaultConnectionName: JCoStateless inherited from parent sapCoreBackendObjectJCo -->
<property name="defaultDestinationName" value="#{baseStoreService.getCurrentBaseStore().getSAPConfiguration().getSapHbciInvoiceMgmtRFCDes
<property name="periodOfDays" value="#{baseStoreService.getCurrentBaseStore().getSAPConfiguration().getSapHbciInvoiceMgmtPeriodOfDays()}"
<property name="maxHits" value="#{baseStoreService.getCurrentBaseStore().getSAPConfiguration().getSapHbciInvoiceMgmtMaxHits()}" />
</bean>
saphbciinvoicemgmtbol/resources/saphbciinvoicemgmtbol-config-spring.xml
Source Code
<alias alias="sapHbciInvoiceManagementConfigurationAccess" name="sapHbciInvoiceManagementModuleConfiguration" />
<bean id="sapHbciInvoiceManagementModuleConfiguration" parent="sapCoreModuleConfigurationAccess">
<property name="moduleId" value="sapHbciInvoiceMgmt" />
</bean>
Related Information
saphbciinvoicemgmtbackoffice Extension
Con guring Invoice Management
saphbciinvoicemgmtservices Extension
The saphbciinvoicemgmtservices extension provides a sorting logic for paged invoice history and delegates the invoice retrieval to the saphbciinvoicemgmtbol extension
(and nally to an SAP ERP backend system).
Paging is outsourced to the saphbcicommon extension and fully reusable for other paged list scenarios as the type of elements to be paged is exchangeable (implemented by Java
generics).
For an invoice as a PDF, the service layer routes a byte array which represents the PDF fetched from an SAP ERP backend system.
The paging of retrieved invoices (i.e. InvoiceTransientModel instances) is handled by the DefaultPagedSearchService implementation. It requires a
SortCodeComparator and pageable data (received from the invoice history page controller through façade layer).
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 70/74
3/5/2020
Selected sort code (for example, sort descending by invoice number)
With this information, SearchPageData (introduced in commerceservices extension) are created for InvoiceTransientModel instances which represent the paged invoice
history.
invoice type (ascending); This is not shown on the user interface by the accelerator.
The availability of these sort codes for the user interface is con gurable in saphbciinvoicemgmtservices-spring.xml le in list
saphbciDefaultInvoiceHistorySortCodes.
With the out of the box con guration, invoices on the invoice history page can be sorted by the following:
invoice number
invoice date
due date
payment method
total amount
The HBCIDefaultBolInvoiceFacade collects various information from other services before the invoice retrieval is requested via the saphbciinvoicemgmtbol extension’s
InvoiceManagement interface:
BaseSiteService: Determines the B2C or B2B scenario for the current user session;
UserService: Determines the current user (and its customer ID for B2C scenario);
SapPartnerService: Retrieves the user’s root B2B unit in the B2B scenario;
saphbciinvoicemgmtfacades Extension
The saphbciinvoicemgmtfacades extension provides the functional access point for the saphbciinvoicemgmtaddon extenion’s InvoiceHistoryPageController.
This page controller (derived from AbstractSearchPageController) accesses invoice self-service functionality via the HBCIInvoiceFacade interface. The gure below
visualizes this association and depicts further relationships and dependencies.
The HBCIDefaultInvoiceFacade implementation retrieves a paged invoice history or a dedicated invoice PDF from the HBCIInvoiceService interface (in
saphbciinvoicemgmtservices extension).
For a paged invoice history, the service returns InvoiceTransientModel (generated from saphbcicommon-beans.xml) instances which need to be converted into
InvoiceHistoryData (generated from saphbciinvoicemgmtfacades-beans.xml) instances.
The HBCIDefaultInvoiceHistoryPopulator supports this conversion which is triggered via the PagedSearchService interface (in saphbcicommon). The
populator itself requires the PriceDataFactory (from commercefacades) for InvoiceHistoryData population.
saphbciinvoicemgmtaddon AddOn
The saphbciinvoicemgmtaddon extension contains sample content catalogs for power tools store as reference B2B accelerator site and electronics store as reference B2C
accelerator site.
The target storefronts enhanced by the AddOn are yb2bacceleratorstorefront for power tools store and yacceleratorstorefront for electronics store, respectively.
The saphbciinvoicemgmtaddon extension adjusts the following aspects of the target storefront:
Enhancement of the My Account area to access the invoice self-service via a corresponding Invoice History entry;
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 71/74
3/5/2020
Display of invoices in portable document format (PDF);
AddOn De nition
Name saphbciinvoicemgmtaddon
Description This AddOn is a template which extends a target storefront with HBCI self-service functionality.
Directory bin/ext-integration/hbci/saphbciinvoicemgmtaddon
Requires
acceleratorstorefrontcommons
addonsupport
saphbciinvoicemgmtfacades
Contents
This section provides references for developers to the most interesting les, le locations and con gurations of the saphbciinvoicemgmtaddon extension.
<addon-dir>/acceleratoraddon/web/webroot/
WEB-INF/views/responsive/pages/account/invoiceHistory.jsp
<addon-dir>/acceleratoraddon/web/webroot/
WEB-INF/tags/responsive/invoiceTable.tag
<addon-dir>/acceleratoraddon/web/webroot/WEB-INF/tags/messages
<addon-dir>/acceleratoraddon/web/webroot/
WEB-INF/_ui-src/responsive/less/saphbciinvoicemgmtaddon.less
<addon-dir>/acceleratoraddon/web/webroot/
_ui/responsive/common/js/saphbciinvoicemgmtaddon.js
Page controller
<addon-dir>/acceleratoraddon/web/src/com/sap/hybris/hbci/
saphbciinvoicemgmtaddon/controllers/pages/InvoiceHistoryPageController.java
<addon-dir>/resources/saphbciinvoicemgmtaddon/import
/contentCatalogs/electronicsContentCatalog
<addon-dir>/resources/saphbciinvoicemgmtaddon/import
/contentCatalogs/powertoolsContentCatalog
<addon-dir>/src/com/sap/hybris/hbci/saphbciinvoicemgmtaddon/
initialdata/setup/InitialDataSystemSetup.java
<addon-dir>/src/com/sap/hybris/hbci/saphbciinvoicemgmtaddon/
services/dataimport/impl/HBCIAddOnSampleDataImportService.java
<<addon-dir>/resources/saphbciinvoicemgmtaddon-spring.xml
<addon-dir>/resources/saphbciinvoicemgmtaddon/web/spring
saphbciinvoicemgmtaddon-web-spring.xml
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 72/74
3/5/2020
ImpEx Con guration Scripts
Model Layer
Model Interceptors
Cockpit Beans
Validation Rules
Service Layer
Facade DTO
Facade Layer
CMS Components
Page Templates
JavaScript
CSS
Page Controllers
Tags
TLD
Filters
MVC Interceptors
Spring Security
Message Resources
Sample Code
ant addoninstall -Daddonnames="saphbciinvoicemgmtaddon"
-DaddonStorefront.yacceleratorstorefront="yacceleratorstorefront, yb2bacceleratorstorefront"
4. Start the SAP Commerce server and perform a platform update with the following options selected:
Localize types
saphbciinvoicemgmtaddon
Note
Out of the box, the AddOn contains content catalogs for a power tools store and an electronics store.
saphbciinvoicemgmtbackoffice Extension
Backoffice Administration Cockpit con gurations for invoice self-services are provided by the saphbciinvoicemgmtbackoffice extension.
For information on the con guration steps needed in the Backoffice Administration Cockpit, see "Con guring Invoice Management".
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 73/74
3/5/2020
Related Information
Con guring Invoice Management
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=21802335&topics=d7a5c661c9f64a08bc42d20e1e… 74/74