In a world full of promotions in every shape and size, consistency is the key to a seamless buying experience for the consumer. With SAP Omnichannel Promotion Pricing, SAP offers exactly that by ensuring consistent pricing across sales channel applications. You can define any number of promotional rules using a variety of triggers and rewards based on which the Calculation service determines the effective sales prices in the respective customer context.
In this blog, we will discuss how you can facilitate the fetching of merchandise hierarchy nodes, which are collections of items with similar properties, from SAP S/4HANA to the Calculation service and their validation.
Let’s begin with setting up the cloud integration package required to facilitate the communication between SAP S/4HANA and SAP Omnichannel Promotion Pricing.
Prerequisites
Procedure
After completing these steps, you are now able to successfully use the new cloud integration package.
I. Integration Flow for Fetching Merchandise Hierarchy Nodes
The ‘Fetch Merchandise Hierarchy Nodes from SAP S4HANA’ integration flow can be used to retrieve data from a back-end system. Let’s take a look at the procedure to configure the integration flow.
Note: You must ensure that the field CSRF Protected is left unselected. As GET requests are to be used for requests that do not change state, they do not need CSRF tokens.
Note: Create two .xsd files on your local computer using the following code snippets and upload them to the integration flow.
Source File: oppsui_request.xsd
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="OPPSUiMerchandiseHierarchyRequest"> <xs:complexType> <xs:sequence> <xs:element type="xs:byte" name="HierarchyId"/> <xs:element type="xs:string" name="HierarchyName" minOccurs="0"/> <xs:element type="xs:string" name="SearchValue" minOccurs="0"/> <xs:element type="xs:string" name="QualifierId" minOccurs="0"/> <xs:element type="xs:string" name="QualifierName" minOccurs="0"/> <xs:element type="xs:string" name="sap-language" minOccurs="0"/> <xs:element type="xs:string" name="SkipValue" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
Target File: s4_request.xsd
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Z_MERCHANDISE_HIERARCHY"> <xs:complexType> <xs:sequence> <xs:element type="xs:byte" name="HIERARCHY_ID" minOccurs="0"/> <xs:element type="xs:string" name="HIERARCHY_NAME" minOccurs="0"/> <xs:element type="xs:string" name="SEARCH_VALUE" minOccurs="0"/> <xs:element type="xs:string" name="QUALIFIER_ID" minOccurs="0"/> <xs:element type="xs:string" name="QUALIFIER_NAME" minOccurs="0"/> <xs:element type="xs:string" name="DESCR_LANG" minOccurs="0"/> <xs:element type="xs:string" name="HIERACHY_MAX" minOccurs="0"/> <xs:element type="xs:string" name="SKIP_VALUE" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element>
Note: The destination name should be an exact match of that entered in CPI space.
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <!-- identity template --> <xsl:template match="node() | @*"> <xsl:copy> <xsl:apply-templates select="node() | @*" /> </xsl:copy> </xsl:template> <!-- template for the document element --> <xsl:template match="/*"> <xsl:apply-templates select="node()" /> </xsl:template> </xsl:stylesheet>
Source XSD: s4_response.xsd
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Z_HIERARCHY_RETURN"> <xs:complexType> <xs:sequence> <xs:element name="item" maxOccurs="unbounded" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element type="xs:string" name="QUAL_ID"/> <xs:element type="xs:string" name="QUAL_NAME"/> <xs:element type="xs:string" name="HIER_ID"/> <xs:element type="xs:string" name="HIER_NAME"/> <xs:element type="xs:string" name="HIER_ID_SUB"/> <xs:element type="xs:string" name="HIER_NAME_SUB"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
Note: You are free to use any element name in the source XSDs. Make sure that the RFC response name matches the target element name and the parameters with the element type names.
Target XSD: oppsui_response.xsd
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="MerchandiseHierarchies"> <xs:complexType> <xs:sequence> <xs:element name="OPPSUiMerchandiseHierarchyResponse" maxOccurs="unbounded" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element type="xs:string" name="QUALID" minOccurs="0"/> <xs:element type="xs:string" name="QUALNAME" minOccurs="0"/> <xs:element type="xs:string" name="HIERID" minOccurs="0"/> <xs:element type="xs:string" name="HIERNAME" minOccurs="0"/> <xs:element type="xs:string" name="HIERID_SUB" minOccurs="0"/> <xs:element type="xs:string" name="HIERNAME_SUB" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
The final integration flow should look like this:
II. Integration Flow for Validating Merchandise Hierarchy Nodes
The ‘Validate Merchandise Hierarchy Nodes in SAP S4HANA’ integration flow can be used to verify whether the merchandise hierarchy nodes entered by the user exist in the back-end system.
Note: You must ensure that the field CSRF Protected is left unselected. As GET requests are to be used for requests that do not change state, they do not need CSRF tokens.
Field | Value |
Expression Type | XPath |
XPath Expression | /OPPSUIMerchandiseHierarchyValidationRequest/merchandiseHierarchy |
Parallel Processing | Yes |
Number of Concurrent Processes | 50 |
Timeout (in s) | 300 |
Source XSD: oppsui_request.xsd
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="merchandiseHierarchy"> <xs:complexType> <xs:sequence> <xs:element type="xs:byte" name="HierarchyId" minOccurs="0"/> <xs:element type="xs:string" name="HierarchyName" minOccurs="0"/> <xs:element type="xs:string" name="SearchValue" minOccurs="0"/> <xs:element type="xs:string" name="QualifierId" minOccurs="0"/> <xs:element type="xs:string" name="QualifierName" minOccurs="0"/> <xs:element type="xs:string" name="sap-language" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
Target XSD: s4_request.xsd
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Z_MERCHANDISE_HIERARCHY"> <xs:complexType> <xs:sequence> <xs:element type="xs:byte" name="HIERARCHY_ID" minOccurs="0"/> <xs:element type="xs:string" name="HIERARCHY_NAME" minOccurs="0"/> <xs:element type="xs:string" name="SEARCH_VALUE" minOccurs="0" /> <xs:element type="xs:string" name="QUALIFIER_ID" minOccurs="0"/> <xs:element type="xs:string" name="QUALIFIER_NAME" minOccurs="0"/> <xs:element type="xs:string" name="DESCR_LANG" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
Note: You are free to use any element name in the target XSD. While setting up the RFC, make sure that its name matches the target element name and the parameters with the element type names.
Name | Field | Value |
HierarchyId | Action | Create |
Type | XPath | |
Data Type | Java.lang.String | |
Value | //HIERARCHY_ID | |
QualifierId | Action | Create |
Type | XPath | |
Data Type | Java.lang.String | |
Value | //QUALIFIER_ID |
Note: The destination name should be an exact match of that entered in CPI space.
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <!-- identity template --> <xsl:template match="node() | @*"> <xsl:copy> <xsl:apply-templates select="node() | @*" /> </xsl:copy> </xsl:template> <!-- template for the document element --> <xsl:template match="/*"> <xsl:apply-templates select="node()" /> </xsl:template>
Source XSD: s4_response.xsd
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Z_HIERARCHY_RETURN"> <xs:complexType> <xs:sequence> <xs:element name="item" maxOccurs="unbounded" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element type="xs:string" name="QUAL_ID"/> <xs:element type="xs:string" name="QUAL_NAME"/> <xs:element type="xs:string" name="HIER_ID"/> <xs:element type="xs:string" name="HIER_NAME"/> <xs:element type="xs:string" name="HIER_ID_SUB"/> <xs:element type="xs:string" name="HIER_NAME_SUB"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
Note: You are free to use any element name in the source XSDs. Make sure that the RFC response name matches the target element name and the parameters with the element type names.
Target XSD: oppsui_response.xsd
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="MerchandiseHierarchies"> <xs:complexType> <xs:sequence> <xs:element name="OPPSUIMerchandiseHierarchyValidationResponse" maxOccurs="unbounded" minOccurs="0"> <xs:complexType> <xs:sequence> <xs:element type="xs:string" name="QUALID" minOccurs="0"/> <xs:element type="xs:string" name="QUALNAME" minOccurs="0"/> <xs:element type="xs:string" name="HIERID" minOccurs="0"/> <xs:element type="xs:string" name="HIERNAME" minOccurs="0"/> <xs:element type="xs:string" name="HIERID_SUB" minOccurs="0"/> <xs:element type="xs:string" name="HIERNAME_SUB" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes" /> <xsl:strip-space elements="*" /> <xsl:param name ="QualifierId" /> <xsl:param name ="HierarchyId" /> <xsl:param name ="isPresent" /> <xsl:template match="/MerchandiseHierarchies"> <MerchandiseHierarchies> <xsl:if test="OPPSUIMerchandiseHierarchyValidationResponse"> <OPPSUIMerchandiseHierarchyValidationResponse> <qualifierId><xsl:value-of select="$QualifierId"/></qualifierId> <hierarchyId><xsl:value-of select="$HierarchyId"/></hierarchyId> <isPresent>true</isPresent> </OPPSUIMerchandiseHierarchyValidationResponse> </xsl:if> <xsl:if test="not(OPPSUIMerchandiseHierarchyValidationResponse)"> <OPPSUIMerchandiseHierarchyValidationResponse> <qualifierId><xsl:value-of select="$QualifierId"/></qualifierId> <hierarchyId><xsl:value-of select="$HierarchyId"/></hierarchyId> <isPresent>false</isPresent> </OPPSUIMerchandiseHierarchyValidationResponse> </xsl:if> </MerchandiseHierarchies> </xsl:template> </xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <!-- identity template --> <xsl:template match="node() | @*"> <xsl:copy> <xsl:apply-templates select="node() | @*" /> </xsl:copy> </xsl:template> <!-- template for the document element --> <xsl:template match="/*"> <MerchandiseHierarchies> <xsl:apply-templates select="node()" /> </MerchandiseHierarchies> </xsl:template> </xsl:stylesheet>
The final integration flow should look like this:
To successfully use merchandise hierarchy nodes in a promotional rule, a user of SAP Omnichannel Promotion Pricing must set up a remote function call (RFC) to provide the required master data. When configured properly, it can be used to fetch and validate the merchandise hierarchy nodes.
You must include the following entry and response parameters in the RFC to get the appropriate result which is in the form of a table:
Entry Parameter | Response Parameter |
Search Value Qualifier Identifier Hierarchy Identifier Hierarchy Name Description Language Hierarchy Max | Qualifier Identifier Qualifier Name Hierarchy Identifier Hierarchy Name Hierarchy Identifier Subnode Hierarchy Name Subnode |
Note: While the hierarchy qualifier name helps you understand which hierarchy the node belongs to, the hierarchy identifier subnode and hierarchy name subnode are filled only if the merchandise hierarchy node has a dependent assigned to it.
That’s All Folks!
On successful completion of these steps, you are now able to fetch and validate merchandise hierarchy nodes in a promotional rule from SAP S/4HANA to SAP Omnichannel Promotion Pricing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
22 | |
14 | |
11 | |
11 | |
9 | |
8 | |
7 | |
7 | |
7 | |
6 |