https://raw.githubusercontent.com/ajmaradiaga/feeds/main/scmt/topics/Cloud-Integration-blog-posts.xmlSAP Community - Cloud Integration2024-09-01T02:00:12.121336+00:00python-feedgenCloud Integration blog posts in SAP Communityhttps://community.sap.com/t5/technology-blogs-by-sap/create-datatype-and-message-type-artifact-in-cloud-integration-capability/ba-p/13709335Create DataType and Message Type artifact in Cloud Integration capability of SAP Integration Suite2024-07-10T10:43:24.414000+02:00radhika_javvajihttps://community.sap.com/t5/user/viewprofilepage/user-id/272095<P><STRONG>Introduction</STRONG></P><P>SAP Cloud Integration version 6.54.xx comes with new feature, where in one can create Datatype and Messagetype as reusable design time artifacts in Cloud Integration capability of SAP Integration Suite</P><P>This feature is available only in SAP Integration Suite <EM>standard</EM> and <EM>above</EM> service plans.</P><P>SAP Cloud Integration version 6.54.xx software update is planned on mid of July 2024 (date and time subjected to change).</P><P><STRONG>Create DataType :</STRONG></P><P>1. Open the Integration Suite Tenant and navigate to Design -->Integrations and API's</P><P>2. Create an Integration Package or open an existing one.</P><P>3. Navigate to the Artifacts tab and click on Edit in the top right corner</P><P style=" padding-left : 30px; "><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="radhika_javvaji_1-1718115364468.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/121979iE5C4D4DED4752EE7/image-size/large?v=v2&px=999" role="button" title="radhika_javvaji_1-1718115364468.png" alt="radhika_javvaji_1-1718115364468.png" /></span></P><P>4. Click on Add drop down and select Data Type from the list</P><P style=" padding-left : 30px; "><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="radhika_javvaji_1-1718117936129.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/121991i89CC6C936E816990/image-size/large?v=v2&px=999" role="button" title="radhika_javvaji_1-1718117936129.png" alt="radhika_javvaji_1-1718117936129.png" /></span></P><P>5. Add Data Type dialog is displayed with Create (radio button) selected by default.</P><P style=" padding-left : 30px; "><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="radhika_javvaji_2-1717595353958.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/119810iBC2C4075C93ABAB6/image-size/large?v=v2&px=999" role="button" title="radhika_javvaji_2-1717595353958.png" alt="radhika_javvaji_2-1717595353958.png" /></span></P><P>6. Enter the values for the fields Name, ID,Target Namespace, Description ,select the category - Simple Type(selected by default) or Complex Type for the Datatype you want to create and click on Add or Add and Open in Editor</P><P>7. On Click of Add, the Data Type artifact with the provided name gets created and is listed in the Artifacts list page</P><P>8. On Click of Add and Open in Editor, the Data Type artifact gets created with the provided name and the artifact gets opened in the Editor in display mode. </P><P>9. The Editor contains three tabs : Overview,Structure and XSD.The Structure is shown by default when the artifact is opened. It displays the structure of the datatype in a tree table with the following columns :</P><UL><LI>Name : Contains the Name of the node(element or attribute).For Root node the name is same as the name of the Datatype and it cannot be edited.</LI><LI>Category : <SPAN>This column shows whether the root element has subnodes or not . For root node it is either Simple type or Complex Type and for submodes it can be either Element or Attribute. You cannot change values in this column.</SPAN></LI><LI>Type: This column displays the type with which the node is defined.<SPAN>Here you select a built-in data type or reference to an existing data type for an element or attribute. You must specify a type for attributes.</SPAN></LI><LI>Occurrence: <SPAN>Determines how often elements occur.For attributes, you can determine whether the attribute is </SPAN><I>optional</I><SPAN> or </SPAN><I>required</I><SPAN>.</SPAN></LI><LI>Restrictions : This column displays the facets (if any) defined incase the node is defined by a built-in primitive type or a user defined Simple type Datatype </LI></UL><P style=" padding-left : 30px; "><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="radhika_javvaji_2-1718117008118.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/121987i2306E4004FCB4C68/image-size/large?v=v2&px=999" role="button" title="radhika_javvaji_2-1718117008118.png" alt="radhika_javvaji_2-1718117008118.png" /></span></P><P>9. Switch to edit mode and to define/build the Structure of the Datatype. On selecting the first row(rootnode),the Add drop down in the table header gets enabled (for category complex type) and also the details of the row are displayed in the right side section of the editor.</P><P style=" padding-left : 30px; "><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="radhika_javvaji_0-1718118534729.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/121996i42AF4C60A663828B/image-size/large?v=v2&px=999" role="button" title="radhika_javvaji_0-1718118534729.png" alt="radhika_javvaji_0-1718118534729.png" /></span></P><P>10. Simple Type Data Type :</P><UL><LI>No child nodes can be added </LI><LI>Root node is defined by string built-in primitive datatype.</LI><LI>Click on the root node and the Properties sheet which contains the details of the node selected is displayed on the right side of the editor. In Edit mode ,user can edit the Type ,define the restrictions applicable for the Type selected.</LI></UL><P style=" padding-left : 30px; "><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="radhika_javvaji_1-1718118704320.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/122017i06FD85443D20533D/image-size/large?v=v2&px=999" role="button" title="radhika_javvaji_1-1718118704320.png" alt="radhika_javvaji_1-1718118704320.png" /></span></P><P>11.Complex Type Data Type :</P><P style=" padding-left : 30px; "><SPAN>To add child nodes:</SPAN></P><UL><LI><SPAN>Click on the root node and the Add drop down in the table header gets enabled.</SPAN></LI></UL><P><SPAN> Add -->Element to add child element node</SPAN></P><P><SPAN> Add -->Attribute to add attribute node</SPAN></P><P><SPAN> Add -->Rows to add multiple Elements/Attributes</SPAN></P><P style=" padding-left : 30px; "><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="radhika_javvaji_2-1718118783167.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/122018i6783C24482D48322/image-size/large?v=v2&px=999" role="button" title="radhika_javvaji_2-1718118783167.png" alt="radhika_javvaji_2-1718118783167.png" /></span></SPAN></P><UL><LI><SPAN>Click on the newly added node and define the details in the Properties sheet</SPAN><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="radhika_javvaji_4-1718119150167.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/122023iEFAF233E86D9161B/image-size/large?v=v2&px=999" role="button" title="radhika_javvaji_4-1718119150167.png" alt="radhika_javvaji_4-1718119150167.png" /></span><P> </P></LI></UL><P>12. Once the Structure is defined,Click on Save to save the artifact as Draft, Save as Version to save the artifact as versioned artifact.</P><P>13. XSD tab displays the read only view of the xsd schema of the Datatype artifact</P><P style=" padding-left : 30px; "><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="radhika_javvaji_5-1718119368848.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/122024i3CEA676E0E671376/image-size/large?v=v2&px=999" role="button" title="radhika_javvaji_5-1718119368848.png" alt="radhika_javvaji_5-1718119368848.png" /></span></P><P><STRONG>Create MessageType:</STRONG></P><P>1. Open the Integration Suite Tenant and navigate to Design -->Integrations and API's</P><P>2. Create an Integration Package or open an existing one.</P><P>3. Navigate to the Artifacts tab and click on Edit in the top right corner </P><P>4. Click on Add drop down and select Message Type from the list </P><P style=" padding-left : 30px; "><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="radhika_javvaji_0-1720598748201.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/134829iD9A9CFE0DBB41DD0/image-size/large?v=v2&px=999" role="button" title="radhika_javvaji_0-1720598748201.png" alt="radhika_javvaji_0-1720598748201.png" /></span></P><P>5. Add Message Type dialog is opened</P><P style=" padding-left : 30px; "><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="radhika_javvaji_1-1720596724096.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/134738iFD929C6EE7A6933A/image-size/large?v=v2&px=999" role="button" title="radhika_javvaji_1-1720596724096.png" alt="radhika_javvaji_1-1720596724096.png" /></span></P><P>6.Enter the values for the fields Name, ID, XMLNamespace, Datatype to be Used, Description, and click on Add or Add and Open in Editor</P><P>7. On Click of Add, Message Type artifact gets created and is listed in the Artifacts list page</P><P>8.On Click of Add and Open in Editor, MessageType artifact gets created and the artifact gets opened in the DataType Editor with Structure tab loaded by default in non-edit mode . The rootnode Name would be same as the Message Type name ,Category as Element and Type as Data Type Used (if selected in the Add Message Type dialog)</P><P style=" padding-left : 30px; "><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="radhika_javvaji_2-1720597738287.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/134786iEB833C3DA3FCB2FF/image-size/large?v=v2&px=999" role="button" title="radhika_javvaji_2-1720597738287.png" alt="radhika_javvaji_2-1720597738287.png" /></span></P><P>9. Overview tab in Edit mode is as shown below :</P><P style=" padding-left : 30px; "><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="radhika_javvaji_3-1720597940239.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/134799iAE271A5E0D54D696/image-size/large?v=v2&px=999" role="button" title="radhika_javvaji_3-1720597940239.png" alt="radhika_javvaji_3-1720597940239.png" /></span></P><P>10 XSD tab :</P><P style=" padding-left : 30px; "><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="radhika_javvaji_4-1720598053624.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/134802i75A3AA88B43BE7A6/image-size/large?v=v2&px=999" role="button" title="radhika_javvaji_4-1720598053624.png" alt="radhika_javvaji_4-1720598053624.png" /></span></P><P>11. Datatype Used to create a Message type can be changed in Overview tab or in Structure tab. Switch to edit mode and select the root node in the Structure tab.The properties sheet gets displayed on the right side of the page with Datatype Used field as editable.</P><P>12. No other nodes(child nodes) are editable in the Message Type artifact.</P><P> </P>2024-07-10T10:43:24.414000+02:00https://community.sap.com/t5/technology-blogs-by-sap/latest-pipeline-concept-enhancements-custom-error-handling-and-others/ba-p/13757664Latest Pipeline Concept enhancements: Custom error handling and others2024-07-11T10:14:27.850000+02:00alex_bundschuhhttps://community.sap.com/t5/user/viewprofilepage/user-id/45178<P>We have lately shipped a new version of the <A href="https://community.sap.com/t5/technology-blogs-by-sap/introducing-the-new-pipeline-concept-in-cloud-integration/ba-p/13639651" target="_blank">Pipeline Concept</A> package on the SAP Business Accelerator Hub based on customer and partner feedback, this is now version 1.0.5. The package can be accessed from <A href="https://hub.sap.com/package/PIPipelineGenericIntegrationFlows/integrationflow" target="_blank" rel="noopener noreferrer">here</A>. If you have already copied the package to your workspace in your SAP Integration Suite tenant, you can simply run the update of the package to be able to use the latest features.</P><P>As part of the package, we have now added a change list which allows you to see all increments that we have shipped so far. In the latest version, we have delivered the following:</P><UL><LI>Extension for custom error handling</LI><LI>In generic IDoc inbound processing flow, display list of IDoc numbers in case of IDoc bulk messages</LI><LI>For IDoc inbound, sender interface is calculated as a combination of MESTYP, IDOCTYP and CIMTYP</LI><LI>Supporting test mode via testMode header in the allowed headers configuration</LI><LI>In standard error handling, copied messages from the dead letter queue are switched to DEBUG log level</LI></UL><P>The <STRONG>custom error handling</STRONG> extension is a sort of customer exit which allows you to implement your own error handling in a separate integration flow which is then called via ProcessDirect instead of the standard error handling if the standard error handling doesn't meet your requirements. This way you can customize the pipeline processing without changing the generic integration flows that we ship as part of the pipeline concept. For more details, see <A href="https://help.sap.com/docs/MIGRATION_GUIDE_PO/90c8ad90cb684ee5979856093efe7462/ed9b82cb928049e6990a4d784aa6aac7.html" target="_blank" rel="noopener noreferrer">Monitoring and Error Handling in the Pipeline Concept</A>.</P><P>For improved <STRONG>monitoring of IDoc bulk messages</STRONG>, all IDoc numbers are stored in a custom header property. This allows you to search the message processing logs in the message monitoring based on a particular IDoc number. Furthermore we have revised the <STRONG>sender interface for IDoc messages</STRONG>. Before it contained the message type only, now it's a combination of the message type, the IDoc type and a potential IDoc extension which brings you more flexibility in setting up your IDoc scenarios. See <A href="https://help.sap.com/docs/MIGRATION_GUIDE_PO/90c8ad90cb684ee5979856093efe7462/1606af9b55bf4391bea01d2f7ee112af.html" target="_blank" rel="noopener noreferrer">Special Cases</A>.</P><P>If you like to run your integration scenarios using a regression test tool, you may benefit from the <STRONG>test mode</STRONG> flag. This is simply a header which is passed through the whole sequence of pipelines. Depending of your test case setup you may then pass the test message to a virtualized or mocked receiver instead of to the actual receiver. By the way, our partners providing regression test tools already support the pipeline concept in their tools. See <A href="https://help.sap.com/docs/MIGRATION_GUIDE_PO/90c8ad90cb684ee5979856093efe7462/e3735695d87c421ea0fb862e02c0f668.html" target="_blank" rel="noopener noreferrer">Testing the Pipeline</A>.</P><P>We are currently working on the next increment. For the test flag for instance we plan to extend the generic flows so that test messages which go into an error won't be restarted. Furthermore, we plan to extend the partner directory approach that is used to dynamically configure the runtime behavior. In some cases, the partner ID which is limited to 60 chars might not be sufficient, so we need to react on this. Furthermore, we like to provide you the option to use alternative partners which provides you more flexibility in setting up your integration scenarios, e.g., with this, sender wildcard scenarios can be easily setup.</P><P>So, stay tuned. And if you have further ideas, requirements, feedback feel free to reach out to me or simply leave a comment.</P><P> </P><P> </P><P> </P><P> </P>2024-07-11T10:14:27.850000+02:00https://community.sap.com/t5/technology-blogs-by-members/netsuite-adapter-for-sap-integration-suite/ba-p/13756567NetSuite Adapter for SAP Integration Suite2024-07-12T15:37:03.059000+02:00sswatihttps://community.sap.com/t5/user/viewprofilepage/user-id/312844<P>SAP announced the NetSuite adapter for Integration Suite this month. For those customers using NetSuite ERP, the NetSuite adapter for SAP Integration Suite is the ideal solution to enable fast and robust integrations of NetSuite in your business processes.</P><P>You can now seamlessly integrate data from diverse sources into the NetSuite ERP platform and elevate your organization’s efficiency by reducing efforts to create a listed set of integration workflows with the NetSuite adapter.</P><H2 id="toc-hId-1019427872">What is NetSuite?</H2><P>NetSuite is an ERP system; with multi-suite features, it's an extensive business management platform designed to handle critical functions like sales, marketing, finance, accounting, inventory management, procurement, and more.</P><P>NetSuite’s centralized data accessibility ensures seamless operations across different functions and locations. It provides invaluable operational insights, reporting, and analytics, enhancing financial visibility and decision-making.</P><H2 id="toc-hId-822914367"><STRONG>What is the NetSuite Adapter?</STRONG></H2><P>With the NetSuite adapter, you have the capability to establish a connection with the NetSuite application and execute a variety of operations with different features.</P><H2 id="toc-hId-626400862">Key Features</H2><UL><LI><STRONG>Support for multiple API versions</STRONG>: NetSuite supports multiple API versions with an editable API version field enabling users to input the latest supported version.</LI><LI><STRONG>Secure authentication based on Tokens</STRONG>: The NetSuite adapter supports the Token-Based Authentication (TBA) mechanism which increases overall system security. Every call between NetSuite and SAP Cloud Integration is secured by Tokens.</LI><LI><STRONG>Support for multiple NetSuite operations</STRONG>: The NetSuite adapter supports various operations like Add, Get, Delete, Async Add List, etc.</LI><LI><STRONG>Dynamic configuration with headers and properties</STRONG>: Assigning dynamic values to different properties allows enhanced flexibility to your integration flows. You can also refer to dynamic parameters using SAP Cloud Integration exchange headers and properties. </LI><LI><STRONG>Processing more than one record at a time</STRONG>: Some operations can be performed on one or more new instances of a record in NetSuite. As an example, the <STRONG>addlist</STRONG> operation can be used to add one or more new instances of a record to NetSuite.</LI><LI><STRONG>Processing more than one record of data asynchronously</STRONG>: Some operations can be performed on one or more new instances of a record in NetSuite in an asynchronous manner. In general, for asynchronous operations, bulk records are sent to NetSuite without the need to wait for a response.</LI><LI><STRONG>XSD Generator</STRONG>: To help speed up the integration, an XSD generator in the form of an Eclipse Plug-in is provided alongside the adapter. With this Eclipse Plug-in/Workbench, it is possible to generate an XSD which includes the structure of an Account Record. The generated XSD can then be imported into Cloud Integration and used for mapping purposes.</LI><LI><STRONG>Full integration support for Custom Records and Fields</STRONG>: In addition to supporting all the standard NetSuite Records (or entities), the Adapter integrates with all the Custom Objects in NetSuite.</LI></UL><H2 id="toc-hId-429887357">How does the adapter work?</H2><P>NetSuite Adapter allows you to perform various functions related to finance, accounting, inventory management, etc. Let’s look at a simple operation <STRONG>get</STRONG> an employee in NetSuite using the NetSuite Adapter for SAP Integration Suite.</P><H3 id="toc-hId-362456571"><SPAN>Get an Employee in NetSuite</SPAN></H3><P>Before we begin, it is assumed that employee type records are available in NetSuite for querying. Our example illustrates how the NetSuite Adapter allows querying to get an employee. The process begins with a client initiating an HTTPS request to an endpoint for retrieving employee information from NetSuite.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sswati_0-1720596190438.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/134721iFE8B7E48668B4416/image-size/large?v=v2&px=999" role="button" title="sswati_0-1720596190438.png" alt="sswati_0-1720596190438.png" /></span></P><P> </P><H3 id="toc-hId-165943066">Connect to NetSuite</H3><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sswati_1-1720596190452.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/134723iA3C7548D49CDB03F/image-size/large?v=v2&px=999" role="button" title="sswati_1-1720596190452.png" alt="sswati_1-1720596190452.png" /></span></P><P> </P><TABLE><TBODY><TR><TD><P><STRONG>Field</STRONG></P></TD><TD><P><STRONG>Description</STRONG></P></TD></TR><TR><TD><P>Address</P></TD><TD><P>Specify the address of NetSuite to be used for the connection. This address typically includes your NetSuite Account ID. NetSuite URLs often follow the pattern: https://<accountid>.suitetalk.api.netsuite.com.<BR /><BR />Example: <A href="https://12345-sb1.suitetalk.api.netsuite.com" target="_blank" rel="noopener nofollow noreferrer">https://12345-sb1.suitetalk.api.netsuite.com</A></P></TD></TR><TR><TD><P>Account ID</P></TD><TD><P>Specify the Account ID to be used for the connection. To find the account ID in NetSuite, you can usually locate it in the account's URL when logged in. Additionally, it might be available in the NetSuite account settings or administration section.</P><P>Example: 1112711_SB1</P></TD></TR><TR><TD><P>Authentication</P></TD><TD><P>Select your Authentication Mechanism. Currently, only the Token-Based Authentication (TBA) is supported.</P></TD></TR><TR><TD><P>Consumer Credentials Alias</P></TD><TD><P>This field should refer to a security material (of type User Credentials). This User Credential should include both Consumer Key (as username) and Consumer Secret (as password).</P></TD></TR><TR><TD><P>Token Credentials Alias</P></TD><TD><P>This field should refer to a security material (of type User Credentials). This User Credential should include both Token ID (as username) and Token Secret (as password).</P></TD></TR><TR><TD><P>Timeout (in ms)</P></TD><TD><P>Specify the maximum waiting time (in milliseconds) while establishing a connection with NetSuite. The default Timeout is 60000 ms.</P></TD></TR></TBODY></TABLE><P><SPAN> </SPAN></P><H3 id="toc-hId--30570439">Prepare Request Body and Mapping</H3><P>You can use a content modifier to ensure that the request payload includes all the necessary parameters NetSuite requires for querying employee data.</P><UL><LI>The message body should include the <STRONG>internal ID/external ID</STRONG> of the employee.<SPAN><BR /></SPAN><STRONG>Note</STRONG>: For more information about <STRONG>internal ID/external ID</STRONG>, see <SPAN><A href="https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_N3432681.html" target="_blank" rel="noopener nofollow noreferrer">NetSuite documentation</A></SPAN>.</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sswati_2-1720596190464.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/134722i0CE52B29C494A45C/image-size/large?v=v2&px=999" role="button" title="sswati_2-1720596190464.png" alt="sswati_2-1720596190464.png" /></span></P><UL><LI>Alternatively, you can enable <STRONG>Create Request From Properties</STRONG> and specify the <STRONG>ID type</STRONG> and<BR /><STRONG>ID Value</STRONG> in the fields.<BR /><BR /><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sswati_3-1720596190467.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/134725i6E7B66D82CFDB9B6/image-size/large?v=v2&px=999" role="button" title="sswati_3-1720596190467.png" alt="sswati_3-1720596190467.png" /></span></LI></UL><P>Next, we use a mapping to ensure that the request contains all necessary parameters and is correctly structured for querying employee data. To help speed up the integration, an XSD generator in the form of an Eclipse Plug-in is available alongside the adapter.</P><P>Our <STRONG>NetSuite</STRONG> <STRONG>Eclipse Plug-in</STRONG> allows you to generate desired <STRONG>XSD</STRONG> and import it in an Integration Flow and use it in mappings. You can add it before the Request-Reply Step. This way, you can create the correct XML request message to create or modify a resource in NetSuite.</P><P>Furthermore, the Eclipse Plug-in XSD Generator helps you generate up-to-date XSDs for your NetSuite resources for all the different operations. Once the message mapping is complete, the transformed request is sent to NetSuite.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sswati_4-1720596190472.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/134726i71CD9E76A910BD0A/image-size/large?v=v2&px=999" role="button" title="sswati_4-1720596190472.png" alt="sswati_4-1720596190472.png" /></span></P><H3 id="toc-hId--227083944">Execute <STRONG>Get</STRONG> using the NetSuite Adapter</H3><P>To retrieve details related to an employee, you need to specify the API version and operation as <STRONG>get</STRONG>. This selection allows you to access the specific record type <STRONG>employee</STRONG>, enabling you to fetch comprehensive information associated with that employee.</P><P>The response from NetSuite further undergoes message mapping again to ensure it is transformed into a format that the client system understands and can process. You can also use XSDs generated by the <STRONG>NetSuite Eclipse Plug-in</STRONG> to create a mapping to handle the response message returned by NetSuite.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sswati_5-1720596190484.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/134724i2E5FB08039C1688F/image-size/large?v=v2&px=999" role="button" title="sswati_5-1720596190484.png" alt="sswati_5-1720596190484.png" /></span></P><P>The client system receives and interprets this response, extracting and utilizing the retrieved employee information as needed.</P><H2 id="toc-hId--552680168">Quick Links</H2><P>For detailed information about NetSuite adapter configuration, see <SPAN><A href="https://api.sap.com/package/NetSuiteAdapterforSAPIntegrationSuite/integrationadapter" target="_blank" rel="noopener noreferrer">NetSuite Adapter Guide</A></SPAN>.</P><P><STRONG>Note</STRONG>: The NetSuite adapter is available as part of your SAP Integration Suite license.</P>2024-07-12T15:37:03.059000+02:00https://community.sap.com/t5/technology-blogs-by-members/avoiding-multiple-destination-creation-for-integration-between-sap-erp-and/ba-p/13757480Avoiding Multiple Destination Creation for Integration Between SAP ERP and SAP Integration Suite2024-07-12T15:37:23.892000+02:00Ravi_Bharti08https://community.sap.com/t5/user/viewprofilepage/user-id/791742<P>When integrating SAP ERP (ECC, S/4 HANA) with SAP Integration Suite, it’s common to create separate destinations for each iFlow. This can lead to an excessive number of destinations, which can be cumbersome to manage. Here are two methods to streamline this process and avoid creating multiple destinations:</P><H2 id="toc-hId-1019456757">Method 1: Certificate-Based Authentication and create_by_url Class</H2><P>One effective way to reduce the number of destinations is to establish certificate-based authentication between SAP ERP and SAP Integration Suite. This method allows you to securely authenticate and communicate without needing a separate destination for each iFlow.</P><OL><LI><STRONG>Setup Certificate-Based Authentication</STRONG>: Ensure that both SAP ERP and SAP Integration Suite trust each other’s certificates.</LI><LI><STRONG>Use the create_by_url Class</STRONG>: This ABAP class can dynamically create HTTP connections using URLs, thus avoiding the need for predefined destinations.</LI></OL><P>Sample code :</P><P> </P><pre class="lia-code-sample language-abap"><code>DATA: lo_http_client TYPE REF TO if_http_client.
cl_http_client=>create_by_url( EXPORTING url = 'Pass URL Here'
ssl_id = 'Pass SSL Id'
IMPORTING client = lo_http_client
EXCEPTIONS argument_not_found = 1
plugin_not_active = 2
internal_error = 3
OTHERS = 4 ).
* Check for exceptions
IF sy-subrc <> 0.
ENDIF.
* Disable logon popup
lo_http_client->propertytype_logon_popup = lo_http_client->co_disabled.
* Set the HTTP method to POST
lo_http_client->request->set_method( 'POST' ).
* Send the HTTP request
lo_http_client->send(
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
http_invalid_timeout = 4
OTHERS = 5 ).
* Check for exceptions
IF sy-subrc = 0.
* Receive the HTTP response
lo_http_client->receive(
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
OTHERS = 5 ).
ENDIF.</code></pre><P> </P><H2 id="toc-hId-822943252">Method 2: Create RFC Destination with Blank Path Prefix and Use create_by_destination Class</H2><P>Another approach is to create a general RFC destination in transaction SM59 with only the host specified and leaving the path prefix blank. You can then dynamically set the specific path for each request using the header field ~request_uri.</P><P>RFC Destination :<BR /><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RFC Destination" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/135111i397A2FBEA506D683/image-size/large?v=v2&px=999" role="button" title="RFCDestination.jpg" alt="RFC Destination" /><span class="lia-inline-image-caption" onclick="event.preventDefault();">RFC Destination</span></span></P><P>Sample code :</P><P> </P><pre class="lia-code-sample language-abap"><code>DATA: lo_http_client TYPE REF TO if_http_client.
* Create HTTP client using the destination name
cl_http_client=>create_by_destination(
EXPORTING
destination = 'DestinationName'
IMPORTING
client = lo_http_client
EXCEPTIONS
argument_not_found = 1
destination_not_found = 2
destination_no_authority = 3
plugin_not_active = 4
internal_error = 5
OTHERS = 6 ).
* Check for exceptions
IF sy-subrc <> 0.
ENDIF.
* Disable logon popup
lo_http_client->propertytype_logon_popup = lo_http_client->co_disabled.
* Set the HTTP method to POST
lo_http_client->request->set_method( 'POST' ).
* Set the specific path for the request
lo_http_client->request->set_header_field(
name = '~request_uri'
value = 'PassYourPath' ).
* Send the HTTP request
lo_http_client->send(
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
http_invalid_timeout = 4
OTHERS = 5 ).
* Check for exceptions
IF sy-subrc = 0.
* Receive the HTTP response
lo_http_client->receive(
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
OTHERS = 5 ).
ENDIF.</code></pre><P> </P><P>By implementing these methods, you can significantly reduce the number of destinations required for integration between SAP ERP and SAP Integration Suite, making the process more efficient and easier to manage.</P><P> </P>2024-07-12T15:37:23.892000+02:00https://community.sap.com/t5/technology-blogs-by-members/integration-of-sap-task-center-azure-and-servicenow-sso-user-provisioning/ba-p/13766332Integration of SAP Task Center, Azure and ServiceNow - SSO, User Provisioning and Token exchange2024-07-19T16:10:57.124000+02:00ITCEhttps://community.sap.com/t5/user/viewprofilepage/user-id/1474919<P>During the configuration of <A href="https://www.itce.com/integrate-your-sap-task-center-with-servicenow/" target="_self" rel="nofollow noopener noreferrer">Task Connect</A>, an integration between ServiceNow and SAP Task center, <SPAN>we devoted significant effort to addressing security concerns</SPAN><SPAN>, particularly focusing on user authentication and user provisioning. Given the widespread use of Azure as an identity and token provider, we developed a method to synchronize users and groups across ServiceNow, SAP Task Center, and Azure. </SPAN></P><P>In this document, you will find the scenario overview, related architectural diagrams presenting the different components and how they interact with each other and what are the steps to follow to configure the connection between ServiceNow, SAP Task Center and Azure. </P><P><FONT size="4"><STRONG>1. Scenario overview</STRONG></FONT></P><P>The starting point in this scenario is the user's authentication and access token issued by the SAP Cloud Identity tenant's authentication service (IAS), indicated as AT (IAS) APP in returned by step 2 in figure 1 below and following the notation <token type> (<issuer>) <audience>. The complete token exchange is orchestrated by the <A href="https://www.rfc-editor.org/rfc/rfc6749" target="_blank" rel="noopener nofollow noreferrer">OAuth 2.0</A> and <A href="https://openid.net/developers/specs/" target="_blank" rel="noopener nofollow noreferrer">OpenID Connect</A> (OIDC) authorization and authentication frameworks and their respective token types, which are <A href="https://learn.microsoft.com/en-us/azure/active-directory/develop/access-tokens" target="_blank" rel="noopener nofollow noreferrer">access tokens</A> (AT), <A href="https://learn.microsoft.com/en-us/azure/active-directory/develop/refresh-tokens" target="_blank" rel="noopener nofollow noreferrer">refresh tokens</A> (RT), and <A href="https://learn.microsoft.com/en-us/azure/active-directory/develop/id-tokens" target="_blank" rel="noopener nofollow noreferrer">identity tokens</A> (ID). Thus, AT (IAS) IAS is an access token, issued by the IAS tenant's OAuth 2.0 authorization server, with an audience set to the IAS tenant's client ID. All tokens except for refresh tokens are formatted as JWTs. Compared to the token exchange in the previous parts of this blog series (see <A href="https://blogs.sap.com/2020/07/17/principal-propagation-in-a-multi-cloud-solution-between-microsoft-azure-and-sap-cloud-platform-scp/" target="_blank" rel="noopener noreferrer">part I</A>, <EM>Interoperability and standards</EM>, for more details), <A href="https://wiki.oasis-open.org/security/FrontPage#SAML_V2.0_Standard" target="_blank" rel="noopener nofollow noreferrer">SAML 2.0</A> - or more precisely the SAML assertion as an OAuth 2.0 authorization grant defined in section 2.1 of <A href="https://www.rfc-editor.org/rfc/rfc7522#section-2.1" target="_blank" rel="noopener nofollow noreferrer">RFC 7522</A> - is no longer used in this scenario. Instead of transforming between different token formats (JWT to SAML and back to JWT), this scenario only uses JWTs for the token exchange. It is important to note that for this token exchange no direct trust relationship between the application on BTP and Azure AD is required. The application only has a trust relationship to the IAS tenant, and the IAS tenant maintains the trust relationship to the Azure AD tenant (and vice versa). </P><P>All authentication requests for the business application on BTP (SAP TASK CENTER) are forwarded by the IAS tenant to the Azure AD tenant which is configured as a <A href="https://help.sap.com/docs/IDENTITY_AUTHENTICATION/6d6d63354d1242d185ab4830fc04feb1/19f3eca47db643b6aad448b5dc1075ad.html?locale=en-US" target="_blank" rel="noopener noreferrer">corporate identity provider (IdP) in IAS</A>. IAS acts as a proxy and delegates authentication to Azure AD in the role of the relying party to the corporate identity provider. The IAS tenant therefore requires an application registration in Azure AD. </P><P><STRONG>Note</STRONG>: For the TaskConnect integration configuration to work, the SAP Task Center should be configured according to the following documentation: <A href="https://help.sap.com/docs/task-center/sap-task-center/initial-setup" target="_blank" rel="noopener noreferrer">https://help.sap.com/docs/task-center/sap-task-center/initial-setup</A></P><P><FONT size="4"><STRONG>2. Users authentication and token exchange</STRONG></FONT></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_0-1721388770253.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139020i40DB8BEAFEB8A62C/image-size/large?v=v2&px=999" role="button" title="ITCE_0-1721388770253.png" alt="ITCE_0-1721388770253.png" /></span></P><OL><LI>The user accesses the BTP business application's SAP Task Center. The app delegates authentication to the IAS tenant using OIDC. It starts the authentication process by redirecting the user' browser to the IAS tenant's OAuth server authorization endpoint at <EM><U>https://<IAS</U> tenant name>.accounts.ondemand.com/oauth2/authorize </EM>and sending an OAuth authorization request. </LI><LI>Because the user is not yet authenticated at the IAS tenant, the user's browser is redirected to the IAS tenant's single sign-on (SSO) endpoint at <EM><U>https://<IAS</U> tenant name>.accounts.ondemand.com/saml2/idp/sso</EM>. </LI><LI>The business application is configured in IAS to pass all authentication requests to Azure AD as its corporate IdP. Therefore, IAS sends an OAuth authorization request to the Azure AD tenant's OAuth authorization endpoint. </LI><LI>The user gets prompted by Azure AD to enter the credentials. Upon successful authentication, Azure AD sends the authorization code to IAS by redirecting the user's web browser to the URI specified in the previous request. </LI><LI>IAS receives the authorization code and sends an access token request to Azure AD's token. Azure AD issues an access token and refresh token (RT(AAD)IAS which is cached for later use in step for the authenticated user with an audience set to the IAS tenant's OIDC name. </LI><LI>The BTP business application requests a <EM>client assertion</EM> from the IAS tenant to use it in the subsequent requests for the token exchange via the IAS tenant's OIDC proxy. The client application sends a token request to the IAS tenant's token endpoint. The POST request is authenticated with the client ID and secret of the business application in IAS. The client assertion from IAS takes the form of a signed JWT that proofs the application's identity to AAD when requesting tokens via the IAS corporate IdP OIDC proxy. </LI><LI>The business application exchanges the IAS-issued ID token into an Azure AD-issued access token via the IAS tenant's OIDC proxy token exchange endpoint. The POST request uses the assertion parameter to pass the base64-encoded IAS ID token of the user. </LI><LI>IAS token service sends a refresh token request using RT(AAD)IAS cached in step 5 to obtain a new access token AT(AAD)APP for the business application, </LI><LI>The business application uses the Azure AD On-behalf-Of (ObO) flow for requesting the access token </LI><LI>Finally, the business application calls the ServiceNow to take actions to the signed-in user's tasks. </LI><LI>ServiceNow validate the token using OIDC provider to verify ID tokens configuration with the same application registered in Azure which issues an access token and refresh token in step 5. </LI></OL><P><FONT size="4"><STRONG>3. User provisioning - Azure SAP</STRONG></FONT></P><P>Use SAP Cloud Identity Services - Identity Provisioning to provision users from Microsoft Azure Active Directory to SAP Cloud Identity Services - Identity Authentication. </P><P><STRONG><FONT size="4">4. User provisioning & SSO - Azure-ServiceNow</FONT></STRONG></P><OL><LI>Use ServiceNow enterprise application in Azure to provision users from Microsoft Azure Active Directory to ServiceNow instance </LI><LI>Use the same ServiceNow enterprise application created in step 13 in Azure to authenticate users from Microsoft Azure Active Directory to ServiceNow instance </LI></OL><P><FONT size="4"><STRONG>5. Technical service flow</STRONG></FONT></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_1-1721389027561.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139026i46BDAAB0DAC790CD/image-size/large?v=v2&px=999" role="button" title="ITCE_1-1721389027561.png" alt="ITCE_1-1721389027561.png" /></span></P><P>You need to create integration user for SAP Technical connection and choose how SAP Task Center will authenticate when technical connection is used (delta jobs in SAP are using this technical connection)</P><P>For example, you can use Basic Auth or OAuth: </P><OL><LI>For basic auth provide username and password to the team who is configuring the connection to ServiceNow. </LI><LI>The BTP business application requests a <EM>client assertion</EM> from the IAS tenant to use it in the subsequent requests for the token exchange via the IAS tenant's OIDC proxy.</LI><LI>For OAuth follow these steps in ServiceNow (account with admin role is required) <OL class="lia-list-style-type-lower-alpha"><LI>Open System OAuth -> Application Registry. Click New and choose "Create an OAuth API endpoint for external clients". Configure the record and share username, user password, client id and client secret with the team configuring the connection to ServiceNow </LI></OL></LI></OL><P><FONT size="4"><STRONG>6. Register the applications in Azure AD for IAS tenant and SN OIDC provider to verify ID tokens. </STRONG></FONT></P><P>The token exchange and OIDC proxy setup between the SN, IAS, and the Azure AD tenant, requires a trust relationship which is established by registering one application in the Azure AD tenant </P><P>“SAPIASTenant” represents the SAP Cloud Identity Service tenant.<BR /><BR /><STRONG>Step 1</STRONG><BR />Login to <A href="https://portal.azure.com/" target="_blank" rel="noopener nofollow noreferrer">Azure Portal</A> (e.g. with your Microsoft 365 E5 developer subscription’s admin account) and select <STRONG>Azure Active Directory </STRONG>from the portal menu. </P><P>Select <STRONG>App registrations </STRONG>from the left-side menu. </P><P><STRONG>Step 2</STRONG><BR />Click <STRONG>+ New registration </STRONG></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_4-1721391713497.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139143i95F1F1B49D0BDFA3/image-size/medium?v=v2&px=400" role="button" title="ITCE_4-1721391713497.png" alt="ITCE_4-1721391713497.png" /></span></P><P><STRONG>Step 3 <BR /></STRONG>Enter "<SAP IAS Tenant>" for the <STRONG>Name </STRONG>of the new application registration. </P><P>Replace <SAP IAS Tenant> with your friendly name </P><P>Select "Web" from the dropdown list in the <STRONG>Redirect UR I </STRONG>section. </P><P>Enter your IAS tenant's <STRONG>redirect UR I</STRONG>in the Redirect URI section's text field:<EM><U>https://<IAS</U></EM><EM>tenant name>.accounts.ondemand.com/oauth2/callback.</EM>Replace <IAS tenant name> with your tenant's name.</P><P>Click <STRONG>Register</STRONG>. </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_5-1721391793724.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139144iF19D6555EB9974F6/image-size/medium?v=v2&px=400" role="button" title="ITCE_5-1721391793724.png" alt="ITCE_5-1721391793724.png" /></span></P><P><STRONG>Step 4</STRONG><BR /><SPAN>Copy the newly generated <STRONG>Application (client) ID </STRONG>to a temporary text file. You will need it in the next step for deploying the sample application. </SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_6-1721391924140.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139146i52D8C3E06BC2A392/image-size/medium?v=v2&px=400" role="button" title="ITCE_6-1721391924140.png" alt="ITCE_6-1721391924140.png" /></span></P><P><STRONG>Step 5<BR /></STRONG>Select <STRONG>Manifest </STRONG>from the navigation menu to edit the application registration's manifest file. <BR />Change the value for the field "accessTokenAcceptedVersion" from null to <STRONG>2</STRONG>. <BR /><SPAN>Click <STRONG>Save</STRONG>. </SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_7-1721391960742.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139147iFB4CEBAED9F60E2C/image-size/medium?v=v2&px=400" role="button" title="ITCE_7-1721391960742.png" alt="ITCE_7-1721391960742.png" /></span></P><P><STRONG><FONT size="4"><BR />7. Configure trust to the IAS tenant in Azure AD</FONT></STRONG></P><P>Trust to the IAS tenant is configured in Azure AD with a new federated identity credential. In addition, a client secret is required for the initial token exchange in step 5 of figure 1. Both credentials will be configured for the application registrations in the following step. </P><P><STRONG>Step 6</STRONG><BR />Select the <EM>SAPIASTenant </EM>app from the list. (created in step 3) <BR />Select <STRONG>Certificates & secrets </STRONG>from the menu and switch to the <STRONG>Client secrets </STRONG>tab. <BR /><SPAN>Click <STRONG>+ New client secret</STRONG>. </SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_8-1721392162592.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139148i69480B049CF5D253/image-size/medium?v=v2&px=400" role="button" title="ITCE_8-1721392162592.png" alt="ITCE_8-1721392162592.png" /></span></P><P><STRONG>Step 7<BR /></STRONG>Enter "<SAPOIDCProxy>" for the <STRONG>Description</STRONG>. <BR /><SPAN>Click</SPAN> <STRONG>Add</STRONG><SPAN>. </SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_9-1721392189260.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139149iD7F1930022AE6587/image-size/medium?v=v2&px=400" role="button" title="ITCE_9-1721392189260.png" alt="ITCE_9-1721392189260.png" /></span></P><P><STRONG>Step 8</STRONG><BR /><SPAN>Click <STRONG>Copy to clipboard </STRONG>in the <STRONG>Value </STRONG>column and paste it to a temporary text file. You will need it later in the setup process.</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_10-1721392218908.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139150i771633F0E6266613/image-size/medium?v=v2&px=400" role="button" title="ITCE_10-1721392218908.png" alt="ITCE_10-1721392218908.png" /></span></P><P><STRONG>Step 9<BR /></STRONG>Create another one secret for ServiceNow <BR />Enter "<ServiceNow>" for the <STRONG>Description</STRONG>. <BR />Click <STRONG>Add</STRONG>. </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_11-1721392246014.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139151iF29340E5CB799372/image-size/medium?v=v2&px=400" role="button" title="ITCE_11-1721392246014.png" alt="ITCE_11-1721392246014.png" /></span></P><P><FONT size="4"><STRONG><BR />8. Configure permissions and scopes in Azure AD</STRONG></FONT></P><P>To request the Outlook calendar event on behalf of the user, the business application (SAPBTPGraphApp) requires the Graph API permission <EM>Calendars.Read</EM>. SAPBTPGraphApp also exposes the custom scope "<EM>token.exchange".</EM>This scope is referred to as a (downstream) API permission for the SAPIASTenant application registration and required for steps 7 and 8 in figure 1. For the initial token request to Azure AD (see step 5 in figure 1 and figure 2), the SAPIASTenant application exposes the custom scope "<EM>ias.access</EM>". </P><P><STRONG>Step 10</STRONG><BR /><SPAN>Go to </SPAN><STRONG>Expose an API </STRONG><SPAN>in the navigation menu. <BR /></SPAN><SPAN>Click <STRONG>+ Add a scope</STRONG>. </SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_12-1721392320639.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139152iC13AA6059661C3AD/image-size/medium?v=v2&px=400" role="button" title="ITCE_12-1721392320639.png" alt="ITCE_12-1721392320639.png" /></span></P><P><STRONG>Step 11<BR /></STRONG>Accept the default value for the <STRONG>Application ID URI</STRONG>. <BR /><SPAN>Click <STRONG>Save and continue</STRONG>. </SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_13-1721392351197.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139153i02AC97FECE81EE70/image-size/medium?v=v2&px=400" role="button" title="ITCE_13-1721392351197.png" alt="ITCE_13-1721392351197.png" /></span></P><P><STRONG>Step 12<BR /></STRONG>Enter "ias.access" for the new <STRONG>Scope name</STRONG>. Provide an <STRONG>Admin consent display name </STRONG>and <STRONG>description</STRONG>. <BR />Click <STRONG>Add scope</STRONG>. <BR /><SPAN><BR /><U>Scope name: <BR /></U></SPAN>ias.access </P><P><U>Admin consent display name: </U><BR />IAS Tenant Access <BR /><SPAN><BR /><U>Admin consent description: </U><BR />Access to SAP Cloud Identity service Application</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_14-1721392410098.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139154iD03A0444F56921A5/image-size/medium?v=v2&px=400" role="button" title="ITCE_14-1721392410098.png" alt="ITCE_14-1721392410098.png" /></span></P><P><STRONG>Step 13</STRONG><BR /><SPAN>Copy the full-qualified URI of the new scope (<I>api://<client id>/ias.access</I>) from the clipboard to temporary text file. It will be used in a later setup step. <BR /></SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_15-1721392473937.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139155i3270EA357C5861C0/image-size/medium?v=v2&px=400" role="button" title="ITCE_15-1721392473937.png" alt="ITCE_15-1721392473937.png" /></span></P><P><STRONG>Step 14<BR /></STRONG>Add <STRONG>Optional</STRONG> claim to the token. <BR />Navigate to <STRONG>Token</STRONG> <STRONG>configuration</STRONG> <BR />+ Add optional claim <BR />Token Type - ID <BR /><SPAN>Select "email" and add </SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_16-1721392521039.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139156i6522FD311C891215/image-size/medium?v=v2&px=400" role="button" title="ITCE_16-1721392521039.png" alt="ITCE_16-1721392521039.png" /></span></P><P><STRONG>Step 15</STRONG><BR />If message about API permissions required appear <BR />select the checkbox - Turn On Microsoft Graph email permission (required for claim to appear in token) <BR /><SPAN>Click<STRONG> "add"</STRONG></SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_17-1721392551461.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139157i7FECBDEB8BF05AEE/image-size/medium?v=v2&px=400" role="button" title="ITCE_17-1721392551461.png" alt="ITCE_17-1721392551461.png" /></span></P><P><STRONG>Step 16</STRONG><BR /><SPAN>Grant<STRONG> Admin Consent</STRONG> </SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_18-1721392573010.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139158iA2D9063ECC43A14F/image-size/medium?v=v2&px=400" role="button" title="ITCE_18-1721392573010.png" alt="ITCE_18-1721392573010.png" /></span></P><P><STRONG>Step 17<BR /></STRONG>Navigate to authentication <BR />Scroll down to Implicit grant and hybrid flows <BR />Select the tokens you would like to be issued by the authorization endpoint: <BR />Select the checkbox<STRONG> ID tokens </STRONG> <BR /><SPAN>Click<STRONG> Save </STRONG></SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_19-1721392604385.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139159i48375DDD83A980ED/image-size/medium?v=v2&px=400" role="button" title="ITCE_19-1721392604385.png" alt="ITCE_19-1721392604385.png" /></span></P><P><FONT size="4"><STRONG><BR />9. Configure Azure as an OAUTH OIDC provider on ServiceNow</STRONG></FONT></P><P><STRONG>Step 18</STRONG><BR />Open the ServiceNow instance <BR />Navigate to All > System OAuth > Application Registry. <BR /><SPAN>Click New, click Configure an OIDC provider to verify ID tokens.</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_20-1721392708919.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139160i510A6B332A47DAE8/image-size/medium?v=v2&px=400" role="button" title="ITCE_20-1721392708919.png" alt="ITCE_20-1721392708919.png" /></span></P><P><STRONG>Step 19<BR /></STRONG>Fill the form. </P><TABLE width="590"><TBODY><TR><TD width="154"><P>Field </P></TD><TD width="436"><P>Description </P></TD></TR><TR><TD width="154"><P>Name </P></TD><TD width="436"><P>A unique name that identifies the OAuth OIDC entity. </P></TD></TR><TR><TD width="154"><P>Client ID </P></TD><TD width="436"><P>The client ID of the application registered in Azure in step 4. The instance uses the client ID when requesting an access token. </P></TD></TR><TR><TD width="154"><P>Client Secret </P></TD><TD width="436"><P>The client secret of the application registered in Azure in step 31. </P></TD></TR><TR><TD width="154"><P>OAuth OIDC Provider Configuration </P></TD><TD width="436"><P>The OIDC provider (ADFS, Auth0, Azure AD, Google, Okta) can be used to validate the JWT token. Click the record of your OIDC provider configuration to validate the User Claim and User Field are set appropriately. If you check Enable JTI claim verification, the ServiceNow JWT token validation also validates the JTI sent by the provider. </P><P>See next step for more details </P><P> </P></TD></TR><TR><TD width="154"><P>Clock Skew </P></TD><TD width="436"><P>The number, in seconds, for the constraint to be considered valid. The default is 300. </P></TD></TR><TR><TD width="154"><P>Comments </P></TD><TD width="436"><P>Additional information to associate with the application. </P></TD></TR><TR><TD width="154"><P>Application </P></TD><TD width="436"><P>The name of the application containing this entity. </P></TD></TR><TR><TD width="154"><P>Accessible from </P></TD><TD width="436"><P>Select an option to make it accessible from all application scopes, or this application scope only. (all scope by default) </P></TD></TR><TR><TD width="154"><P>Enforce Token Restrictions </P></TD><TD width="436"><P>Select to only allow tokens to be used with APIs set to allow the authentication profile. You can set grant access using an API access policy. For more information, see<A href="https://docs.servicenow.com/bundle/washingtondc-platform-security/page/integrate/authentication/task/create-api-access-policy.html" target="_blank" rel="noopener nofollow noreferrer">Create REST API access policy</A>. </P><P>Default: Unselected. </P></TD></TR><TR><TD width="154"><P>Active </P></TD><TD width="436"><P>Select the check box to make the OAuth application active. </P></TD></TR><TR><TD width="154"><P>Redirect URL </P></TD><TD width="436"><P>The URL of the OAuth application for receiving the authorization code. (automatically added when save the application </P></TD></TR><TR><TD width="154"><P>End Session Endpoint URL </P></TD><TD width="436"><P>The URL endpoint which enables after a session ends.(not required </P></TD></TR><TR><TD width="154"><P>Enable force authentication </P></TD><TD width="436"><P>Option to enable force authentication for users. (not required) </P></TD></TR></TBODY></TABLE><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_22-1721392758973.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139162iDC77EF643B60AB1A/image-size/medium?v=v2&px=400" role="button" title="ITCE_22-1721392758973.png" alt="ITCE_22-1721392758973.png" /></span></P><P><STRONG>Step 20<BR /></STRONG>OAuth OIDC Provider Configuration <BR /><SPAN>Click on the search icon and then New</SPAN></P><P><U>OIDC Provider</U> - A unique name that identifies the OIDC provider </P><P><U>OIDC Metadata URL</U> - the OIDC provider OpenID Connect metadata document (details in next step) </P><P>User claim: email <BR />User Field: the field in SN which contain mail value </P><P><SPAN>Enable JTI claim verification: Disable</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_24-1721392870114.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139164i79DF73CAB66764A6/image-size/medium?v=v2&px=400" role="button" title="ITCE_24-1721392870114.png" alt="ITCE_24-1721392870114.png" /></span></P><P><STRONG>Step 21</STRONG><BR /><SPAN>Navigate to azure application which created in step 3 - Overview - Endpoints - OpenID Connect metadata document </SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_25-1721392902312.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139165iCF1D5CD29ACA04B2/image-size/medium?v=v2&px=400" role="button" title="ITCE_25-1721392902312.png" alt="ITCE_25-1721392902312.png" /></span></P><P><STRONG>Step 22<BR /></STRONG>Navigate to Oauth Entity Scope and add <BR />offline_access, <BR />Open id </P><P><SPAN>Click Update.</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_26-1721392944387.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139166i849E44A753A0B5B7/image-size/medium?v=v2&px=400" role="button" title="ITCE_26-1721392944387.png" alt="ITCE_26-1721392944387.png" /></span></P><P><STRONG>Step 23<BR /></STRONG>Navigate to the Oauth Entity Profiles which is automatically created when Save Oauth OIDC entity. <BR /><BR />Verify that the Grant type is is Resource Owner Password Credentials <SPAN>and then add the OAuth Entity Scopes created in the above step.</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_27-1721392984612.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139167iAC57E49CE9075C33/image-size/medium?v=v2&px=400" role="button" title="ITCE_27-1721392984612.png" alt="ITCE_27-1721392984612.png" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_28-1721392990570.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139168i8C828D24A90815FC/image-size/medium?v=v2&px=400" role="button" title="ITCE_28-1721392990570.png" alt="ITCE_28-1721392990570.png" /></span></P><P><STRONG>Step 24</STRONG><BR /><SPAN>Add Auth Scope: <BR />useraccount</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_29-1721393015741.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139169i6D24846BA6911851/image-size/medium?v=v2&px=400" role="button" title="ITCE_29-1721393015741.png" alt="ITCE_29-1721393015741.png" /></span></P><P><STRONG>Step 25<BR /></STRONG>Navigate to the created in step 34 Oauth OIDC Entity and copy the redirect url </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_31-1721393042174.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139171i5E7E9D23B1E5C62E/image-size/medium?v=v2&px=400" role="button" title="ITCE_31-1721393042174.png" alt="ITCE_31-1721393042174.png" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_32-1721393043578.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139172i287AE8534394A9EB/image-size/medium?v=v2&px=400" role="button" title="ITCE_32-1721393043578.png" alt="ITCE_32-1721393043578.png" /></span></P><P><STRONG>Step 26<BR /></STRONG>Navigate to Azure App registered in step 3 <BR />Authentication <BR />Add the url from the previous step. (do not remove or replace the url added in step 3 when create the application) <BR /><SPAN>Save</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_33-1721393081723.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139173i02E0E7383A814392/image-size/medium?v=v2&px=400" role="button" title="ITCE_33-1721393081723.png" alt="ITCE_33-1721393081723.png" /></span><BR /><BR /></P><P><FONT size="4"><STRONG>10. Setup user provisioning - Azure >> SAP</STRONG></FONT></P><P><STRONG>Step 27</STRONG><BR /><SPAN>Launch a browser window and access your Azure portal using the URL: </SPAN><SPAN><A href="https://portal.azure.com/" target="_blank" rel="noopener nofollow noreferrer"><STRONG>https://portal.azure.com/</STRONG></A></SPAN><STRONG><SPAN>. </SPAN></STRONG></P><P><FONT color="#3366FF"><STRONG><SPAN>You will need to authenticate to your Azure AD using your admin credentials.</SPAN></STRONG><SPAN> </SPAN></FONT></P><P><STRONG>Step 28<BR /></STRONG>Click <STRONG>Microsoft Entra ID.</STRONG> </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_34-1721393313874.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139174i4701DA7957C33F35/image-size/medium?v=v2&px=400" role="button" title="ITCE_34-1721393313874.png" alt="ITCE_34-1721393313874.png" /></span></P><P><STRONG>Step 29</STRONG><BR />Click <STRONG>App Registration</STRONG> >><STRONG> New registration</STRONG>. </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_35-1721393339071.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139175i2ED7A7EB0C5AEFBE/image-size/medium?v=v2&px=400" role="button" title="ITCE_35-1721393339071.png" alt="ITCE_35-1721393339071.png" /></span></P><P><STRONG>Step 30<BR /></STRONG>Specify a name for your app and click <STRONG>Register</STRONG> </P><P><STRONG>Step 31<BR /></STRONG>Click <STRONG>API permission >> Add a permission</STRONG>. </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_36-1721393393375.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139176iD72EC529CCFD1A15/image-size/medium?v=v2&px=400" role="button" title="ITCE_36-1721393393375.png" alt="ITCE_36-1721393393375.png" /></span></P><P><STRONG>Step 32</STRONG><BR /><SPAN>Select <STRONG>Microsoft Graph</STRONG>.</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_37-1721393415459.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139177i97568B444FAC1AEF/image-size/medium?v=v2&px=400" role="button" title="ITCE_37-1721393415459.png" alt="ITCE_37-1721393415459.png" /></span></P><P><STRONG>Step 33<BR /></STRONG>Click <STRONG>Application permissions</STRONG>. </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_38-1721393439583.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139178i7F1957CD8E10E786/image-size/medium?v=v2&px=400" role="button" title="ITCE_38-1721393439583.png" alt="ITCE_38-1721393439583.png" /></span></P><P><STRONG>Step 34<BR /></STRONG>From the list of API permissions, expand <STRONG>User</STRONG> and select <STRONG>User.Read.All.</STRONG> </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_39-1721393458635.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139179i6E39C79EBBAE41A9/image-size/medium?v=v2&px=400" role="button" title="ITCE_39-1721393458635.png" alt="ITCE_39-1721393458635.png" /></span></P><P><STRONG>Step 35<BR /></STRONG>From the API list also select <STRONG>Group >> Read.All</STRONG> and <STRONG>Directory >> Read.All</STRONG>. Click <STRONG>Add permissions</STRONG> at the bottom of the screen once done. </P><P><STRONG>Step 36<BR /></STRONG>The permissions are not granted by default. To grant the permissions, click <STRONG>Grant admin consent for Default Directory</STRONG>. </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_40-1721393500214.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139181i9C2A8D19DA28A349/image-size/medium?v=v2&px=400" role="button" title="ITCE_40-1721393500214.png" alt="ITCE_40-1721393500214.png" /></span></P><P><STRONG>Step 37</STRONG><BR /><SPAN>Click Yes on the popup message and confirm that all permissions are granted.</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_41-1721393517168.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139182i38D86F56F4F4B9C4/image-size/medium?v=v2&px=400" role="button" title="ITCE_41-1721393517168.png" alt="ITCE_41-1721393517168.png" /></span></P><P><STRONG>Step 38</STRONG><BR /><SPAN>Click <STRONG>Overview </STRONG>from the left panel. Make a note of the <STRONG>Application (client) ID</STRONG>. You will need this later when creating the source system in IPS. Click <STRONG>Add a certificate or secret</STRONG>. </SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_42-1721393534448.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139183i097E17CB56F3FCE9/image-size/medium?v=v2&px=400" role="button" title="ITCE_42-1721393534448.png" alt="ITCE_42-1721393534448.png" /></span></P><P><STRONG>Step 39</STRONG><BR /><SPAN>Click <STRONG>New client secret</STRONG>. </SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_43-1721393550840.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139184iB3D59E6F975F9978/image-size/medium?v=v2&px=400" role="button" title="ITCE_43-1721393550840.png" alt="ITCE_43-1721393550840.png" /></span></P><P><STRONG>Step 40</STRONG><BR /><SPAN>Specify a description and expiry time for the client secret.</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_44-1721393570018.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139185i3EE4774B880737D3/image-size/medium?v=v2&px=400" role="button" title="ITCE_44-1721393570018.png" alt="ITCE_44-1721393570018.png" /></span></P><P><STRONG>Step 41</STRONG><BR /><SPAN>You should have client secret added successfully. Make a note of the value field as you will need it later when creating the source system in IPS. </SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_45-1721393595594.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139186iE22B34B9F29FA22D/image-size/medium?v=v2&px=400" role="button" title="ITCE_45-1721393595594.png" alt="ITCE_45-1721393595594.png" /></span></P><P><STRONG>Step 42</STRONG><BR /><SPAN>Navigate to the main overview page of Azure AD and make a note of your<STRONG> Primary domain</STRONG>. You will need this value when creating the source system in IPS. </SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_46-1721393612994.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139187i8653F93DEC94A456/image-size/medium?v=v2&px=400" role="button" title="ITCE_46-1721393612994.png" alt="ITCE_46-1721393612994.png" /></span></P><P><STRONG>Step 43<BR /></STRONG>Follow the blog <A href="https://community.sap.com/t5/technology-blogs-by-sap/provision-users-from-microsoft-azure-ad-to-sap-cloud-identity-services/ba-p/13546054" target="_blank">https://community.sap.com/t5/technology-blogs-by-sap/provision-users-from-microsoft-azure-ad-to-sap-cloud-identity-services/ba-p/13546054</A> and specific hint on filtering users by a group in Identiy Provisionning Source system Properties, add aad.group.filter=displayName eq '<group_name>': </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_47-1721393638444.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139188iA3AB7BF33A35871F/image-size/medium?v=v2&px=400" role="button" title="ITCE_47-1721393638444.png" alt="ITCE_47-1721393638444.png" /></span></P><P><FONT size="4"><STRONG><BR />11. Establish trust between task sub account and IAS</STRONG></FONT></P><P><STRONG>Step 44</STRONG><BR /><SPAN>Go to BTP Cockpit->Security->Trust Configuration </SPAN></P><P><STRONG>Step 45</STRONG><BR /><SPAN>Select "Establish trust" and choose the IAS</SPAN></P><P><STRONG>Step 46</STRONG><BR />Select "Establish trust" and choose the IAS </P><P>Note: This creates an OIDC application in IAS for the subaccount </P><P><SPAN>NB: <STRONG>Task Center/Service Now integration works only with OIDC trust between Task Center subaccount and IAS</STRONG></SPAN></P><P><STRONG>Step 47<BR /></STRONG>This would create an application in iAS </P><P>For more information, you can check: <A href="https://help.sap.com/docs/btp/sap-business-technology-platform/establish-trust-and-federation-between-uaa-and-identity-authentication" target="_blank" rel="noopener noreferrer">https://help.sap.com/docs/btp/sap-business-technology-platform/establish-trust-and-federation-between-uaa-and-identity-authentication</A><BR /><BR /></P><P><FONT size="4"><STRONG>12. Setup the corporate identity provider and OIDC proxy in SAP Cloud Identity tenant</STRONG></FONT></P><P><STRONG>Step 48</STRONG><BR />Login as an administrator to your SAP Cloud Identity service administration console at <BR /><EM><U>https://<IAStenant<SPAN> name>.accounts.ondemand.com/admin </SPAN></U></EM></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_48-1721393838179.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139189i3779AF1F8EA76B8B/image-size/medium?v=v2&px=400" role="button" title="ITCE_48-1721393838179.png" alt="ITCE_48-1721393838179.png" /></span></P><P><STRONG>Step 49<BR /></STRONG>Go to <STRONG>Identity Providers > Corporate Identity Providers </STRONG>and click <STRONG>Create</STRONG>. <BR /><SPAN>Enter a <STRONG>Display name</STRONG>(e.g. "Azure Active Directory") and click <STRONG>Save</STRONG>. </SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_0-1721395913437.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139201iC0CD8E38F7476244/image-size/medium?v=v2&px=400" role="button" title="ITCE_0-1721395913437.png" alt="ITCE_0-1721395913437.png" /></span></P><P><STRONG>Step 50</STRONG><BR /><SPAN>Click on <STRONG>Identity Provider Type </STRONG>from the Trust settings of the new corporate identity provider.</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_1-1721395934806.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139202i579741B52C780B6E/image-size/medium?v=v2&px=400" role="button" title="ITCE_1-1721395934806.png" alt="ITCE_1-1721395934806.png" /></span></P><P><STRONG>Step 51<BR /></STRONG>Select <STRONG>OpenID Connect Compliant </STRONG>from the list. <BR /><SPAN>Click <STRONG>Save</STRONG>.</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_2-1721395961468.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139203i560EAD88536F6F15/image-size/medium?v=v2&px=400" role="button" title="ITCE_2-1721395961468.png" alt="ITCE_2-1721395961468.png" /></span></P><P><STRONG>Step 52</STRONG><BR /><SPAN>Click on <STRONG>OpenID Connect Configuration </STRONG>from the Trust settings of the new corporate identity provider.</SPAN><SPAN> </SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_3-1721395983702.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139204i7020E307084663E1/image-size/medium?v=v2&px=400" role="button" title="ITCE_3-1721395983702.png" alt="ITCE_3-1721395983702.png" /></span></P><P><STRONG>Step 53<BR /></STRONG>Enter your Azure AD tenant's OIDC <STRONG>Discovery URL </STRONG><U>(</U><A href="https://login.microsoftonline.com/%3cAAD" target="_blank" rel="noopener nofollow noreferrer">https://login.microsoftonline.com/<AAD</A><U> tenant ID>/v2.0)</U> Click <STRONG>Load</STRONG>. <BR /><BR /><SPAN>The Issuer field gets populated from the loaded Azure AD tenant's OIDC metadata.</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_4-1721396016741.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139205i729511E4B37B92F0/image-size/medium?v=v2&px=400" role="button" title="ITCE_4-1721396016741.png" alt="ITCE_4-1721396016741.png" /></span></P><P><STRONG>Step 54</STRONG><BR />Enter the SAPIASTenant's client ID in the <STRONG>Client ID </STRONG>field. In the <STRONG>Client Secret </STRONG>field, enter the value of the<EM>OIDCProxy</EM>secret copied in <STRONG>step 8</STRONG>. </P><P><SPAN>Click <STRONG>Validate</STRONG>. </SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_5-1721396041390.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139206i1C5E71AA2AE4C9B9/image-size/medium?v=v2&px=400" role="button" title="ITCE_5-1721396041390.png" alt="ITCE_5-1721396041390.png" /></span></P><P><STRONG>Step 55<BR /></STRONG>Verify a successful validation of the OIDC configuration. </P><P><SPAN>Click <STRONG>OK</STRONG>. <BR /><BR /></SPAN><STRONG>Step 56</STRONG><BR /><SPAN>Click <STRONG>+ Add </STRONG> </SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_6-1721396081656.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139207i45640799A988C0DB/image-size/medium?v=v2&px=400" role="button" title="ITCE_6-1721396081656.png" alt="ITCE_6-1721396081656.png" /></span></P><P><STRONG>Step 57<BR /></STRONG>Copy and paste the full-qualified URI of the SAPIASTenant application's custom scope (<EM>api://<client id>/ias.access) </EM>copied in <STRONG>step 13 </STRONG>for the new scope. </P><P><SPAN>Click <STRONG>Save</STRONG>. </SPAN></P><P><SPAN><STRONG>Step 58<BR /></STRONG></SPAN>Click<STRONG>+ Add </STRONG>again and add the scope: <BR />"email" <BR />"openid" <BR />"offline_access" </P><P><SPAN>Click <STRONG>Save</STRONG>. <BR /></SPAN></P><P><SPAN><STRONG>Step 59</STRONG><BR />Click <STRONG>Save</STRONG>. <BR /></SPAN></P><P><SPAN><STRONG>Step 60<BR /></STRONG></SPAN>Go to <STRONG>Applications & Resources > Applications </STRONG> <BR />Select the application from <STRONG><U>"Establish trust between Task subaccount and IAS" step</U></STRONG> – step 47</P><P><SPAN>Click <STRONG>Attributes</STRONG><BR /></SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_7-1721396184485.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139208iC3DF6E28598F7F9F/image-size/medium?v=v2&px=400" role="button" title="ITCE_7-1721396184485.png" alt="ITCE_7-1721396184485.png" /></span></P><P><STRONG>Step 61<BR /></STRONG>Navigate to Attributes and add <BR /><BR /><U>Name</U>: "xsuaa-persist-corporate-idp-token" <BR /><U>Source</U>: Expression <BR /><U>Value</U>: true </P><P><SPAN>Save</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_8-1721396237130.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139209iC0DBCB9FE1D12035/image-size/medium?v=v2&px=400" role="button" title="ITCE_8-1721396237130.png" alt="ITCE_8-1721396237130.png" /></span></P><P><STRONG>Step 62<BR /></STRONG>Select "Conditional Authentication" <BR /><SPAN>In the "Default Identity Provider", choose the Azure provider configured in steps 48-59, Click Save<BR /></SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_9-1721396411574.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139210i8708634B85151D48/image-size/medium?v=v2&px=400" role="button" title="ITCE_9-1721396411574.png" alt="ITCE_9-1721396411574.png" /></span></P><P><BR /><FONT size="4"><STRONG>13. Configure destinations <SPAN>for SAP in the BTP sub-account</SPAN></STRONG></FONT></P><P>SAP Task Center uses destinations to connect to Service Now task provider </P><P> <STRONG>Client Specific configuration:</STRONG> </P><UL><LI><STRONG>aadTokenEndpoint</STRONG>: Azure AD token endpoint at<A href="https://login.microsoftonline.com/%3CAAD" target="_blank" rel="noopener nofollow noreferrer"><EM>https://login.microsoftonline.com/<AAD</EM></A> <EM>tenant ID>/oauth2/v2.0/token </EM> </LI><LI><STRONG>iasTokenEndpoint</STRONG>: SAP Cloud Identity service tenant's token endpoint at<EM><U>https://<IAS</U>tenant name>.accounts.ondemand.com/oauth2/token </EM> </LI><LI><STRONG>iasTokenExchange</STRONG>: SAP Cloud Identity service's token exchange service endpoint at<EM><U>https://<IAS</U>tenant name>.accounts.ondemand.com/oauth2/exchange/corporateidp </EM> </LI></UL><P><STRONG>Step 63<BR /></STRONG>Go back to the <A href="https://cockpit.sap.hana.ondemand.com/" target="_blank" rel="noopener nofollow noreferrer">SAP BTP Cockpit </A>and navigate to your CF subaccount. <BR />Select <STRONG>Connectivity > Destinations </STRONG>from the navigation menu. <BR /><SPAN>Click <STRONG>New Destination</STRONG>.</SPAN></P><P><SPAN><STRONG>Step 64<BR /></STRONG></SPAN>Enter the following values for the first destination: <BR /><STRONG>Refer to 6. TECHNICAL SERVICE FLOW</STRONG></P><P><SPAN>Click <STRONG>Save</STRONG>.<BR /></SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_10-1721397811178.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139211i19581BA67D61F34E/image-size/medium?v=v2&px=400" role="button" title="ITCE_10-1721397811178.png" alt="ITCE_10-1721397811178.png" /></span></P><P><STRONG>Step 65<BR /></STRONG>Repeat steps 63 and 64 with following values for the second destination: <BR /><BR />Refer to 10. CONFIGURE AZURE AS AN OAUTH OIDC PROVIDER ON THE SERVICENOW , step 21.</P><P><U>AuthnContextClassRef</U> = urn:oasis:names:tc:SAML:2.0:ac:classes:X509 <BR /><U>clientKey </U>= token service password=client secret <BR /><U>Token service user</U> = client id </P><P>Task Center documentation for Third Party destination setup: <A href="https://help.sap.com/docs/task-center/sap-task-center/connect-third-party-task-provider-and-sap-task-center" target="_blank" rel="noopener noreferrer">https://help.sap.com/docs/task-center/sap-task-center/connect-third-party-task-provider-and-sap-task-center</A> </P><P>Click <STRONG>Save</STRONG>. </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITCE_11-1721397858391.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/139212iB88EAADFF8D1DFD8/image-size/medium?v=v2&px=400" role="button" title="ITCE_11-1721397858391.png" alt="ITCE_11-1721397858391.png" /></span></P><P><FONT size="4"><STRONG>14. Test the scenario </STRONG></FONT></P><P><SPAN><STRONG>Step 66<BR /></STRONG>Use SAP Task Center Administration app to check the status of the configured connector destination, following: <A href="https://help.sap.com/docs/task-center/sap-task-center/working-with-task-center-administration-app" target="_blank" rel="noopener noreferrer">https://help.sap.com/docs/task-center/sap-task-center/working-with-task-center-administration-app</A><STRONG><BR /></STRONG></SPAN></P><P><SPAN><STRONG>Step 67<BR /></STRONG>Use SAP Task Center Web app, to validate that tasks from the new destination are seen by business users (for more information, see: <A href="https://help.sap.com/docs/task-center/sap-task-center/sap-task-center-web-app" target="_blank" rel="noopener noreferrer">https://help.sap.com/docs/task-center/sap-task-center/sap-task-center-web-app</A>)<STRONG><BR /></STRONG></SPAN></P>2024-07-19T16:10:57.124000+02:00https://community.sap.com/t5/technology-blogs-by-members/optimized-error-management-and-retry-strategy-with-ibm-mq-on-sap-cloud/ba-p/13771408Optimized Error Management and Retry Strategy with IBM MQ on SAP Cloud Integration2024-07-31T23:28:02.587000+02:00ShreyasShenoy07https://community.sap.com/t5/user/viewprofilepage/user-id/1510706<P><STRONG>Target Audience: <BR /></STRONG></P><P>This blog is primarily aimed at the SAP Integration community looking for a <STRONG>Retry and Reprocessing mechanism for <SPAN>SAP Cloud Integration</SPAN>,</STRONG> where <STRONG>IBM MQ is used as the message broker.<BR /></STRONG></P><P><SPAN><STRONG>Motivation:</STRONG></SPAN></P><UL><LI><SPAN>As we transition to cloud-based solutions, data storage costs are on the rise. Utilizing modern iPaaS solutions with data persistence will significantly increase the operational costs for integrations. For SAP Cloud Integration (CI), there is an additional consideration of a<STRONG> tenant-based storage limit of 32 GB</STRONG>.</SPAN></LI><LI>We employ IBM MQ as the message broker between the third-party application and SAP CI. This message broker provides temporary persistence to handle outages and intermittent message failures, allowing us to retry messages using this persistence. The solution outlined in the blog addresses asynchronous inbound message delivery to SAP via SAP CI. </LI></UL><P><STRONG>Solution Approach:<BR /></STRONG></P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="ShreyasShenoy07_0-1721898958255.png" style="width: 822px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/141530i234E31F957F3C925/image-dimensions/822x604?v=v2" width="822" height="604" role="button" title="ShreyasShenoy07_0-1721898958255.png" alt="ShreyasShenoy07_0-1721898958255.png" /></span></P><UL><LI><SPAN>The core flow will transfer failed messages to the Retry Queue, appending <STRONG>ErrorType</STRONG> and <STRONG>Retry count</STRONG> headers to each message. </SPAN></LI><LI><SPAN>A second flow (<STRONG>Retry flow</STRONG>) will be scheduled to execute at regular intervals. This flow will connect to the <STRONG>Retry Queue</STRONG> and, depending on the <STRONG>ErrorType</STRONG> and <STRONG>RetryCount</STRONG> headers, will either transfer the message to the <STRONG>Backout Queue</STRONG> or return it to the <STRONG>Main Queue</STRONG>. </SPAN></LI><LI><SPAN>Messages designated with <STRONG>ErrorType</STRONG>= <STRONG>MappingError (since Mapping Errors cannot be retried directly)</STRONG> or with <STRONG>RetryCount</STRONG> > <STRONG>n (where n -> maximum number of retries) </STRONG>will be directed to the <STRONG>Backout Queue (Discarded messages)</STRONG>. All other messages will be routed to the <STRONG>Main Queue(Reprocess messages)</STRONG> for retry attempts (<STRONG>ErrorType</STRONG>= <STRONG>NonMappingError, </STRONG>a Delivery Error that can be retried) .</SPAN></LI><LI>To understand this let’s consider 3 messages in the <STRONG>RetryQueue</STRONG> with the below headers the <STRONG>Retry flow</STRONG> will move them as below:<STRONG><BR /></STRONG></LI></UL><P style=" padding-left : 60px; "><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ShreyasShenoy07_1-1721900426055.png" style="width: 825px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/141572i54628F1AECE34EAE/image-dimensions/825x131?v=v2" width="825" height="131" role="button" title="ShreyasShenoy07_1-1721900426055.png" alt="ShreyasShenoy07_1-1721900426055.png" /></span></P><P><U><STRONG>Core Flow</STRONG></U></P><DIV class=""><DIV><DIV class=""><DIV class=""><DIV class=""><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="ShreyasShenoy07_1-1721916574541.png" style="width: 769px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/141800iD305946C623CA962/image-dimensions/769x477?v=v2" width="769" height="477" role="button" title="ShreyasShenoy07_1-1721916574541.png" alt="ShreyasShenoy07_1-1721916574541.png" /></span></DIV></DIV></DIV></DIV></DIV><DIV class=""><DIV class=""><DIV class=""><DIV class=""><DIV class=""><DIV class=""><P> </P><P>In the above flow, I did not include the mapping step. However, if you have a mapping step, the <STRONG>ErrorType</STRONG> should be set to <STRONG>MappingError</STRONG> before the mapping step, and reinitialized to <STRONG>NonMappingError</STRONG> before delivery. This ensures the correct <STRONG>ErrorType</STRONG> is received in the exception sub-flow.</P><P><U><STRONG>Retry Flow:</STRONG></U></P></DIV></DIV></DIV></DIV></DIV></DIV><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="ShreyasShenoy07_0-1721916523588.png" style="width: 745px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/141799i6E5D250A05D20DB9/image-dimensions/745x369?v=v2" width="745" height="369" role="button" title="ShreyasShenoy07_0-1721916523588.png" alt="ShreyasShenoy07_0-1721916523588.png" /></span></P><P> </P><P>All the failed messages from the <STRONG>Core Flow</STRONG> is sent to the <STRONG>Retry Queue</STRONG> . Based on the <STRONG>ErrorType</STRONG> and <STRONG>RetryCount </STRONG>these messages would have to be reprocessed. We will need to connect to the <STRONG>IBM MQ Queue manager</STRONG> to publish these messages to either the Main Queue <STRONG>(Reprocess messages)</STRONG> or Backout Queue <STRONG>(Discard messages) </STRONG>by picking them from the <STRONG>Retry Queue. </STRONG>For this we will need the below information (these are externalized and initialized as <STRONG>Headers</STRONG> in the flow): </P><UL><LI>Queue Manager Connection Details</LI><LI>Queue Name (<STRONG>Retry Queue, Backout Queue, Main Queue</STRONG>)</LI><LI>Credential or Certificate for Authenticating the Queue Manager (We have used Certificate based authentication)<BR /><P><SPAN>In the retry flow <STRONG>Process Retry Messages </STRONG>is a Groovy script step which works as below:</SPAN></P></LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="ShreyasShenoy07_0-1721917806196.png" style="width: 646px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/141808i55EA1BD1C07CC7D9/image-dimensions/646x489?v=v2" width="646" height="489" role="button" title="ShreyasShenoy07_0-1721917806196.png" alt="ShreyasShenoy07_0-1721917806196.png" /></span></P><P><SPAN><BR />SAP Cloud integration (CI) uses <STRONG>QPID JMS 0.59</STRONG> for its <STRONG>AMQP Adapter implementation</STRONG>. </SPAN></P><OL><LI><SPAN>I have created a Java Archive (JAR) file based on the same version of QPID JMS Implementation to receive and send messages from and to respective Queues (AMQP Client):<BR /><A href="https://github.com/apache/qpid-jms/blob/0.59.0/qpid-jms-examples/src/main/java/org/apache/qpid/jms/example/Receiver.java" target="_blank" rel="noopener nofollow noreferrer">https://github.com/apache/qpid-jms/blob/0.59.0/qpid-jms-examples/src/main/java/org/apache/qpid/jms/example/Receiver.java</A></SPAN></LI><LI><SPAN>The code also contains the logic to check <STRONG>ErrorType</STRONG> and publish messages to the respective Queues i.e.<BR />Messages designated with <STRONG>ErrorType= MappingError</STRONG> or with <STRONG>RetryCount > n</STRONG> (where n -> maximum number of retries) will be directed to the <STRONG>Backout Queue</STRONG>. All other messages will be routed to <STRONG>the Main Queue</STRONG> for retry attempts.</SPAN></LI><LI><SPAN>We have used <STRONG>TLS Authentication</STRONG> to authenticate our connection to the Queue Manager in the Java code. Please refer the below blog to set your certificates for authentication in the Java code:<BR /><A href="https://www.baeldung.com/java-custom-truststore" target="_blank" rel="noopener nofollow noreferrer">https://www.baeldung.com/java-custom-truststore</A></SPAN></LI><LI><SPAN>This is then called from the Groovy script <STRONG>Process Retry Messages. </STRONG>The script will essentially pass all the externalized details like the <STRONG>Queue and Queue Manager connection details </STRONG>and the <STRONG>authentication details</STRONG> from the Security Artifacts in SAP CI to the function in the Java Archive (JAR).<BR /></SPAN><SPAN>Please refer the below blog to understand how to fetch security artifacts from SAP CI:</SPAN></LI></OL><P style=" padding-left : 30px; "><SPAN><A href="https://community.sap.com/t5/technology-blogs-by-members/sap-cpi-fetch-all-security-artifacts-don-t-read-this/ba-p/13483159" target="_blank">https://community.sap.com/t5/technology-blogs-by-members/sap-cpi-fetch-all-security-artifacts-don-t-read-this/ba-p/13483159</A></SPAN></P><P><STRONG><SPAN>Pros</SPAN></STRONG><SPAN> </SPAN></P><UL><LI><SPAN>Since the failed messages are persisted outside SAP CI in IBM MQ. There is no risk of overloading the persistence layer like in the case of alternative 2.</SPAN><SPAN> </SPAN></LI><LI><SPAN>The development effort is less as the developer would only have to create the core flow and send the failed messages with the right headers. The Retry flow would only need few configurations to set it up for a specific integration.</SPAN><SPAN> (The Retry Flow will only be built once and reused for the remaining integrations)</SPAN></LI><LI><SPAN>Messages experiencing prolonged connectivity issues or data-related issues are transferred to the Backout queue, where they can be analyzed later.</SPAN></LI></UL><P><STRONG><SPAN>Cons</SPAN></STRONG><SPAN> </SPAN></P><OL><LI><SPAN>The configuration requires three queues (Main, Retry, and a Backout Queue), departing from the conventional IBM MQ setup of just a Main and Backout Queue.</SPAN><SPAN> </SPAN></LI><LI><SPAN>The script responsible for retrying failed messages may require support from respective teams in case of performance issues.</SPAN><SPAN> </SPAN></LI><LI><SPAN>Not suitable where we would need retries for very small intervals' (less than a minute).</SPAN><SPAN> </SPAN></LI></OL><P>Request everyone to provide any improvements, suggestions or concern wrt. to the strategy outlined in the blog. <BR /><BR /></P>2024-07-31T23:28:02.587000+02:00https://community.sap.com/t5/technology-blogs-by-sap/sending-form-data-from-sap-integration-suite-best-practices-and-techniques/ba-p/13779024Sending Form-Data from SAP Integration Suite: Best Practices and Techniques2024-08-01T11:20:20.448000+02:00mazhara_dmitryhttps://community.sap.com/t5/user/viewprofilepage/user-id/780029<H1 id="toc-hId-892276636">Disclaimer</H1><P>Multipart/form-data is a complex content type used to send HTML forms with binary (non-ASCII) data via HTTP POST, as specified in <A href="https://tools.ietf.org/html/rfc2045" target="_self" rel="nofollow noopener noreferrer">RFC-2045</A>. Finding a standard method for this in SAP Integration Suite can be challenging, but there’s a workaround.</P><P>In this article, we explore practical solutions for handling multipart/form-data with SAP Integration Suite. Learn how to set up custom flows and ensure smooth data transmission.</P><P> </P><H1 id="toc-hId-695763131">Problems</H1><OL><LI><P><STRONG>Inconsistent Line Endings</STRONG>:</P><UL><LI>One common issue noted in a <A href="https://community.sap.com/t5/technology-blogs-by-sap/what-is-form-data-and-how-to-send-it-from-sap-cloud-platform-integration/ba-p/13443126" target="_new">blog post on SAP Community</A> is the discrepancy in line endings. It was observed that Postman on Windows creates "correct" line endings, while SAP Integration Suite often generates UNIX line endings, which some APIs cannot handle.</LI></UL></LI><LI><P><STRONG>Lack of Built-in Solution</STRONG>:</P><UL><LI>Checking the SAP roadmap, there is no built-in solution for this specific problem. You can review the latest updates <A href="https://roadmaps.sap.com/board?PRODUCT=73554900100800003241&range=CURRENT-LAST#Q3%202024" target="_new" rel="noreferrer noopener">here</A>.</LI></UL></LI></OL><H1 id="toc-hId-499249626">Solution</H1><P>When dealing with multipart/form-data in SAP Integration Suite, especially for systems that require strict adherence to standards and can only accept binary data, implementing a solution that meets these requirements can be challenging. Below is a script tailored to address these needs, ensuring proper handling of multipart/form-data with binary data.</P><H4 id="toc-hId-689984278">The Script</H4><P>Here's a script to handle multipart/form-data with binary attachments, adhering to RFC 2045 standards:</P><P> </P><pre class="lia-code-sample language-javascript"><code>import com.sap.gateway.ip.core.customdev.util.Message
import java.util.Map
import javax.activation.DataHandler
import java.util.Random
import java.io.ByteArrayOutputStream
// Method to process the data
def Message processData(Message message) {
// Extract attachments
Map<String, DataHandler> attachments = message.getAttachments()
// Check if there are any attachments in the message
if (attachments.isEmpty()) {
// No attachments, return the message unchanged or perform other logic
return message
} else {
def bodyBuilder = new ByteArrayOutputStream()
def boundary = generateBoundary()
// Iterate through all attachments
attachments.values().each { attachment ->
def content = attachment.getInputStream().bytes
// Ensure boundary is not within the attachment content
while (new String(content).contains(boundary)) {
boundary = generateBoundary()
}
// Add boundary delimiter
bodyBuilder.write("--${boundary}\r\n".getBytes())
// Add attachment headers
bodyBuilder.write("Content-Disposition: form-data; name=\"file\"; filename=\"${attachment.getName()}\"\r\n".getBytes())
bodyBuilder.write("Content-Type: application/pdf\r\n".getBytes()) // Adjust the content type as needed
bodyBuilder.write("\r\n".getBytes())
// Add the attachment content in binary form
bodyBuilder.write(content)
bodyBuilder.write("\r\n".getBytes())
}
// Closing boundary delimiter
bodyBuilder.write("--${boundary}--\r\n".getBytes())
// Set the Content-Type header
message.setHeader("Content-Type", "multipart/form-data; boundary=${boundary}")
// Set the message body
message.setBody(bodyBuilder.toByteArray())
return message
}
}
// Method to generate a random boundary
def String generateBoundary() {
def chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
def boundary = new StringBuilder("WebKitFormBoundary")
def rand = new Random()
(1..16).each {
boundary.append(chars.charAt(rand.nextInt(chars.length())))
}
return boundary.toString()
}</code></pre><P> </P><H4 id="toc-hId-493470773">Key Considerations</H4><OL><LI><P><STRONG>Binary Data Handling</STRONG>: The script ensures binary data is handled correctly by checking for boundaries within the attachment content and adjusting as necessary. This prevents issues with boundary markers appearing in the binary data.</P></LI><LI><P><STRONG>Boundary Handling</STRONG>: The generateBoundary() method creates a unique boundary string to separate parts of the multipart message. The script includes a check to avoid boundary collisions within the attachment content.</P></LI><LI><P><STRONG>Compliance with RFC 2045</STRONG>: While the script adheres to multipart/form-data standards, it’s important to note that escaping binary data using encoding (like base64) would be more compliant with RFC 2045 for handling non-ASCII data. However, for specific system constraints where binary data is required, this implementation meets those needs.</P></LI><LI><P><STRONG>Error Handling</STRONG>: The script does not include explicit error handling, which is crucial for production environments. Implement proper exception handling to manage issues such as file read errors or boundary generation failures.</P></LI></OL><H4 id="toc-hId-296957268">Additional Resources</H4><UL><LI><A href="https://community.sap.com/t5/technology-blogs-by-sap/what-is-form-data-and-how-to-send-it-from-sap-cloud-platform-integration/ba-p/13443126" target="_new">Blog on SAP Community about form-data and SAP Integration Suite</A></LI><LI><A href="https://community.sap.com/t5/technology-blogs-by-members/relationship-between-form-data-and-sap-cpi-successfactors-integration-with/ba-p/13540983" target="_new">Blog about SAP CPI and SuccessFactors integration using form-data</A></LI></UL><P>These resources provide valuable information and solutions, but this article presents a practical script to effectively address multipart/form-data challenges.</P>2024-08-01T11:20:20.448000+02:00https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-cpi-determining-expiring-certificates-dynamically-updating-and-sent/ba-p/13781244SAP CPI| Determining Expiring Certificates, Dynamically Updating And Sent Mail Notification2024-08-05T09:27:39.190000+02:00DenizZilyashttps://community.sap.com/t5/user/viewprofilepage/user-id/171723<H3 id="toc-hId-1151129251">Introduction:</H3><P><EM>The purpose of this blog : To identify certificates in the keystore with less than 30 days remaining until expiration and dynamically update all expiring certificates and send the updated certificate via email.</EM></P><P><STRONG><EM>Prerequired:</EM></STRONG></P><P><EM>SAP BTP and Integration Suite capabilities Cloud Integration.</EM></P><H5 id="toc-hId-1212781184"><STRONG>Cloud Integration Steps:</STRONG></H5><P>Firstly, I can trigger the process with a CPI service using POSTMAN or run it based on a time interval with a timer. I will proceed with the timer approach. If you prefer, you can set it to check every 15 days.<BR /><BR />Under normal circumstances, we check for expired certificates either when an error occurs in the integration or when we feel the need to verify their expiration status. Our goal is to have one or multiple certificates loaded into the keystore automatically updated at a predetermined time, ensuring that our processes no longer encounter errors due to certificate expiration.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_0-1722814113334.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146484iAD15446DC0D5DE24/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_0-1722814113334.png" alt="DenizZilyas_0-1722814113334.png" /></span></P><P> </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_1-1722814132095.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146485iA576EAA179A1112E/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_1-1722814132095.png" alt="DenizZilyas_1-1722814132095.png" /></span></P><P> </P><P> </P><P><STRONG>The API we will use: </STRONG><SPAN>https://{Account Short Name}-tmn.{SSL Host}.{region}.hana.ondemand.com/api/v1/KeystoreEntries</SPAN></P><P><SPAN>AND</SPAN></P><P><STRONG> </STRONG><SPAN>https://{Account Short Name}-tmn.{SSL Host}.{region}.hana.ondemand.com/api/v1/CertificateResources</SPAN></P><P><STRONG>1-CM_Headers</STRONG></P><P><SPAN>Our service works with a CSRF token, so we need to obtain the token first. In the initial content modifier, we store the request headers of the service.</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_2-1722601912045.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/145948i6FEC3DE8A06F58E4/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_2-1722601912045.png" alt="DenizZilyas_2-1722601912045.png" /></span></P><P><STRONG>2-RR_FetchToken</STRONG></P><P><SPAN>A defined user must access CPI as an authorized user. After defining security materials, credentials are provided in the flow.</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_0-1722810045388.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146460i47974812C902F513/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_0-1722810045388.png" alt="DenizZilyas_0-1722810045388.png" /></span></P><P><STRONG>3-RR_KeystoreEntries</STRONG></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_1-1722810078553.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146461i8E05CC246150CBC4/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_1-1722810078553.png" alt="DenizZilyas_1-1722810078553.png" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_2-1722810099489.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146462iE278D6DAA6D7DEA2/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_2-1722810099489.png" alt="DenizZilyas_2-1722810099489.png" /></span></P><P><STRONG>4-MM_KeystoreEntries</STRONG></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_3-1722810241143.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146463iF5A05B47440F2BBD/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_3-1722810241143.png" alt="DenizZilyas_3-1722810241143.png" /></span></P><P>The left side of the mapping is the XSD we created from the KeystoreEntries OData service. I previously shared information about which fields should be selected. The right side of the mapping is the XSD structure I want to output.</P><P> </P><P> </P><pre class="lia-code-sample language-markup"><code><xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="RootExpiring">
<xs:complexType>
<xs:sequence>
<xs:element name="RootExpiring" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="CertificateNumber" maxOccurs="unbounded" minOccurs="0"/>
<xs:element type="xs:string" name="CertificateName" maxOccurs="unbounded" minOccurs="0"/>
<xs:element type="xs:short" name="Validation" maxOccurs="unbounded" minOccurs="0"/>
<xs:element type="xs:string" name="Type" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema></code></pre><P> </P><P> </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_4-1722810284829.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146464iB82C368DB78F0982/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_4-1722810284829.png" alt="DenizZilyas_4-1722810284829.png" /></span></P><P>The Groovy script I use to identify certificates with less than 30 days remaining:</P><P> </P><P> </P><pre class="lia-code-sample language-java"><code>def String get30DaysAfter(String arg1){
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
Date dateNow= new Date()+30
return dateFormat.format(dateNow)+""
}</code></pre><P> </P><P> </P><P><STRONG>5-Router</STRONG></P><P>If there is no certificate that will expire after the mapping, the 'no update' will be observed and the flow will be escalated.</P><P><SPAN class="">//RootExpiring = ''</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_5-1722810402129.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146465i5CBC7EBB94C55FB2/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_5-1722810402129.png" alt="DenizZilyas_5-1722810402129.png" /></span></P><P><STRONG>6-</STRONG> <STRONG>CM_EscaleteProcess</STRONG></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_6-1722810460248.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146466i486AB12EC3D7FF58/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_6-1722810460248.png" alt="DenizZilyas_6-1722810460248.png" /></span></P><P><STRONG>7-Iterating Splitter</STRONG></P><P>In order to update multiple certificates, we need to split them based on RootExpiring. We will send them to the service one by one.</P><P> </P><P> </P><pre class="lia-code-sample language-markup"><code><RootExpiring>
<RootExpiring>
<CertificateNumber>x1</CertificateNumber>
<CertificateName>a</CertificateName>
<Validation>2024-02-21</Validation>
<Type>Certificate</Type>
</RootExpiring>
</RootExpiring>
<RootExpiring>
<CertificateNumber>x2</CertificateNumber>
<CertificateName>b</CertificateName>
<Validation>2024-02-21</Validation>
<Type>Certificate</Type>
</RootExpiring></code></pre><P> </P><P> </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_7-1722810501739.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146467i50DF2FE4AFF5151F/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_7-1722810501739.png" alt="DenizZilyas_7-1722810501739.png" /></span></P><P><STRONG>8-CM_Cert_Inf</STRONG></P><P>It will take the host address from the certificateName field. Therefore, when importing a certificate, we need to give the host address as the alias name.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_8-1722810562437.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146468i3E6945CF51CFD4B9/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_8-1722810562437.png" alt="DenizZilyas_8-1722810562437.png" /></span></P><P><STRONG>9-GS_Encoded</STRONG></P><P> </P><P> </P><pre class="lia-code-sample language-java"><code>import java.security.cert.X509Certificate
import java.util.Base64
import javax.net.ssl.SSLPeerUnverifiedException
import javax.net.ssl.SSLSession
import javax.net.ssl.SSLSocket
import javax.net.ssl.SSLSocketFactory
import com.sap.gateway.ip.core.customdev.util.Message
def processData(Message message) {
try {
// Get host and port from message properties
def host = message.getProperty("host") as String
def port = message.getProperty("port") as Integer
def factory = SSLSocketFactory.getDefault() as SSLSocketFactory
def socket = factory.createSocket(host, port) as SSLSocket
def session = socket.getSession()
X509Certificate cert = session.peerCertificates[0] as X509Certificate
def systemDomainName = cert.issuerDN.name
def encodedDERValue = Base64.getEncoder().encodeToString(cert.encoded)
// Set Properties
message.setProperty("systemDomainName", systemDomainName)
message.setProperty("encodedDERValue", encodedDERValue)
return message
} catch (SSLPeerUnverifiedException e) {
throw new Exception("${host} did not present a valid cert.")
}
}</code></pre><P> </P><P> </P><P><STRONG>10-CM_EncodedBody</STRONG></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_9-1722810939701.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146469i9DA70469A335B8A2/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_9-1722810939701.png" alt="DenizZilyas_9-1722810939701.png" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_10-1722810964505.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146470i39E2066AE9E87D37/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_10-1722810964505.png" alt="DenizZilyas_10-1722810964505.png" /></span></P><P><STRONG>11-RR_CertificateResources</STRONG></P><P><STRONG>fingerprintVerified=true:</STRONG></P><P>The true value indicates that the certificate fingerprint has been verified and is valid.</P><P><STRONG>returnKeystoreEntries=false:</STRONG></P><P>This setting determines whether keystore entries will be returned during a process or query. A false value means that the keystore records will not be returned as a result of the operation.</P><P><STRONG>update=true:</STRONG></P><P>if you want to update a certificate or configuration, this setting is set to true.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_11-1722811085021.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146471i11665866DE2D2460/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_11-1722811085021.png" alt="DenizZilyas_11-1722811085021.png" /></span></P><P>The CertificateNumber value we keep in the property was mapped with the hexalias field in the mapping. This way, we can obtain the hexalias values resulting from the mapping.</P><P>In the next step, there is a classic logging Groovy script.</P><P><STRONG>12-Iterating Splitter</STRONG></P><P>In the next step, I will adjust the fields in the latest build to format my mail properly.</P><P>I don't want the RooxExpiring field, which contains unwanted tags in the XML produced from the process call and my mail format. Therefore, I used a splitter and converted the XML to JSON.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_12-1722811676028.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146472i5F4BC82F41BDD062/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_12-1722811676028.png" alt="DenizZilyas_12-1722811676028.png" /></span></P><P><EM>Input: </EM></P><P> </P><P> </P><pre class="lia-code-sample language-markup"><code><RootExpiring>
<RootExpiring>
<CertificateNumber>x1</CertificateNumber>
<CertificateName>a</CertificateName>
<Validation>2024-02-21</Validation>
<Type>Certificate</Type>
</RootExpiring>
</RootExpiring>
</RootExpiring></code></pre><P> </P><P> </P><P><EM>Output After XML to JSON Converter</EM>:</P><P> </P><P> </P><pre class="lia-code-sample language-json"><code>{
"CertificateNumber": "x1",
"CertificateName": "a",
"Validation": "2024-02-21",
"Type": "Certificate"
}</code></pre><P> </P><P> </P><P><STRONG>13-GS_MailBody</STRONG></P><P> </P><P> </P><pre class="lia-code-sample language-java"><code>import com.sap.gateway.ip.core.customdev.util.Message;
import groovy.json.JsonSlurper;
def Message processData(Message message) {
// JSON body
def body = message.getBody(java.lang.String) as String;
// Parse JSON
def jsonSlurper = new JsonSlurper();
def jsonObj = jsonSlurper.parseText(body);
// Check if JSON parsing is successful
if (!jsonObj || !jsonObj.CertificateNumber || !jsonObj.CertificateName || !jsonObj.Validation || !jsonObj.Type) {
message.setBody("Error: JSON parsing failed or JSON structure is incorrect.");
return message;
}
// Build HTML table row
def tableRow = """
<tr>
<td>${jsonObj.CertificateNumber}</td>
<td>${jsonObj.CertificateName}</td>
<td>${jsonObj.Validation}</td>
<td>${jsonObj.Type}</td>
</tr>
"""
// Set the HTML body
def htmlBody = """
<html>
<head>
<style>
table {
width: 100%;
border-collapse: collapse;
}
th, td {
padding: 12px;
text-align: left;
border: 1px solid #ddd;
}
th {
background-color: #f2f2f2;
}
tbody tr:nth-child(even) {
background-color: #f9f9f9;
}
p {
color: #000000;
font-size: 16px;
}
h2 {
color: orange;
}
</style>
</head>
<body>
<p><i>Hi there!</i></p>
<p><i>This email is a validity notification for the certificate details below. Please review the certificate information.</i></p>
<br>
<h2>Certificate Information</h2>
<table>
<thead>
<tr>
<th>Certificate Number</th>
<th>Certificate Name</th>
<th>Validation</th>
<th>Type</th>
</tr>
</thead>
<tbody>
${tableRow}
</tbody>
</table>
<br>
<p><i>This mail is automatically generated. If you do not receive it properly, please contact your administrator.</i></p>
<br>
<i>Thanks & Regards,</i>
<br>
</body>
</html>
"""
// Set the transformed body
message.setBody(htmlBody);
return message;
}</code></pre><P> </P><P> </P><P><STRONG>14-Mail Adapter</STRONG></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_13-1722811959167.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146473i80FCD98F09A76565/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_13-1722811959167.png" alt="DenizZilyas_13-1722811959167.png" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_14-1722811973946.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146474iD4A94802B05BA7E9/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_14-1722811973946.png" alt="DenizZilyas_14-1722811973946.png" /></span></P><P>Let’s give it a try.</P><P>There are two expired certificates.</P><P><STRONG>Overview--> Manage Keystore</STRONG></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_0-1722812264258.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146475iD55F5564B4A33BAA/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_0-1722812264258.png" alt="DenizZilyas_0-1722812264258.png" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_1-1722812297381.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146476iAECE2A0E4336625A/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_1-1722812297381.png" alt="DenizZilyas_1-1722812297381.png" /></span></P><P><EM>Deployed flow and Let's check the keystore again.</EM></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_2-1722813593693.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146477i64405701E7DD4A3D/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_2-1722813593693.png" alt="DenizZilyas_2-1722813593693.png" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_3-1722813620018.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146478i750314A7F85F6904/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_3-1722813620018.png" alt="DenizZilyas_3-1722813620018.png" /></span></P><P><STRONG>Mail:</STRONG></P><P>I sent the emails based on the updated certificates. If you want, you can use gather to consolidate them into a single email format.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_4-1722813681512.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146479i715BFB8C940B49F5/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_4-1722813681512.png" alt="DenizZilyas_4-1722813681512.png" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_5-1722813702956.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146480iF190A8D9B0431160/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_5-1722813702956.png" alt="DenizZilyas_5-1722813702956.png" /></span></P><P>If no certificates to be updated are found, the flow is escalated.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DenizZilyas_8-1722813961801.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146483i1CA2A56A7724D218/image-size/large?v=v2&px=999" role="button" title="DenizZilyas_8-1722813961801.png" alt="DenizZilyas_8-1722813961801.png" /></span></P><P> </P><P> </P><P> </P><P> </P><P> </P><P> </P><P> </P><P> </P>2024-08-05T09:27:39.190000+02:00https://community.sap.com/t5/technology-blogs-by-members/automating-job-requisition-updates-from-position-object-with-sap-cpi/ba-p/13775536Automating Job Requisition Updates from Position Object with SAP CPI2024-08-05T16:52:37.330000+02:00Sarthak_Guptahttps://community.sap.com/t5/user/viewprofilepage/user-id/1544829<P><STRONG>Introduction</STRONG></P><P><SPAN>Managing job requisitions efficiently is the lifeblood of any organization's recruitment process. In a dynamic business environment where position data changes frequently, keeping job requisitions updated can be quite the challenge. But what if there was a way to make this process seamless and error-free? That's where SAP Cloud Platform Integration (CPI) and the `JobReqGOPosition` API come into play. In this blog, I’m excited to share how we harnessed these tools to automate job requisition updates and added a nifty feature for HR flexibility.</SPAN></P><P><STRONG>The Challenge</STRONG></P><P><SPAN>In any bustling organization, position data is in constant flux—be it due to promotions, role changes, or restructuring. Manually updating job requisitions to reflect these changes can be a painstakingly slow and error-prone process. As a SuccessFactors Consultant working with HR professionals, I know how crucial it is to maintain accurate job requisitions, but I also understand the necessity for occasional manual intervention. Balancing automation with manual control was the puzzle we needed to solve.</SPAN></P><P><STRONG>The Solution: SAP CPI and JobReqGOPosition API</STRONG></P><P><SPAN>To tackle this challenge, we turned to SAP CPI and the `JobReqGOPosition` API. This powerful duo ensures that any changes in position data automatically trigger updates in the corresponding job requisitions. Here’s how we crafted this solution, step by step:</SPAN></P><P><STRONG>Prerequisites</STRONG></P><P><SPAN>Before diving into the integration process, there are a few prerequisites to ensure smooth implementation:</SPAN></P><OL><LI><SPAN>Enabling </SPAN><STRONG>std_position_objlist</STRONG><SPAN>: The `</SPAN><STRONG>std_position_objlist</STRONG><SPAN>` must be enabled in the EC system, as it is the core element that the `</SPAN><STRONG>JobReqGOPosition</STRONG><SPAN>` API uses to fetch position-related information.</SPAN></LI><LI><SPAN>The client should use ‘</SPAN><STRONG>Position Management</STRONG><SPAN>’ to create requisitions, and the field for standard position object “</SPAN><STRONG>std_position_obj</STRONG><SPAN>” should be configured in the job requisition templates.</SPAN></LI><LI><SPAN>The integration was set up to run for full load, i.e., all the requisitions would be updated based on their correspond position related data. In case the recruiter/HR doesn’t want to update any specific requisition, it is recommended to do the following: Adding a "</SPAN><STRONG>Don’t Process Automatic Changes</STRONG><SPAN>" Custom Field. By including the custom field "</SPAN><STRONG>Don’t Process Automatic Changes</STRONG><SPAN>" in the Job Requisition Templates, recruiters can opt-out of automatic updates for specific requisitions they have manually edited.</SPAN></LI><LI><STRONG>Adjusting Mandatory Fields</STRONG><SPAN>: Some fields in the Job Requisition Templates may need to be made non-mandatory to avoid validation errors during the CPI upsert operation. This adjustment varies from template to template but essentially ensures that any mandatory fields which might be empty at the 'approved' stage do not cause errors.</SPAN></LI></OL><P><STRONG>Step-by-Step Integration Process</STRONG></P><P><STRONG>1. Fetching Job Requisitions</STRONG><SPAN>: We configured SAP CPI to fetch job requisitions from Employee Central (EC). The job requisition template includes the custom field "Don’t Process Automatic Changes," allowing HR to opt out of automatic updates for any requisitions they've manually edited. We then proceed to fetch</SPAN><STRONG> Position Information</STRONG><SPAN>: Using the `</SPAN><STRONG>std_position_objlist</STRONG><SPAN>`, we fetch the latest position data. This standard object list provided all the relevant information needed to keep job requisitions up-to-date. The following image is just an example for the fields we would update, hardcoded for a single requisition. This can be externalized with a manual mode for troubleshooting.</SPAN></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-07-24 162306.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/143502i339FE1661C8383FD/image-size/large?v=v2&px=999" role="button" title="Screenshot 2024-07-24 162306.png" alt="Screenshot 2024-07-24 162306.png" /></span>2. </SPAN><STRONG>Filtering Requisitions</STRONG><SPAN>: We ensured that any requisitions with the status not as "closed" or “approved” are filtered out, i.e. we are only updating job requisitions which have a status of “closed” or “approved” This has been done to ensure that any field validations due to unfilled pre-approved requisitions do not error out. Their position data would be synced once their status is changed to approved.</SPAN></P><P><STRONG>3. Message Mapping</STRONG><SPAN>: To ensure seamless data integration, we used message mapping to format the data correctly before updating EC. Once the position data is fetched, it is fed into the message mapping process as follows:.</SPAN></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-07-15 152940.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/143503i44E8F7FD2247E14E/image-size/large?v=v2&px=999" role="button" title="Screenshot 2024-07-15 152940.png" alt="Screenshot 2024-07-15 152940.png" /></span><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-07-15 152957.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/143504i324C036EFD3B162F/image-size/large?v=v2&px=999" role="button" title="Screenshot 2024-07-15 152957.png" alt="Screenshot 2024-07-15 152957.png" /></span></SPAN></P><P><STRONG>4. Updating Job Requisitions</STRONG><SPAN>: The transformed data is then upserted back to the relevant fields of the `</SPAN><STRONG>std_position_objlist</STRONG><SPAN>` in the </SPAN><STRONG>JobRequisitions</STRONG><SPAN> API. This ensures that job requisitions are always in sync with the latest position data.</SPAN></P><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-07-15 153020.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/143505i575305D80AF8462F/image-size/large?v=v2&px=999" role="button" title="Screenshot 2024-07-15 153020.png" alt="Screenshot 2024-07-15 153020.png" /></span></SPAN></P><P><STRONG>Limitations</STRONG></P><P><SPAN>While this integration is powerful, it’s important to be aware of certain limitations:</SPAN></P><OL><LI><STRONG>Status of Requisitions</STRONG><SPAN>: This solution works best for job requisitions in either 'approved' or 'closed' status. Open requisitions that are pending approval might not have all mandatory fields filled in, which can result in errors.</SPAN></LI><LI><STRONG>Handling Different Candidate Pools</STRONG><SPAN>: Care must be taken when expecting a different pool of employees than originally planned. Situations may arise where candidates have applied for a role or location that has since changed, potentially causing confusion or mismatches in expectations.</SPAN></LI></OL><P><STRONG>Benefits of This Approach</STRONG></P><OL><LI><STRONG>Automation</STRONG><SPAN>: This solution eliminates the need for manual updates, saving precious time and reducing the risk of errors. The integration can be scheduled as per the client’s wish - we recommend to run it every 15 minutes for quick syncing - this means that at max it may take 15 minutes for the requisition to get updated once changes have been made to the relevant position object.</SPAN></LI><LI><STRONG>Accuracy</STRONG><SPAN>: With automatic updates, job requisitions are always aligned with the latest position data.</SPAN></LI><LI><STRONG>Flexibility</STRONG><SPAN>: The custom field "Don’t Process Automatic Changes" allows HR to maintain manual control over specific requisitions when necessary.</SPAN></LI><LI><STRONG>Efficiency</STRONG><SPAN>: By streamlining the recruitment process, we ensure that job requisitions are always current and accurate.</SPAN></LI></OL><P><STRONG>Conclusion</STRONG></P><P><SPAN>Integrating SAP CPI with the `JobReqGOPosition` API has revolutionized how we manage job requisitions. By automating updates based on position changes and adding a flexible opt-out option for HR, we’ve struck the perfect balance between efficiency and control. This approach not only boosts operational efficiency but also ensures data accuracy and consistency across our HR systems.</SPAN></P><P><SPAN>If your organization faces similar challenges, consider leveraging SAP CPI and the `JobReqGOPosition` API—along with customized filters—to enhance your recruitment processes. This solution has truly transformed our clients' workflows, and I believe it can do the same for you.</SPAN></P><P><SPAN>For more detailed information, check out the [SAP Knowledge Base Article] (<A href="https://userapps.support.sap.com/sap/support/knowledge/en/2911099" target="_blank" rel="noopener noreferrer">https://userapps.support.sap.com/sap/support/knowledge/en/2911099</A>).</SPAN></P>2024-08-05T16:52:37.330000+02:00https://community.sap.com/t5/technology-blogs-by-members/filling-headers-or-properties-using-xslt-mapping-in-sap-cloud-integration/ba-p/13784816Filling Headers or Properties Using XSLT Mapping in SAP Cloud Integration2024-08-06T19:22:18.204000+02:00vbalko-claimatehttps://community.sap.com/t5/user/viewprofilepage/user-id/178477<H1 id="toc-hId-893058861">Introduction</H1><P class="">SAP Cloud Integration is a crucial tool for connecting various systems and applications, enabling seamless data flow and automation. One of the key features it offers is the ability to manipulate message content, headers, and properties using XSLT (Extensible Stylesheet Language Transformations). In this post, we’ll explore how to use XSLT to fill headers or properties, enhancing your integration scenarios.</P><H1 id="toc-hId-696545356">Understanding XSLT Mapping</H1><P class="">XSLT is a language designed for transforming XML documents. In SAP Cloud Integration, it allows for dynamic modifications to messages, including altering headers and properties. This capability is particularly useful for applying conditional logic or handling complex transformations that go beyond simple field mapping.</P><H1 id="toc-hId-500031851">Filling Headers or Properties</H1><P class="">Headers and properties in SAP Cloud Integration serve as essential metadata and custom key-value pairs, respectively. These elements can influence the routing and processing of messages. Using XSLT, you can set these values dynamically based on the message content, making your integration flows more adaptable and powerful.</P><H1 id="toc-hId-303518346">Step by step guide</H1><P class="">To set properties and headers using XSLT, follow these steps:</P><OL class=""><LI><STRONG>Specify the Namespace and Import Functions</STRONG></LI></OL><P class="">Define the XSLT stylesheet and include the<SPAN> </SPAN>cpi<SPAN> </SPAN>namespace for functions like<SPAN> </SPAN>setProperty<SPAN> </SPAN>and<SPAN> </SPAN>setHeader.</P><pre class="lia-code-sample language-abap"><code><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:cpi="http://sap.com/it/" exclude-result-prefixes="cpi" version="2.0"></code></pre><P class=""><STRONG>2. Include the Exchange Parameter</STRONG></P><P class="">This parameter is essential for setting properties and headers.</P><pre class="lia-code-sample language-abap"><code><xsl:param name="exchange"/></code></pre><P class=""><STRONG>3. Define Property and Header Parameters</STRONG></P><P class="">Import the properties and headers you want to set.</P><pre class="lia-code-sample language-abap"><code><xsl:param name="myProperty"/>
<xsl:param name="myHeader"/></code></pre><P class=""><STRONG>4. Create the XSLT Template</STRONG></P><P class="">Implement a template to set properties or headers based on conditions.</P><P> </P><pre class="lia-code-sample language-abap"><code><?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:cpi="http://sap.com/it/" exclude-result-prefixes="cpi" version="2.0">
<xsl:output method="xml" indent="yes"/>
<!-- include exchange parameter - must for setting props/headers -->
<xsl:param name="exchange"/>
<!-- define reference to prop/header -->
<xsl:param name="myProperty"/>
<xsl:param name="myHeader"/>
<!-- define template, which wont change body, but set prop/header -->
<xsl:template match="*">
<xsl:choose>
<xsl:when test="contains(//elem1, 'something')">
<xsl:value-of select="cpi:setProperty($exchange, 'myPropert', 'some')"/>
</xsl:when>
<xsl:when test="contains(//elem1, 'somethingElse')">
<xsl:value-of select="cpi:setHeader($exchange, 'myHeader', 'H1')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="cpi:setProperty($exchange, 'myPropert', 'Unknown')"/>
<xsl:value-of select="cpi:setHeader($exchange, 'myHeader', 'Unknown')"/>
</xsl:otherwise>
</xsl:choose>
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet></code></pre><P> </P><P class=""><STRONG>5. Alternative Methods</STRONG></P><P class="">Content Modifiers with XPath can set properties and headers, but they lack the advanced logic capabilities of XSLT.</P><H1 id="toc-hId-107004841">Common Challenges and Solutions</H1><P class="">Working with XSLT can be challenging due to its syntax and the complexity of debugging. Here are some solutions to ease these challenges:</P><UL class=""><LI><STRONG>Use an IDE</STRONG>: While integrated development environments (IDEs) like Oxygen XML Editor or Visual Studio Code offer excellent debugging and visualization features, they can sometimes feel bulky and overwhelming, especially for simple tasks.</LI><LI><STRONG>Online Tools</STRONG>: There are many powerful and convenient online tools for working with XSLT, such as<SPAN> </SPAN><A class="" href="http://xsltransform.net/" target="_blank" rel="noopener ugc nofollow noreferrer">xsltransform.net</A>. These tools allow you to test and refine your XSLT transformations without the need for a full-fledged IDE. They are particularly useful for quick testing and debugging, making them a great choice when you want to avoid setting up a more complex environment.</LI><LI><STRONG>Start Simple</STRONG>: Begin with basic transformations and gradually introduce more complexity. This approach makes it easier to isolate and fix issues as they arise.</LI><LI><STRONG>Test Thoroughly</STRONG>: Ensure your XSLT mappings are robust by testing with various input scenarios. This practice helps catch edge cases and unexpected behaviors.</LI></UL><H1 id="toc-hId--89508664">Best Practices</H1><P class="">To write efficient and maintainable XSLT mappings:</P><UL class=""><LI><STRONG>Modularity</STRONG>: Break complex logic into smaller templates.</LI><LI><STRONG>Performance</STRONG>: Optimize transformations and avoid redundant calculations.</LI><LI><STRONG>Security</STRONG>: Validate and sanitize input data, especially for sensitive information.</LI></UL><H1 id="toc-hId--286022169">Conclusion</H1><P class="">XSLT mapping in SAP Cloud Integration provides a powerful way to manipulate message content, headers, and properties. This technique offers flexibility and advanced capabilities, making it a valuable tool for complex integration scenarios. Whether you’re setting custom properties or routing messages based on dynamic criteria, XSLT can significantly enhance your integration flows.</P><P class=""><EM><STRONG>DISCLAIMER:</STRONG> </EM>This blog post can be found also on my other <A href="https://medium.com/@vbalko/filling-headers-or-properties-using-xslt-mapping-in-sap-cloud-integration-ae977c74ba4d" target="_blank" rel="noopener nofollow noreferrer">blog</A> </P>2024-08-06T19:22:18.204000+02:00https://community.sap.com/t5/enterprise-architecture-blog-posts/servicenow-snow-integration-using-open-connectors-in-sap-ci/ba-p/13774255ServiceNow (SNOW) Integration using Open Connectors in SAP CI2024-08-07T22:04:25.088000+02:00Krutika_Morehttps://community.sap.com/t5/user/viewprofilepage/user-id/1397612<P><FONT face="arial,helvetica,sans-serif">Lengthy yet interesting blog! </FONT><span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:">😊</span></P><P><FONT face="arial,helvetica,sans-serif"><STRONG>Contents/Agenda:</STRONG></FONT></P><UL class="lia-list-style-type-square"><LI><FONT face="arial,helvetica,sans-serif">Introduction to ServiceNow</FONT></LI><LI><FONT face="arial,helvetica,sans-serif">Introduction to SAP OpenConnectors</FONT></LI><LI><FONT face="arial,helvetica,sans-serif">ServiceNow Configuration</FONT></LI><LI><FONT face="arial,helvetica,sans-serif">OpenConnectors Configuration</FONT></LI><LI><FONT face="arial,helvetica,sans-serif">SAP CI IFlow Scenario & Steps</FONT></LI><LI><FONT face="arial,helvetica,sans-serif">Conclusion & Incident Record in ServiceNow</FONT></LI></UL><P><FONT face="arial,helvetica,sans-serif"><STRONG>1. Introduction to ServiceNow (SNOW): </STRONG></FONT></P><UL><LI><FONT face="arial,helvetica,sans-serif"><U>What is ServiceNow?<BR /></U>- ServiceNow is a cloud-based platform that provides enterprises IT Service Management (ITSM).</FONT><BR /><FONT face="arial,helvetica,sans-serif">- It is designed to automate and streamline IT service delivery processes.</FONT></LI></UL><UL><LI><FONT face="arial,helvetica,sans-serif"><U>Key Features:<BR /></U>- Incident Management</FONT><BR /><FONT face="arial,helvetica,sans-serif">- Problem Management</FONT><BR /><FONT face="arial,helvetica,sans-serif">- Change Management, etc.</FONT></LI></UL><P><FONT face="arial,helvetica,sans-serif"><STRONG>2. Introduction to SAP OpenConnectors:</STRONG></FONT></P><UL><LI><FONT face="arial,helvetica,sans-serif"><U>What is OpenConnectors?<BR /></U>- Open Connectors are part of the SAP Integration Suite, designed to simplify the process of connecting with third-party applications.</FONT><BR /><FONT face="arial,helvetica,sans-serif">- They provide pre-built, standardized connectors that enables seamless integration.</FONT></LI></UL><UL><LI><FONT face="arial,helvetica,sans-serif"><U>Key Features:<BR /></U>- Pre-Built Connectors</FONT><BR /><FONT face="arial,helvetica,sans-serif">- Unified API, etc.</FONT></LI></UL><P><FONT face="arial,helvetica,sans-serif"><STRONG>3. ServiceNow Configuration: </STRONG></FONT></P><P>Log in to the ServiceNow developer (<A href="https://developer.servicenow.com/dev.do" target="_self" rel="nofollow noopener noreferrer">https://developer.servicenow.com/dev.do</A>) portal and create an instance.<BR />You will get the instance URL: https://<instance_name>.service-now.com, Username and Password.<BR />Once the Instance is created and you log in to the ServiceNow tool, your screen should look like below.</P><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_0-1722693181339.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146222iAF2697E127B146EC/image-size/large?v=v2&px=999" role="button" title="Krutika_More_0-1722693181339.png" alt="Krutika_More_0-1722693181339.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif">In the Filter Navigator search bar, search for OAuth and click on Application Registry.</FONT></P><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_1-1722693212087.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146223iA3749B29EEB56828/image-size/large?v=v2&px=999" role="button" title="Krutika_More_1-1722693212087.png" alt="Krutika_More_1-1722693212087.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif">Now click on New --> Select “Create an OAuth API endpoint for external clients”.</FONT></P><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_2-1722693259064.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146225i8AFF98FDBC782154/image-size/large?v=v2&px=999" role="button" title="Krutika_More_2-1722693259064.png" alt="Krutika_More_2-1722693259064.png" /></span><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_3-1722693265568.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146226iACFC1ADDD1929F13/image-size/large?v=v2&px=999" role="button" title="Krutika_More_3-1722693265568.png" alt="Krutika_More_3-1722693265568.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif">Enter the OAuth details and click on Submit:</FONT></P><OL><LI><FONT face="arial,helvetica,sans-serif">Enter the Name.</FONT></LI><LI><FONT face="arial,helvetica,sans-serif">Enter the Redirect URL: <A title="https://auth.cloudelements.io/oauth" href="https://auth.cloudelements.io/oauth" target="_blank" rel="noopener noreferrer nofollow">https://auth.cloudelements.io/oauth</A></FONT></LI><LI><FONT face="arial,helvetica,sans-serif">Client ID will be auto generated.</FONT></LI><LI><FONT face="arial,helvetica,sans-serif">Client Secret will be auto generated when you submit the OAuth details.</FONT></LI></OL><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_4-1722693311833.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146227i44C69A19F5D5F3C6/image-size/large?v=v2&px=999" role="button" title="Krutika_More_4-1722693311833.png" alt="Krutika_More_4-1722693311833.png" /></span></FONT></P><UL class="lia-list-style-type-square"><LI><FONT face="arial,helvetica,sans-serif">Note down the Client ID and Client Secret.</FONT></LI></UL><P><FONT face="arial,helvetica,sans-serif">Create Users and Groups (assign team members to their respective groups).</FONT></P><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_5-1722693399008.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146228i4DBB725B7E8CA8C6/image-size/large?v=v2&px=999" role="button" title="Krutika_More_5-1722693399008.png" alt="Krutika_More_5-1722693399008.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif"><STRONG>4. OpenConnectors Configuration:</STRONG></FONT></P><P><FONT face="arial,helvetica,sans-serif">Log in to OpenConnectors and configure the ServiceNow OAuth connector.</FONT></P><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_0-1722693911867.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146231i62B1969283533346/image-size/large?v=v2&px=999" role="button" title="Krutika_More_0-1722693911867.png" alt="Krutika_More_0-1722693911867.png" /></span><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_1-1722693920717.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146232iC2FA5891181C8FB8/image-size/large?v=v2&px=999" role="button" title="Krutika_More_1-1722693920717.png" alt="Krutika_More_1-1722693920717.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif">Enter the ServiceNow details in the tab below and click on Create Instance.</FONT></P><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_2-1722693934452.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146233i68C4956E1AB3842B/image-size/large?v=v2&px=999" role="button" title="Krutika_More_2-1722693934452.png" alt="Krutika_More_2-1722693934452.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif">You will now be redirected the screen below.</FONT></P><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_3-1722693954248.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146234iEB75D564526ECDA9/image-size/large?v=v2&px=999" role="button" title="Krutika_More_3-1722693954248.png" alt="Krutika_More_3-1722693954248.png" /></span></FONT><FONT face="arial,helvetica,sans-serif">The ServiceNow instance is ready, and we can test it. </FONT><span class="lia-unicode-emoji" title=":backhand_index_pointing_up:">👆</span></P><P><FONT face="arial,helvetica,sans-serif">Click on Instances --> API Docs.</FONT></P><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_7-1722694167694.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146238i2E08844E2A0EB3FE/image-size/large?v=v2&px=999" role="button" title="Krutika_More_7-1722694167694.png" alt="Krutika_More_7-1722694167694.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif">Scroll to the ping section and click on Try it out.</FONT></P><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_6-1722694124561.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146237iB6DB718310B3F5EF/image-size/large?v=v2&px=999" role="button" title="Krutika_More_6-1722694124561.png" alt="Krutika_More_6-1722694124561.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif">Click on Execute.</FONT></P><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_4-1722693976981.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146235iD7BF3F450FD366C7/image-size/large?v=v2&px=999" role="button" title="Krutika_More_4-1722693976981.png" alt="Krutika_More_4-1722693976981.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif">You can see the response below. SNOW Instance is reachable from OpenConnectors.</FONT></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_0-1722771914009.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146345i6936D5F88F991786/image-size/large?v=v2&px=999" role="button" title="Krutika_More_0-1722771914009.png" alt="Krutika_More_0-1722771914009.png" /></span></P><P><FONT face="arial,helvetica,sans-serif"><STRONG>5. SAP CI </STRONG><STRONG>IFlow</STRONG><STRONG> Scenario: </STRONG>Create an IFlow using a timer and simple 1:1 mapping for testing convenience.</FONT><BR /><FONT face="arial,helvetica,sans-serif">When the message fails, a ticket will be assigned to CI.</FONT><BR /><FONT face="arial,helvetica,sans-serif">The CI team can then take appropriate actions on the ticket.</FONT></P><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_0-1722768072023.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146314i416E60AC2D63312E/image-size/large?v=v2&px=999" role="button" title="Krutika_More_0-1722768072023.png" alt="Krutika_More_0-1722768072023.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif"><U>Step 1:</U> Use Timer --> To trigger the interface.</FONT></P><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_1-1722768110269.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146315i5551CC453674F9EF/image-size/large?v=v2&px=999" role="button" title="Krutika_More_1-1722768110269.png" alt="Krutika_More_1-1722768110269.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif"><U>Step 2:</U> Set interface priority and Save XML Payload</FONT></P><UL><LI><FONT face="arial,helvetica,sans-serif"><U>2.1:</U> In the Content Modifier, set the interface priority under the header. </FONT></LI></UL><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_0-1722771319633.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146344i7BA8C79F2D62C144/image-size/large?v=v2&px=999" role="button" title="Krutika_More_0-1722771319633.png" alt="Krutika_More_0-1722771319633.png" /></span></FONT></P><UL><LI><FONT face="arial,helvetica,sans-serif"><U>2.2:</U> Save the XML payload in the message body.</FONT></LI></UL><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_2-1722768811204.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146323i52CCA11793E22D64/image-size/large?v=v2&px=999" role="button" title="Krutika_More_2-1722768811204.png" alt="Krutika_More_2-1722768811204.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif"><U>Step 3:</U> Message Mapping: Map source and target fields (1:1). As we are not passing the “heading” field (refer to step 2.2), the mapping will fail.</FONT></P><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_2-1722768318010.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146318i1C05E81994E0F830/image-size/large?v=v2&px=999" role="button" title="Krutika_More_2-1722768318010.png" alt="Krutika_More_2-1722768318010.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_3-1722768327082.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146319i6EB040D79B477605/image-size/large?v=v2&px=999" role="button" title="Krutika_More_3-1722768327082.png" alt="Krutika_More_3-1722768327082.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif"><U><STRONG>Exception Subprocess:</STRONG></U> In the event of mapping failure, the Exception Subprocess will be triggered.</FONT></P><P><FONT face="arial,helvetica,sans-serif"><U>Step 1:</U> Use Error Start Event --> To trigger the Exception Subprocess.</FONT></P><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_0-1722768634748.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146321iA40E7CD1DE9DB1D3/image-size/large?v=v2&px=999" role="button" title="Krutika_More_0-1722768634748.png" alt="Krutika_More_0-1722768634748.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif"><U><STRONG>Step 2:</STRONG></U> Configure the Content Modifier for assigning tickets to different team members.</FONT></P><UL><LI><FONT face="arial,helvetica,sans-serif"> <U>2.1:</U> Set the header in the content modifier (Ticket assigned to team members).</FONT></LI></UL><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_0-1722768232366.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146316i43DFDF2F55DB7E3D/image-size/large?v=v2&px=999" role="button" title="Krutika_More_0-1722768232366.png" alt="Krutika_More_0-1722768232366.png" /></span></FONT></P><UL><LI><FONT face="arial,helvetica,sans-serif"> <U>2.2:</U> Navigate to the message body, set the type as expression and maintain the below XML data.</FONT></LI></UL><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_1-1722768265138.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146317iA91992BBDFC0817C/image-size/large?v=v2&px=999" role="button" title="Krutika_More_1-1722768265138.png" alt="Krutika_More_1-1722768265138.png" /></span></FONT></P><UL><LI><FONT face="arial,helvetica,sans-serif"><U>2.3:</U> In message mapping, map the “assigned to” field using fixValues (maintain the team members under the Advanced tab) mapping function.</FONT><BR /><FONT face="arial,helvetica,sans-serif">Tickets will be assigned to different team members. For example, the first failed message will assign a ticket to the first team member listed in the fixValues.</FONT></LI></UL><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_0-1722770079521.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146336iFC4DDA59F462E695/image-size/large?v=v2&px=999" role="button" title="Krutika_More_0-1722770079521.png" alt="Krutika_More_0-1722770079521.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_2-1722770222144.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146338iBD2842C33287295A/image-size/large?v=v2&px=999" role="button" title="Krutika_More_2-1722770222144.png" alt="Krutika_More_2-1722770222144.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif">Maintain the number ranges under Security Material as shown below.</FONT></P><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_0-1722770408488.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146339i37A6B0F797C5F25D/image-size/large?v=v2&px=999" role="button" title="Krutika_More_0-1722770408488.png" alt="Krutika_More_0-1722770408488.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif"><U><STRONG>Step 3:</STRONG></U> Configure Content Modifier for Incident creation</FONT></P><UL><LI><FONT face="arial,helvetica,sans-serif"><U>3.1:</U> Set headers in the content modifier as shown below.</FONT></LI></UL><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_0-1722768974686.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146324i7D34A396F52D9B2C/image-size/large?v=v2&px=999" role="button" title="Krutika_More_0-1722768974686.png" alt="Krutika_More_0-1722768974686.png" /></span></FONT></P><UL><LI><FONT face="arial,helvetica,sans-serif"><U>3.2:</U> Navigate to the Message Body tab, set the Type as Expression and maintain the provided code as the body (Obtained from OpenConnectors --> Instances --> API Docs --> Scroll to incidents (POST) --> Try it out --> Execute)</FONT></LI></UL><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_2-1722769026523.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146326i42B215997D45B183/image-size/large?v=v2&px=999" role="button" title="Krutika_More_2-1722769026523.png" alt="Krutika_More_2-1722769026523.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif"><U>Code:</U></FONT></P><P><FONT face="arial,helvetica,sans-serif"><?xml version="1.0" encoding="UTF-8" ?></FONT><BR /><FONT face="arial,helvetica,sans-serif"><root></FONT><BR /><FONT face="arial,helvetica,sans-serif"><active>true</active></FONT><BR /><FONT face="arial,helvetica,sans-serif"><assigned_to>${header.user}</assigned_to></FONT><BR /><FONT face="arial,helvetica,sans-serif"><activity_due>${date:now:dd-MM-yyyy HH:mm}</activity_due></FONT><BR /><FONT face="arial,helvetica,sans-serif"><assignment_group>CPI_Support</assignment_group></FONT><BR /><FONT face="arial,helvetica,sans-serif"><business_duration>${date:now:dd-MM-yyyy HH:mm}</business_duration></FONT><BR /><FONT face="arial,helvetica,sans-serif"><caller_id>CPI User</caller_id></FONT><BR /><FONT face="arial,helvetica,sans-serif"><closed_at>${date:property.CamelCreatedTimestamp+48h}</closed_at></FONT><BR /><BR /><FONT face="arial,helvetica,sans-serif"><description></FONT><BR /><FONT face="arial,helvetica,sans-serif">Alert Time : ${date:now:dd-MM-yyyy HH:mm} UTC</FONT><BR /><FONT face="arial,helvetica,sans-serif">Message ID : ${property.SAP_MessageProcessingLogID} </FONT><BR /><FONT face="arial,helvetica,sans-serif">Service Name : SAP CI</FONT><BR /><FONT face="arial,helvetica,sans-serif">Interface : ${header.Interface_Name}</FONT><BR /><FONT face="arial,helvetica,sans-serif">**</FONT><BR /><FONT face="arial,helvetica,sans-serif">Error Details : ${header.Error_Details} </FONT><BR /><FONT face="arial,helvetica,sans-serif">Message Details: <Messages: SAP CPI tenant URL></FONT><BR /><FONT face="arial,helvetica,sans-serif"></description></FONT><BR /><FONT face="arial,helvetica,sans-serif"><impact>${header.Priority}</impact></FONT><BR /><FONT face="arial,helvetica,sans-serif"><knowledge>true</knowledge></FONT><BR /><FONT face="arial,helvetica,sans-serif"><made_sla>true</made_sla></FONT><BR /><FONT face="arial,helvetica,sans-serif"><opened_at>${date:now:dd-MM-yyyy HH:mm}</opened_at></FONT><BR /><FONT face="arial,helvetica,sans-serif"><service>CPI Production</service></FONT><BR /><FONT face="arial,helvetica,sans-serif"><short_description>CPI alert for ${header.Interface_Name}</short_description></FONT><BR /><FONT face="arial,helvetica,sans-serif"><state>In Progress</state></FONT><BR /><FONT face="arial,helvetica,sans-serif"><subcategory>Internal Application</subcategory></FONT><BR /><FONT face="arial,helvetica,sans-serif"><urgency>${header.Priority}</urgency></FONT><BR /><FONT face="arial,helvetica,sans-serif"><work_start>${date:now:dd-MM-yyyy HH:mm}</work_start></FONT><BR /><FONT face="arial,helvetica,sans-serif"></root></FONT></P><P><FONT face="arial,helvetica,sans-serif"><U><STRONG>Step 4:</STRONG></U> Convert XML to JSON</FONT><BR /><FONT face="arial,helvetica,sans-serif">Use a converter to change the XML data to JSON since Open Connectors accepts only JSON data.</FONT></P><P><FONT face="arial,helvetica,sans-serif"><STRONG><U>Step 5:</U></STRONG> Request Reply to ServiceNow</FONT><BR /><FONT face="arial,helvetica,sans-serif">Use the request reply step to send and receive incident details back from ServiceNow.</FONT></P><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_3-1722769164922.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146328i9F357FEF4AB428DA/image-size/large?v=v2&px=999" role="button" title="Krutika_More_3-1722769164922.png" alt="Krutika_More_3-1722769164922.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif"><U><STRONG>Step 6:</STRONG></U> Configure Open Connectors Adapter.</FONT><BR /><FONT face="arial,helvetica,sans-serif">In the connection tab of Open Connectors adapter, do the configuration as shown below.</FONT></P><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_1-1722770466050.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146340i0138F020006E162B/image-size/large?v=v2&px=999" role="button" title="Krutika_More_1-1722770466050.png" alt="Krutika_More_1-1722770466050.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_0-1722770575940.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146341i5B8A1714C34166E6/image-size/large?v=v2&px=999" role="button" title="Krutika_More_0-1722770575940.png" alt="Krutika_More_0-1722770575940.png" /></span></FONT></P><UL class="lia-list-style-type-circle"><LI><FONT face="arial,helvetica,sans-serif">How to configure the <STRONG>Credential Name</STRONG> for Open Connectors?</FONT><BR /><FONT face="arial,helvetica,sans-serif">Navigate to the Monitor tab in CI: Monitor --> Manage Security Material --> Create --> User Credentials --> Deploy</FONT></LI></UL><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_0-1722769680740.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146334i47846E0682D768B0/image-size/large?v=v2&px=999" role="button" title="Krutika_More_0-1722769680740.png" alt="Krutika_More_0-1722769680740.png" /></span></FONT></P><UL class="lia-list-style-type-square"><LI><FONT face="arial,helvetica,sans-serif"><EM>Note:</EM> Exclude the commas and space while entering the values in user credentials.</FONT></LI></UL><P><FONT face="arial,helvetica,sans-serif"><U><STRONG>Step 7:</STRONG></U> End the Flow.</FONT></P><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_0-1722769793925.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146335iBF2ED697B9AA862F/image-size/large?v=v2&px=999" role="button" title="Krutika_More_0-1722769793925.png" alt="Krutika_More_0-1722769793925.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif"><U>Deploy the IFlow:</U> Once deployed, the message will fail in the mapping step, triggering the exception subprocess to send the message OpenConnectors.</FONT></P><P><FONT face="arial,helvetica,sans-serif"><STRONG>6. Conclusion & Incident Record in ServiceNow: </STRONG>With this approach, incident creation is automated based on failures.</FONT></P><P><FONT face="arial,helvetica,sans-serif">A new incident can be seen in ServiceNow.</FONT></P><P><FONT face="arial,helvetica,sans-serif"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Krutika_More_1-1722693796926.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/146230i4DE5ED1DF3253A4A/image-size/large?v=v2&px=999" role="button" title="Krutika_More_1-1722693796926.png" alt="Krutika_More_1-1722693796926.png" /></span></FONT></P><P><FONT face="arial,helvetica,sans-serif"><SPAN>Thank you very much!</SPAN></FONT></P><P><FONT face="arial,helvetica,sans-serif"><SPAN><STRONG>Keep blogging!!</STRONG> <span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:">😊</span></SPAN><SPAN> Feel free to post your queries, and I'll be more than happy to help resolve them.</SPAN> </FONT></P>2024-08-07T22:04:25.088000+02:00https://community.sap.com/t5/technology-blogs-by-sap/new-pipeline-concept-features-new-partner-id-definition-alternative-partner/ba-p/13787400New Pipeline Concept features: new partner id definition, alternative partner, bypass option2024-08-08T19:28:05.370000+02:00alex_bundschuhhttps://community.sap.com/t5/user/viewprofilepage/user-id/45178<P>Here comes another new version 1.0.6 of the <A href="https://community.sap.com/t5/technology-blogs-by-sap/introducing-the-new-pipeline-concept-in-cloud-integration/ba-p/13639651" target="_blank">Pipeline Concept</A> were we introduced a couple of new features. The package can be accessed from the <A href="https://hub.sap.com/package/PIPipelineGenericIntegrationFlows/integrationflow" target="_blank" rel="noopener noreferrer">SAP Business Accelerator Hub</A>. If you have already copied the package to your workspace in your SAP Integration Suite tenant, you can simply run the update of the package to be able to use the latest features.</P><P><STRONG>Upfront, I like to give a warning.</STRONG> We had to introduce an incompatible change of how we define the partner ID to retrieve the Partner Directory parameters, actually this applies to the XSLT for determining the interfaces only. The rest of the Partner Directory definitions are not impacted unless you like to go for the new feature using alternative partner which we would actually recommend.</P><P>Before getting into detail for some of the new features, here all new features at a glance:</P><UL><LI>Revised partner id approach due to lengths restrictions of the partner id</LI><LI>Option to use alternative partner in case of sender wildcard scenarios and to overcome partner id restrictions</LI><LI>Changed default max retry to 5 instead of unlimited retry</LI><LI>For messages in test mode, failed messages are not put into retry</LI><LI>For generic integration flows, adapter parameters were externalized</LI><LI>Option to configure message end event type in case of message stored in dead letter queue, default is Escalated</LI><LI>Option to bypass receiver determination and interface determination steps in case of Point-to-Point pattern</LI><LI>Option to configure a pipeline JMS queue prefix which makes configuration of queue names easier if you create another set of generic integration flow</LI></UL><P>Furthermore, I like to point you to a new <A href="https://github.com/peasantsboot/ProcessIntegrationPipelineSampleScenarios" target="_blank" rel="noopener nofollow noreferrer">github repository</A> were we describe how to setup the Pipeline for Cloud Integration for a couple of sample scenarios.</P><H2 id="toc-hId-1022227072">New partner ID definition incl alternative partner</H2><P>Due to the length restriction of the partner ID of 60 characters for retrieving string and XSLT parameters from the Partner Directory, there was a risk of exceeding this limit so that the creation of the Partner Directory entries may fail. This especially applies for IDoc messages where we combine message type, IDoc type and extension type as well as for the partner ID for retrieving the interface Determination XSLT which was a combination of sender component, sender interface and receiver component.</P><P>For this reason, we had to change the partner ID definition for retrieving the interface determination XSLT. Furthermore, we introduced the support for alternative partners to generally overcome the length restrictions.</P><P>With the <STRONG>alternative partner</STRONG> support, you have the option to map the sender component and the sender interface to a partner ID of your choice, the partner ID might be an integration scenario name. There are lengths restrictions for agency (120 chars), scheme (120 chars) and id (255 chars) as well but in practice it’s very unlikely that you will exceed this. If a message enters the pipeline, we first check if an alternative partner exists, in this case we use the mapped partner ID. Otherwise, the old partner ID approach is used which combines sender component and sender interface separated by ~. So, you can stick to the old approach but you need to ensure that it doesn’t exceed 60 characters.</P><P>For the interface determination, we used to define the partner ID as combination of sender component, sender interface and receiver component, all separated by ~. The id was defined as constant string <EM>interfaceDetermination</EM>. With the new version, we now use the same partner ID like for any other Partner Directory parameters, so either the partner ID from the alternative partner or the combined sender component and sender interface. For the id, we now concatenate the constant string <EM>interfaceDetermination</EM> and the <EM>receiver component</EM> separated by underscore _.</P><P><U>Here's an example for better understanding:</U></P><P>Assuming, a message of interface <EM>MaterialCreate</EM> is sent from sender <EM>ABC</EM> and routed to two receivers <EM>XYZ</EM> and <EM>UVW</EM>. Your scenario is called <EM>MaterialMasterReplicate</EM>.</P><P>We define the alternative partner as follows:</P><UL><LI>Agency: <EM>ABC</EM></LI><LI>Scheme: <EM>SenderInterface</EM> (this is a fixed string)</LI><LI>Id: <EM>MaterialCreate</EM></LI><LI>Pid: <EM>MaterialMasterReplicate</EM></LI></UL><P>For the receiver determination, the key to upload and retrieve the XSLT is as follows:</P><UL><LI>Pid: <EM>MaterialMasterReplicate</EM></LI><LI>Id: <EM>receiverDetermination</EM></LI></UL><P>For the interface determination for receiver XYZ, the key to upload and retrieve the XSLT is as follows:</P><UL><LI>Pid: <EM>MaterialMasterReplicate</EM></LI><LI>Id: <EM>interfaceDetermination_XYZ</EM></LI></UL><P>For the interface determination for receiver UVW, the key to upload and retrieve the XSLT is as follows:</P><UL><LI>Pid: <EM>MaterialMasterReplicate</EM></LI><LI>Id: <EM>interfaceDetermination_UVW</EM></LI></UL><P>The alternative partner approach is not mandatory however we strongly recommend to use this approach for the following reasons:</P><UL><LI>In practice, it avoids exceeding the lengths restrictions in any case</LI><LI>It groups together all your Partner Directory parameters which belong to the same integration scenario using a meaningful scenario name</LI><LI>It supports sender wildcard scenarios out of the box because it allows to map multiple sender systems to the same partner ID</LI></UL><P>Before you update your package and re-deploy the generic integration flows, ensure to update your Partner Directory entries accordingly.</P><P>See <A href="https://help.sap.com/docs/MIGRATION_GUIDE_PO/90c8ad90cb684ee5979856093efe7462/9ec7d2dce72d423abff80543f11b2091.html" target="_blank" rel="noopener noreferrer">Using the Partner Directory in the Pipeline Concept</A>.</P><H2 id="toc-hId-825713567">Special case: Point-to-Point scenarios</H2><P>For Point-to-Point scenarios where we have one sender and one receiver only, we now have the <STRONG>option to bypass</STRONG> the two pipeline steps receiver determination and interface determination which at the end leads to an improved runtime behavior.</P><P>In this case, we won't upload the XSLTs to the Partner Directory, instead we need to define two corresponding string parameters <EM>receiverDetermination</EM> and <EM>interfaceDetermination_<receiver name></EM>. Former defines the receiver name, and latter the ProcessDirect endpoint of the scenario-specific outbound processing flow.</P><P>For more details, see <A href="https://help.sap.com/docs/MIGRATION_GUIDE_PO/90c8ad90cb684ee5979856093efe7462/1606af9b55bf4391bea01d2f7ee112af.html" target="_blank" rel="noopener noreferrer">Special Cases</A>.</P><H2 id="toc-hId-629200062">Retry handling enhancements</H2><P>For the retry handling, we have changed the <STRONG>default maximum retry</STRONG> from unlimited to <EM>5</EM>. The default applies if you have not maintained a scenario specific maximum retry.</P><P>If the maximum retry exceeds, the messages are stored in a dead letter queue. For the standard retry handling you now have the option to <STRONG>configure the message end event type</STRONG> in case of messages stored in the dead letter queue. The default is <EM>Escalated</EM>. Optionally, you can change the type to <EM>Completed</EM>.</P><P>Furthermore, for messages in <STRONG>test mode</STRONG>, i.e., were the <EM>testMode</EM> header is true, failed messages are not put into retry, instead they are completed with custom status <EM>ErrorInTestMode</EM>.</P><P>See <A href="https://help.sap.com/docs/MIGRATION_GUIDE_PO/90c8ad90cb684ee5979856093efe7462/ed9b82cb928049e6990a4d784aa6aac7.html#standard-retry-handling" target="_blank" rel="noopener noreferrer">Standard Retry Handling</A>.</P><H2 id="toc-hId-432686557">New github repository with sample scenarios</H2><P>If you like to make yourself familiar with the Pipeline for Cloud Integration and to test the new features that we have recently shipped, check out the <A href="https://github.com/peasantsboot/ProcessIntegrationPipelineSampleScenarios" target="_blank" rel="noopener nofollow noreferrer">Process Integration Pipeline Sample Scenarios</A> github repository.</P><P><SPAN>In the repository, we explain how to setup different sample scenarios using the Pipeline for Cloud Integration. For each sample scenario, an integration package is provided. Furthermore, a Postman collection incl. Postman environment is provided that allows you to setup the Partner Directory entries and to trigger sample messages.</SPAN></P><P>As usually, let me know if you have further ideas, requirements, and feedback, feel free to reach out to me or simply leave a comment.</P><P>In the end, I would like to thank my colleagues <A href="https://community.sap.com/t5/user/viewprofilepage/user-id/191315" target="_self">Mate</A> and Vyacheslav from the Center of Excellence team as well as <A href="https://community.sap.com/t5/user/viewprofilepage/user-id/3313" target="_blank">Daniel</A> from Figaf for their input, a lot of the new features are actually based on their feedback and advise.</P><P> </P><P> </P><P> </P><P> </P>2024-08-08T19:28:05.370000+02:00https://community.sap.com/t5/technology-blogs-by-sap/what-s-new-for-sap-integration-suite-june-amp-july-2024/ba-p/13787789What’s New for SAP Integration Suite – June & July 20242024-08-09T08:54:52.588000+02:00GabrielaGahsehttps://community.sap.com/t5/user/viewprofilepage/user-id/4015<P>This is a continuation of the blogpost series you may find at <A href="https://community.sap.com/t5/tag/WhatsNewInSAPIntegrationSuite/tg-p/board-id/technology-blog-sap" target="_blank">#WhatsNewInSAPIntegrationSuite</A>. Today you oversee all our impressive updates released within the June and July timeframe. As we have already August, the next update will come very soon. Stay tuned and enjoy the lovely summertime.</P><P>Our highlights were:</P><UL><LI>Accelerate development of integration flows with Generative AI assistance</LI><LI>New adapters available</LI><LI>Creation of new data type and message types</LI><LI>New design guidelines added for the validation of integration flows</LI><LI>Additional adapters for Edge Integration Cell</LI><LI>Simulation support for Edge Integration Cell</LI><LI>API validation policy for API artifacts</LI><LI>Edge Integration Cell on Red Hat OpenShift</LI><LI>Offline availability during periods of temporary connectivity loss</LI><LI>Sizing recommendations for asynchronous messaging</LI><LI>Support for outgoing connections through a HTTP proxy</LI><LI>API anomaly detection reduces security and performance risks</LI><LI>Maintenance of multiple target endpoints through UI</LI><LI>Changes in user interface</LI><LI>Make use of your own global custom codelists in Trading Partner Management</LI><LI>Integrations with trading partners through value-added networks</LI><LI>Support partners with subsidiaries</LI><LI>Improved situational awareness with Event Mesh</LI><LI>Additional data centers for advanced event mesh</LI><LI>Modernization recommendations for on-premise integration scenarios</LI><LI>Updates to the pipeline concept</LI><LI>New rules added to Migration Assessment</LI><LI>Migration tooling is now pattern based</LI><LI>Support for message type objects in migration tooling</LI><LI>New partner content on SAP Business Accelerator Hub</LI><LI>Search and discovery of validated partner use cases on SAP Business Accelerator Hub</LI></UL><H2 id="toc-hId-1022230212">Cloud Integration</H2><H3 id="toc-hId-954799426">Accelerate development of integration flows with generative AI <SPAN>assistance</SPAN></H3><P>As a first step towards generative AI in our integration <SPAN>area we have extended the </SPAN>design-time tooling in that way that you can create integration flows with the help of generative AI and the unified customer landscape (UCL). Based on your description of a desired integration scenario and existing system instances from UCL, the generative AI tool creates an integration flow with sender and receiver systems. This improves your developer productivity and saves cost. Going forward, we will enhance this offering to include also mediation steps. This feature is only available for tenants with premium edition and as of today in some regions on AWS landscapes. Read the <A href="https://community.sap.com/t5/technology-blogs-by-sap/sap-integration-suite-generative-ai-based-integration-flow-generation/ba-p/13761166" target="_blank">blogpost</A><SPAN>,</SPAN> watch the <A href="https://sapvideo.cfapps.eu10-004.hana.ondemand.com/?entry_id=1_fo3rjkzw&kalturaStartTime=1584" target="_blank" rel="noopener nofollow noreferrer">demo</A>, and check out the <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/generative-ai?version=CLOUD" target="_blank" rel="noopener noreferrer">documentation</A> for more information.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="GabrielaGahse_0-1723120774259.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/148724iA9DC2E4E5C407071/image-size/medium?v=v2&px=400" role="button" title="GabrielaGahse_0-1723120774259.png" alt="GabrielaGahse_0-1723120774259.png" /></span></P><H3 id="toc-hId-758285921">New adapters available</H3><P>We are happy to announce four new adapters in addition to our already rich set of built-in connectivity options. Make use of the new <A href="https://hub.sap.com/integrationadapter/Coupa_rojoconsultancy.com" target="_blank" rel="noopener noreferrer">Coupa</A>, <A href="https://hub.sap.com/integrationadapter/NetSuite_rojoconsultancy.com" target="_blank" rel="noopener noreferrer">NetSuite ERP</A>, <A href="https://hub.sap.com/integrationadapter/Snowflake_rojoconsultancy.com" target="_blank" rel="noopener noreferrer">Snowflake</A>, and <A href="https://api.sap.com/package/AmazonDynamoDBAdapterforSAPIntegrationSuite/integrationadapter" target="_self" rel="noopener noreferrer">Amazon DynamoDB</A> receiver adapters. All these adapters are available on <A href="https://hub.sap.com/content-type/Adapters/adapters/packages" target="_blank" rel="noopener noreferrer">SAP Business Accelerator Hub</A> and run within the cloud or on the optional Edge Integration Cell runtime.</P><H3 id="toc-hId-561772416">Creation of new data type and message types</H3><P>This feature is important for all customers in their journey moving from SAP Process Orchestration to the SAP Integration Suite. You can now import data and message types from the ES Repository along with dependent data types, or create new ones from scratch, or edit existing ones in Cloud Integration by e.g., adding new attributes. These new design time artifacts are stored as XSDs and can be reused in message mapping or in the XML validator flow step. For more information, see the <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/working-with-data-types-message-types" target="_blank" rel="noopener noreferrer">documentation</A> and read the <A href="https://community.sap.com/t5/technology-blogs-by-sap/create-datatype-and-message-type-artifact-in-cloud-integration-capability/ba-p/13709335" target="_blank">blogpost</A>.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="GabrielaGahse_1-1723120774268.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/148722iE090C9C966B31E92/image-size/medium?v=v2&px=400" role="button" title="GabrielaGahse_1-1723120774268.png" alt="GabrielaGahse_1-1723120774268.png" /></span></P><H3 id="toc-hId-365258911">New design guidelines added for the validation of integration flows</H3><P><A href="https://help.sap.com/docs/cloud-integration/sap-cloud-integration/design-guidelines" target="_blank" rel="noopener noreferrer">Additional design guidelines</A> are added to help you further in designing integration flows in a robust fashion. The new design guidelines include checks to efficiently use scripts, handle security, optimize memory usage, and a few more.</P><P>Another new feature is that integration developers may skip a non-compliant design guidelines with consent by providing a reason. This action can also be reverted. See the <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite-54e467e3bd2148deb837d34d1ec66a78/design-guidelines-view" target="_blank" rel="noopener noreferrer">documentation</A>.</P><H2 id="toc-hId-39662687">Edge Integration Cell</H2><P>For running your integration scenarios in your private landscape using the optional hybrid integration runtime Edge Integration Cell runtime we are heavily working on offering you new features and adapters.</P><H3 id="toc-hId--27768099">Additional adapters</H3><P>We have increased the set of connectivity options. The following adapters now support also the Edge Integration Cell runtime profile: <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/amazonwebservices-receiver-adapter" target="_blank" rel="noopener noreferrer">Amazon Web Services</A>, <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/microsoft-dynamics-crm-receiver-adapter" target="_blank" rel="noopener noreferrer">Microsoft Dynamics 365 CRM</A>, <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/salesforce-receiver-adapter" target="_blank" rel="noopener noreferrer">Salesforce</A>, <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/sugarcrm-receiver-adapter" target="_blank" rel="noopener noreferrer">SugarCRM</A>, <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/servicenow-receiver-adapter" target="_blank" rel="noopener noreferrer">ServiceNow</A>, <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/workday-receiver-adapter" target="_blank" rel="noopener noreferrer">Workday</A>, <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/slack-adapter" target="_blank" rel="noopener noreferrer">Slack</A>, <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/microsoft-sharepoint-adapter" target="_blank" rel="noopener noreferrer">MS SharePoint</A>, <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/azurestorage-adapter" target="_blank" rel="noopener noreferrer">MS Azure Storage</A>, <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/rabbitmq-adapter" target="_blank" rel="noopener noreferrer">RabbitMQ</A>, and <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/splunk-adapter" target="_blank" rel="noopener noreferrer">Splunk</A>.</P><H3 id="toc-hId--224281604">Simulation support</H3><P>Simulation was a limitation that we had for Edge Integration Cell. Now you may select also the Edge Integration Cell runtime in your designer and run simulations for your integration flows. See the details in our <A href="https://help.sap.com/docs/PRODUCTS/0310c61ad9934f0e8cdb9df1be7bd432/144c64af999f4cda8c9b1912ac1edb92.html?locale=en-US&state=DRAFT&version=Internal" target="_blank" rel="noopener noreferrer">documentation</A>.</P><H3 id="toc-hId--420795109">API validation policy for API artifacts</H3><P>We have extended the set of policies. You can now validate incoming messages against an OpenAPI 3.0 Specification using the <EM>API validation policy</EM>. In the OpenAPI Specification, you can define the expected message headers and query parameters for each API endpoint. See further details in the <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/api-validation?version=CLOUD" target="_blank" rel="noopener noreferrer">documentation</A>.</P><H3 id="toc-hId--617308614">Kubernetes cluster deployment on Red Hat OpenShift</H3><P>We have extended the set of Kubernetes container application platforms of your choice and you are able now to deploy your Kubernetes cluster on Red Hat OpenShift. Next to the both hyperscaler-based Kubernetes offerings Microsoft AKS and Amazon EKS, you can use SUSE Rancher and Red Hat OpenShift. Alibaba Cloud and Google Kubernetes Engine are on our roadmap. Read the <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/prepare-for-deployment-on-red-hat-openshift-ocp?version=CLOUD" target="_blank" rel="noopener noreferrer">documentation</A> and see note <A href="https://me.sap.com/notes/3247839" target="_blank" rel="noopener noreferrer">#3247839</A>.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="GabrielaGahse_2-1723120774277.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/148723iAF2BBF4DA7D28502/image-size/medium?v=v2&px=400" role="button" title="GabrielaGahse_2-1723120774277.png" alt="GabrielaGahse_2-1723120774277.png" /></span></P><P> </P><H3 id="toc-hId--889053488">Offline availability during periods of temporary connectivity loss</H3><P>You can now perform client certificate authentication and authorization for integration flow processing and API proxies in the Edge Integration Cell instance within the customer network. This <EM>Edge Local Authentication and Authorization</EM> is a fallback to the default cloud-based authentication and authorization in SAP BTP and synchronizes XSUAA security data. Initially, only certificate authentication is supported, further expansion for other OAuth flows and external IDPs are planned. Check out the <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/edge-local-authentication-and-authorization" target="_blank" rel="noopener noreferrer">documentation</A> and <A href="https://i7p.wdf.sap.corp/sap/support/notes/3472645" target="_blank" rel="noopener nofollow noreferrer">note #3472645</A>.</P><H3 id="toc-hId--1085566993">Sizing recommendations for asynchronous messaging</H3><P>We have updated our sizing guide. Now you get also sizing recommendation for hardware resources in asynchronous messaging scenarios. It calculates CPU and memory requirements depending on number of messages per second and payload sizes. Check out the <A href="https://help.sap.com/doc/b4d0660095654e2789de3d1e3ab1c199/CLOUD/en-US/Sizing_Guide_Edge_Integration_Cell.pdf" target="_blank" rel="noopener noreferrer">sizing guide for Edge Integration Cell</A> for further details.</P><H3 id="toc-hId--1282080498">Support for outgoing connections through a HTTP proxy</H3><P>The Edge Integration Cell runtime now supports you with routing of outgoing connections through a proxy. This is useful if your Edge Integration Cell is part of a network that is using an HTTP proxy to communicate with Edge Lifecycle Management Cloud. Read the <A href="https://help.sap.com/docs/EDGE_LIFECYCLE_MANAGEMENT/9d5719aae5aa4d479083253ba79c23f9/0a222b9c99d94f56abdcfe27f5be0afa.html#5---provide-http-proxy-details-(optional)" target="_blank" rel="noopener noreferrer">documentation</A>.</P><H2 id="toc-hId--1185190996">API-led Integration</H2><H3 id="toc-hId--1675107508">API anomaly detection reduces security and performance risks</H3><P>Since June already you are able to monitor actively an exceptional behavior with the help of the anomaly detection feature of API Management. This AI-based feature helps you to optimize your system performance by identifying irregularities as a sudden spike or drop in API calls, as well as an increase in latency or an increase in the number of detected errors. Patterns that deviate from the normal behavior are visualized and in addition subscribers can be promptly notified through emails to minimize the potential impact of an anomaly and to make sure the issues are addressed in a timely manner. This feature is available with SAP Integration Suite, premium edition and in some data centers. Check out the <A href="https://community.sap.com/t5/technology-blogs-by-sap/api-anomaly-detection-in-sap-integration-suite/ba-p/13726636" target="_blank">blogpost</A> and read the <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/anomaly-detection?version=CLOUD" target="_blank" rel="noopener noreferrer">documentation</A>.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="GabrielaGahse_3-1723120774280.jpeg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/148725iC2F8572C62F6C6F1/image-size/medium?v=v2&px=400" role="button" title="GabrielaGahse_3-1723120774280.jpeg" alt="GabrielaGahse_3-1723120774280.jpeg" /></span></P><P> </P><H3 id="toc-hId--1871621013">Maintenance of multiple target endpoints through UI</H3><P>Previously, the only way to add multiple target endpoints was through API proxy zip update, and policies could only be added to the target endpoint that appeared first in the target endpoints dropdown menu. Now, multiple target endpoints can be added and maintained through the UI, and policies can be added to any target endpoint of your choice using the UI. See the documentation <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/create-api?version=CLOUD&q=create%20an%20api%20proxy" target="_blank" rel="noopener noreferrer">create an API proxy</A> and <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/edit-api-proxy?version=CLOUD" target="_blank" rel="noopener noreferrer">edit an API proxy</A>.</P><H3 id="toc-hId--2068134518">Changes in user interface</H3><P>Find the previously named <EM>APIs</EM> that were located under <EM>Monitor</EM> in the navigation bar, now renamed to Analyze and located under <EM>Monitor</EM> and. The functionality remains unchanged.</P><P>The classic design of the <EM>API business hub enterprise</EM> has been removed and is no longer accessible.</P><H2 id="toc-hId--1971245016">B2B Integration</H2><H3 id="toc-hId-1833805768">Make use of your own global custom codelists</H3><P>Important for us to improve your developer efficiency wherever possible. Under <EM>Custom Type Systems</EM>, you can now create global custom codelists centrally and use them across all artifacts such as MIGs and MAGs. The codelists can be created manually or by uploading a csv file that is based on a standard code list. Refer to the <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/adding-custom-codelist?version=CLOUD" target="_blank" rel="noopener noreferrer">documentation</A>.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="GabrielaGahse_4-1723120774290.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/148726i056C9506C83BEAAB/image-size/medium?v=v2&px=400" role="button" title="GabrielaGahse_4-1723120774290.png" alt="GabrielaGahse_4-1723120774290.png" /></span></P><H3 id="toc-hId-1637292263">Integrations with trading partners through value-added networks</H3><P>In the B2B Integration area we are happy to tell that we support communications with trading partners through value-added networks (VAN). You can create a new profile type <EM>communication partner</EM>, which holds the configuration of a VAN provider offering the communication service to trading partners. This profile holds centrally the AS2 partner ID and connection properties which can be used by different templates and agreements. Check out the <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/creating-communication-partner-profile?state=DRAFT&version=DEV" target="_blank" rel="noopener noreferrer">documentation</A>.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="GabrielaGahse_5-1723120774312.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/148727i15636C5177722412/image-size/medium?v=v2&px=400" role="button" title="GabrielaGahse_5-1723120774312.png" alt="GabrielaGahse_5-1723120774312.png" /></span></P><H3 id="toc-hId-1608962449">Support partners with subsidiaries</H3><P>We have introduced <EM>Identifier Groups</EM> in company and trading partner profiles to enable the assignment of several individual identifiers to a group. This supports scenarios where the agreement are the same across multiple suborganizations of a company and want to use centralized processing with identical mappings. This innovation reduces the need for configuring multiple redundant agreements. The idea is to configure agreements using these identifiers groups, then, at runtime, the associated identifiers will be utilized. Refer to the <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/creating-company-profile?version=CLOUD#identifiers" target="_blank" rel="noopener noreferrer">documentation</A>.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="GabrielaGahse_6-1723120774333.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/148729iFAA050A134E50B57/image-size/medium?v=v2&px=400" role="button" title="GabrielaGahse_6-1723120774333.png" alt="GabrielaGahse_6-1723120774333.png" /></span><SPAN> </SPAN></P><H2 id="toc-hId-1705851951">Event-driven Integration</H2><H3 id="toc-hId-1215935439">Improved situational awareness with Event Mesh</H3><P>Since early June already Event Mesh is part of the family. It is targeted for customers with SAP Integration Suite, standard or premium edition, reducing the time to get started with end-to-end event-driven architectures in or beyond the SAP event-driven ecosystem. And it provides the option to combine the event-driven integration with the classic process integration approach. Check out the <A href="https://community.sap.com/t5/technology-blogs-by-sap/meet-your-new-friend-emis-event-mesh-in-sap-integration-suite/ba-p/13731129" target="_blank">blogpost</A> and use the access to the Event Mesh <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/event-mesh" target="_blank" rel="noopener noreferrer">documentation</A>.</P><H3 id="toc-hId-1019421934">Additional data centers for advanced event mesh</H3><P>SAP Integration Suite, advanced event mesh is now available in additional landscapes: on Google Cloud Platform in Europe (Frankfurt) and in US Central and on Amazon Web Service in Brazil (Sao Paulo). See the full list at the <A href="https://discovery-center.cloud.sap/serviceCatalog/advanced-event-mesh?region=all&tab=service_plan" target="_blank" rel="noopener nofollow noreferrer">SAP Discovery Center</A>.</P><H2 id="toc-hId-1116311436">Migration Assessment and migration tool</H2><P>Supporting our SAP Process Orchestration customers in their journey to SAP Integration Suite is one of our key investment areas. During last development takts we have released the following innovations:</P><H3 id="toc-hId-626394924">Modernization recommendations for on-premise integration scenarios</H3><P>You can now receive modernization recommendations for integration scenarios you are evaluating for a migration from SAP Process Orchestration to SAP Integration Suite. The aim of these recommendations is to improve your integration practice and make use of standardized protocols like SOAP, REST, and OData, modern integration styles such as API-led integrations or event-driven integrations and leverage pre-built integration content from the SAP Business Accelerator Hub. You find the recommendations in a report and in a dashboard after the scenario evaluation. For detailed descriptions, see the <A href="https://help.sap.com/docs/help/90c8ad90cb684ee5979856093efe7462/d337a6f0d324405f9ef0c410fd0d3739.html" target="_blank" rel="noopener noreferrer">modernization recommendations</A> in the migration guide for SAP Process Orchestration and the <A href="https://help.sap.com/docs/PRODUCTS/0310c61ad9934f0e8cdb9df1be7bd432/435ec6196a9f4007910b69bcab90937a.html?locale=en-US" target="_blank" rel="noopener noreferrer">documentation</A>.</P><H3 id="toc-hId-429881419">Updates to the pipeline concept</H3><P>To run integration scenarios on cloud in an asynchronous manner, we had published a <A href="https://help.sap.com/docs/MIGRATION_GUIDE_PO/90c8ad90cb684ee5979856093efe7462/6e527fb074834af2be2546c6e7e2fa5f.html" target="_blank" rel="noopener noreferrer">documentation</A> how to set up the pipeline concept and offered also a <A href="https://hub.sap.com/package/PIPipelineGenericIntegrationFlows/overview" target="_blank" rel="noopener noreferrer">Process Integration Pipeline package</A> on SAP Business Accelerator Hub. The latest version of this package covers custom error handling and improvements of the IDoc inbound processing flow. Furthermore, we have introduced a testMode header to implement your own logic how to deal with messages in test mode.</P><H3 id="toc-hId-233367914">New rules added to Migration Assessment</H3><P>We have extended the list of rules applied during evaluation. Now there are rules available that count the number of inbound interfaces, receivers of an integration scenario, determine the number of fields in which file content conversion is used, etc.</P><P>A set of characteristics according to which the application evaluates whether an integration scenario can be migrated and what effort you can expect.</P><H3 id="toc-hId-36854409">Migration tooling is now pattern-based</H3><P>To cover the migration of much more Integrated Configuration Objects (ICO) and be more generic, our migration tooling has switched from a template-based towards a <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/migration-templates" target="_blank" rel="noopener noreferrer">pattern-based migration approach</A>. Your ICOs need not necessarily match a specific template anymore to be ready for a migration. It is sufficient that the ICO is similar to one of the <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/supported-templates" target="_blank" rel="noopener noreferrer">supported patterns</A> to achieve migration. The migration tooling analyses the ICO that are evaluated as migratable via the <A href="https://help.sap.com/docs/integration-suite/sap-integration-suite/migration-assessment" target="_blank" rel="noopener noreferrer">Migration Assessment</A> capability and maps it with the patterns. Based on the pattern, it creates an equivalent integration flow in Cloud Integration.</P><H3 id="toc-hId--159659096">Support for message type objects in migration tooling</H3><P>As message type and data type objects are available in SAP Integration Suite that you may import or create from scratch, you can now also generate integration flows that contain references to message type and data type objects using the migration tooling. Refer the <A href="https://help.sap.com/docs/PRODUCTS/0310c61ad9934f0e8cdb9df1be7bd432/7e7909e6ebd44365867a6c611d94083a.html?locale=en-US&state=DRAFT&version=Internal" target="_blank" rel="noopener noreferrer">documentation</A>.</P><H2 id="toc-hId-105414097">Business Accelerator Hub</H2><H3 id="toc-hId--384502415">Search and discovery of validated partner use cases</H3><P>We are very excited to announce a new type of accelerator, the content category <EM>VPUC</EM> on the SAP Business Accelerator Hub. <A href="https://www.sap.com/documents/2023/08/32d11443-8a7e-0010-bca6-c68f7e60039b.html" target="_blank" rel="noopener noreferrer">SAP-validated partner use cases</A> are solution packages helping you maximize the return on investment on your SAP BTP venture. Checkout the <A href="https://community.sap.com/t5/technology-blogs-by-sap/sap-validated-partner-use-case-on-the-sap-business-accelerator-hub/ba-p/13727749" target="_blank">blogpost</A> read the <A href="https://help.sap.com/docs/business-accelerator-hub/sap-business-accelerator-hub/validated-partner-use-cases-vpuc" target="_blank" rel="noopener noreferrer">documentation</A>.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="GabrielaGahse_7-1723120774349.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/148728iD618D22858D93191/image-size/medium?v=v2&px=400" role="button" title="GabrielaGahse_7-1723120774349.png" alt="GabrielaGahse_7-1723120774349.png" /></span></P><H3 id="toc-hId--581015920">New partner content</H3><P>Lots of new partner content has been published on <A href="https://hub.sap.com/" target="_blank" rel="noopener noreferrer">SAP Business Accelerator Hub</A> by Kaar Technologies, PiLog, Coveo, Qintesi, Crave InfoTech, Tarento, Wipro, KPMG, Twenty5, and RealCore. Check out the <A href="https://community.sap.com/t5/technology-blogs-by-sap/new-partner-content-on-sap-business-accelerator-hub-q2-24/ba-p/13750069" target="_blank">blogpost</A> explaining all the details.</P><H2 id="toc-hId--484126418">How to stay tuned to recent and upcoming innovations?</H2><P>The SAP Road Map Explorer is your one-stop shop for all <A href="https://roadmaps.sap.com/board?PRODUCT=000D3A47875C1EDB98A8A910864AC24B&range=CURRENT-LAST" target="_blank" rel="noopener noreferrer">SAP Integration Suite</A> innovations. You can easily check out the latest innovations and follow what is planned for the following quarters. All recent innovations also cover under the tab <EM>Features</EM> further links to blogposts or documentation.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="GabrielaGahse_0-1723186448273.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/149306i081C83DE9FD3DA56/image-size/medium?v=v2&px=400" role="button" title="GabrielaGahse_0-1723186448273.png" alt="GabrielaGahse_0-1723186448273.png" /></span></P><P>We also refer to the complete list of new releases in our documentation: <A href="https://help.sap.com/whats-new/5793247a5d5741beb0decc5b7dee1160?locale=en-US" target="_blank" rel="noopener noreferrer">What’s New in SAP Integration Suite</A>.</P><P>And if you have not heard of our monthly webinars, I suggest you <A href="https://www.sap.com/cmp/nl/sap-cloud-platform-integration-suite/index.html?sap-outbound-id=6287F912007644D6C49C53EAA9594EE1B4431938&smc_campaign_id=0000032983&source=email-smc" target="_blank" rel="noopener noreferrer">sign up</A> to get an invitation to the upcoming ones. Our team of Product Management experts host these webinars and showcase the latest and greatest updates regarding all SAP Integration Suite capabilities. The webinars take place on the last Tuesday of every month and the next one is already scheduled for August 27th.</P><P>In case you have missed our last monthly webinar, don’t worry. Visit <A href="https://events.sap.com/sap-user-groups/en/ifg_for_integration" target="_blank" rel="noopener noreferrer">2024 Learning Sessions for SAP User Groups on SAP Integration Suite</A> for all recordings, presentations, and Q&As.</P><P>Are you aware of the <A href="https://readiness-at-scale.enable-now.cloud.sap/pub/20230621_ras/index.html?show=book!BO_EC8330B09B97CDBE#SL_120BDFE08096029D" target="_blank" rel="noopener nofollow noreferrer">Release Navigator for SAP BTP</A>? It consolidates release information across SAP BTP products and services easing you the way to find product release related notes, blogposts, and webpages. For your convenience use the direct link to the <A href="https://readiness-at-scale.enable-now.cloud.sap/pub/20230621_ras/index.html?show=book!BO_EC8330B09B97CDBE#slide!SL_83EFB74698B85387" target="_blank" rel="noopener nofollow noreferrer">SAP Integration Suite section of the Release Navigator</A>.</P>2024-08-09T08:54:52.588000+02:00https://community.sap.com/t5/technology-blogs-by-members/enhancing-sap-cpi-with-custom-payload-logging-using-s4hana-on-prem-and-a/ba-p/13785050Enhancing SAP CPI with Custom Payload Logging using S4HANA On Prem and a UI5 Dashboard2024-08-09T15:22:35.731000+02:00KarthikBangeraMhttps://community.sap.com/t5/user/viewprofilepage/user-id/97936<P>In the dynamic world of SAP Cloud Integration (CPI), efficient logging mechanisms are crucial for maintaining robust and reliable integration processes. While CPI offers various built-in options for message monitoring and logging, these may not always meet specific project requirements. In this blog, we will explore a custom logging approach that empowers developers to capture and manage payloads more effectively. There are various logging options already available by using Groovy scripts, Data Stores, and external logging services like Splunk.</P><P>However, we will try to create a tailored logging solution that enhances visibility and troubleshooting capabilities within your CPI environment, utilizing the existing SAP OnPrem solution in your landscape. Join me as we get into the details of this custom strategy, designed to optimize your integration workflows.</P><P><STRONG>Prerequisites-</STRONG></P><OL><LI>CPI Subscription – NEO or CF</LI><LI>S4HANA On Prem</LI><LI>WebIDE or BAS</LI></OL><P><STRONG>Limitations-</STRONG></P><OL><LI>Can only log one payload per Iflow as per the current design. This can be further extended to support multiple step payloads in the upcoming versions.</LI><LI>Only Supports logging and display of XML, JSON and CSV payloads for now.</LI></OL><P>The below solution diagram gives you a holistic view of the applications involved in this design and their roles in each of the steps.</P><P><STRONG>Solution Diagram-</STRONG></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LoggerFlowv3.jpg" style="width: 573px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147496i339D9356A33FCD36/image-size/large?v=v2&px=999" role="button" title="LoggerFlowv3.jpg" alt="LoggerFlowv3.jpg" /></span></P><P> </P><P><STRONG>Overall Steps-</STRONG></P><OL><LI><STRONG>CPI Logger Iflow to call an Inbound Proxy </STRONG>– This Iflow can be called by any Iflow in your CPI tenant which needs to log its payload.</LI><LI><STRONG>Inbound Proxy to save payload to AL11</STRONG> – This Inbound proxy will be called by the CPI Logger Iflow to save the payload to an AL11 directory in S4HANA On Prem</LI><LI><STRONG>CPI Dashboard to consume CPI’s Monitoring API and t</STRONG><STRONG>o display the payload – </STRONG>The UI5 app connects to CPI monitoring service to read and display a monitoring overview screen (much like the traditional SAP PO). It then allows you to open any individual message and display the corresponding payload of the message. This uses a standard set of APIs which allows the UI5 dashboard App to fetch the CPI monitoring data</LI><LI><STRONG>OData Service to enable our CPI Dashboard app to read the payload from AL11 directory – </STRONG>This OData service will enable you to read any given AL11 payload using its Message GUID as an input.</LI></OL><P><STRONG>This is how the end solution will look like-</STRONG></P><P>Open the CPI Dashboard UI5 app and search for an overview of messages within a given time period and click on the resultant row with Iflow (ZPayloadLogger_Src) whose payloads you want to view.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Overview2.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147497iEE9D1D617C8A40C0/image-size/large?v=v2&px=999" role="button" title="Overview2.jpg" alt="Overview2.jpg" /></span></P><P><STRONG>XML Payload-</STRONG></P><P>This will open a list of all the messages for that Iflow within that given period. Click on the first row.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SelectMsg1.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147498i4BDAAF45BD4CB380/image-size/large?v=v2&px=999" role="button" title="SelectMsg1.jpg" alt="SelectMsg1.jpg" /></span></P><P>This will take you to a new page which will display the Iflow Name and the Message GUID. The payload will then be displayed in a text area below. You also have an option to download the payload using the “Download Payload” button. This is an example of an XML payload.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IFlowPayloadScrn1_WithAnnotation.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147499i75D17796CC61322D/image-size/large?v=v2&px=999" role="button" title="IFlowPayloadScrn1_WithAnnotation.jpg" alt="IFlowPayloadScrn1_WithAnnotation.jpg" /></span></P><P>Below is how the JSON and CSV payloads will be displayed-</P><P>JSON-</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JSONPayloadDisplayInApp.JPG" style="width: 935px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147502i162BF4567AA39374/image-size/large?v=v2&px=999" role="button" title="JSONPayloadDisplayInApp.JPG" alt="JSONPayloadDisplayInApp.JPG" /></span></P><P>CSV-</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CSVPayloadDisplayInApp.JPG" style="width: 941px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147503i4D01903238852595/image-size/large?v=v2&px=999" role="button" title="CSVPayloadDisplayInApp.JPG" alt="CSVPayloadDisplayInApp.JPG" /></span></P><P>If a certain CPI Iflow isn’t using this functionality to log its payload-</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NoPayloadToBeDisplayed.JPG" style="width: 997px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147614i0B099605218164CC/image-size/large?v=v2&px=999" role="button" title="NoPayloadToBeDisplayed.JPG" alt="NoPayloadToBeDisplayed.JPG" /></span></P><P>GIT Repository of the CPI Dashboard App-</P><P><A title="https://github.com/karthikmb86/CPIDashboardApp.git" href="https://github.com/karthikmb86/CPIDashboardApp.git" target="_self" rel="nofollow noopener noreferrer">Git Repo for Dashboard App - NEO</A> </P><P>Please note that the above project has been built in WebIDE for NEO. I have created a Repository for Cloud Foundry as well. You can modify the xs-app.js and mta.yaml files with your respective destination references-</P><P><A title="https://github.com/karthikmb86/CPIDashboardApp_CF.git" href="https://github.com/karthikmb86/CPIDashboardApp_CF.git" target="_self" rel="nofollow noopener noreferrer">Git Repo for Dashboard App - CF</A> </P><P>You are welcome to suggest improvements and new features in the App as you explore it.</P><P>We will now go through all the building blocks of this application-</P><P> </P><P><STRONG>Steps 1 and 2 – CPI Iflow calls an SAP Inbound Proxy and this proxy program saves the payload in the AL11 directory</STRONG></P><P><STRONG>Inbound Proxy Program to be called by CPI-</STRONG></P><P>The inbound proxy program will be consumed by CPI to send payloads to be logged from CPI into SAP. The program saves the received payloads in a predefined AL11 directory with <MessageGUID>.<Extension> format as shown in the below screenshot.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AL11FilesView.JPG" style="width: 401px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147505i9F1DB8FFCA35A77F/image-size/large?v=v2&px=999" role="button" title="AL11FilesView.JPG" alt="AL11FilesView.JPG" /></span></P><P><STRONG>Inbound Proxy Program Details-</STRONG></P><P>Service Provider-</P><P><STRONG><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ProxyUnderEnterpriseServicesFolder.JPG" style="width: 291px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147506i2AA2A23E4AF42845/image-size/large?v=v2&px=999" role="button" title="ProxyUnderEnterpriseServicesFolder.JPG" alt="ProxyUnderEnterpriseServicesFolder.JPG" /></span></STRONG></P><P>Implementing class-</P><P><STRONG><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ServiceProviderImplementingClass.JPG" style="width: 650px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147507i4D3C647A31F930D5/image-size/large?v=v2&px=999" role="button" title="ServiceProviderImplementingClass.JPG" alt="ServiceProviderImplementingClass.JPG" /></span></STRONG></P><P>Implementing method-</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ProxyMethod.JPG" style="width: 633px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147509i41B5E53C5FC86542/image-size/large?v=v2&px=999" role="button" title="ProxyMethod.JPG" alt="ProxyMethod.JPG" /></span></P><P><STRONG>Inbound Proxy Code-</STRONG></P><P>The below Inbound proxy code accepts Message GUID and Payload type as inputs from the consumer (ZPayloadLogger Iflow in our case) and calls the Function module <STRONG>Z_SAVE_PAYLOAD_AL11 </STRONG>which saves the payload to the predefined AL11 directory path.</P><P> </P><P> </P><pre class="lia-code-sample language-abap"><code>method zii_si_cpipayload_logger_in~cpipayload_logger.
*** **** INSERT IMPLEMENTATION HERE **** ***
data: lv_result type string,
lv_payloadcontent type string,
lv_filename type string.
data: lv_start_index type i,
lv_end_index type i,
lv_cdata_length type i,
lv_cdata_tag type string.
data: msg_guid type c length 50,
payload_type type c length 30.
loop at input-mt_cpipayload-payload into data(lv_payload).
lv_filename = lv_payload-message_guid && '.' && lv_payload-payload_type.
call function 'Z_SAVE_PAYLOAD_AL11'
exporting
lv_payload_data = lv_payload-payload_content
lv_filename = lv_filename
importing
lv_status = lv_result.
msg_guid = lv_payload-message_guid.
payload_type = lv_payload-payload_type.
endloop.
endmethod.</code></pre><P> </P><P> </P><P>Function Module – <STRONG>Z_SAVE_PAYLOAD_AL11</STRONG></P><P> </P><P> </P><pre class="lia-code-sample language-abap"><code>FUNCTION Z_SAVE_PAYLOAD_AL11.
*”----------------------------------------------------------------------
*”*”Local Interface:
*” IMPORTING
*” REFERENCE(LV_PAYLOAD_DATA) TYPE STRING
*” REFERENCE(LV_FILENAME) TYPE STRING
*” EXPORTING
*” REFERENCE(LV_STATUS) TYPE STRING
*”----------------------------------------------------------------------
DATA: lv_file_path TYPE string,
lv_directory TYPE string.
“ Set the directory path where the file will be saved
lv_directory = ‘<Your AL11 Filepath>’.
“ Concatenate the directory path and file name
CONCATENATE lv_directory lv_FILENAME INTO lv_file_path.
OPEN DATASET lv_file_path FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
TRANSFER lv_payload_data TO lv_file_path.
CLOSE DATASET lv_file_path.
“ Check if the file was successfully saved
IF sy-subrc = 0.
lv_STATUS = ‘Payload saved to AL11 directory:’.
ELSE.
lv_STATUS = ‘Failed to save payload to AL11 directory.’.
ENDIF.
ENDFUNCTION.</code></pre><P> </P><P> </P><P><STRONG>Expected Payload by Inbound Proxy- (Data under xml element “PayloadContent” can either be xml, json or csv) – </STRONG></P><P>Below is an example of an xml payload that can be sent into the Inbound proxy from CPI’s Iflow.</P><P> </P><P> </P><pre class="lia-code-sample language-yaml"><code><n0:MT_CPIPAYLOAD xmlns:n0='http://sap.com/Basis/CustomFields/Generated/*'>
<Payload>
<PayloadContent><![CDATA[ <test>
<Field1>Value2</Field1>
<Field2>Value3</Field2>
<Field3>Value4</Field3>
</test>]]></PayloadContent>
<MessageGUID>521100b2-66e4-4f39-b4c5-451cfaab057d</MessageGUID>
<PayloadType>XML</PayloadType>
</Payload>
</n0:MT_CPIPAYLOAD></code></pre><P> </P><P> </P><P><STRONG>CPI Flows</STRONG></P><P><STRONG>We have 2 CPI flows here,</STRONG></P><OL><LI><STRONG>ZPayloadLogger_Src – </STRONG>This represents any source flow which wants to log its payload by referring its Message GUID.</LI><LI><STRONG>ZPayloadLogger – </STRONG>This represents the actual CPI logger flow which can be called by any Iflow in your landscape (like ZPayloadLogger_Src flow) that wants to log its payload.</LI></OL><P> </P><P>Expected Input Payload into <STRONG>ZPayloadLogger </STRONG>Flow:</P><P>Consumers of this Iflow are required to simply send the payload in XML, JSON or CSV format within the request body and pass the below 2 headers-</P><P> 1. MessageGUID</P><P> 2. PayloadType</P><P><STRONG>ZPayloadLogger_Src IFlow</STRONG></P><P><STRONG><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CPISrcFlowCallingLoggerFlow.png" style="width: 825px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147517iCEB2CFD1FCA2829A/image-size/large?v=v2&px=999" role="button" title="CPISrcFlowCallingLoggerFlow.png" alt="CPISrcFlowCallingLoggerFlow.png" /></span></STRONG></P><P><STRONG><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SetMsgIDAndPayloadTypeInSrcFlowInCPI.JPG" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147518iD29FE0657E8D33D5/image-size/large?v=v2&px=999" role="button" title="SetMsgIDAndPayloadTypeInSrcFlowInCPI.JPG" alt="SetMsgIDAndPayloadTypeInSrcFlowInCPI.JPG" /></span></STRONG></P><P>As shown above, the original Iflow (ZPayloadLogger_Src) which wants to log its payload, needs to capture it’s MessageID using camel header “SAP_MessageProcessingLogID” and then send it in the message header to the CPI Logger Flow (ZPayloadLogger). It also needs to send a header called “PayloadType”, which can be xml, json or csv, depending on the type of the body sent to ZPayloadLogger IFlow.</P><P><STRONG>ZPayloadLogger IFlow-</STRONG></P><P><STRONG><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PayloadLoggerFlow.JPG" style="width: 946px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147519iD24E8C629C0D4647/image-size/large?v=v2&px=999" role="button" title="PayloadLoggerFlow.JPG" alt="PayloadLoggerFlow.JPG" /></span></STRONG></P><P>XI Channel connecting to S4HANA OnPrem via Cloud Connector-</P><P>Below are the key channel configurations-</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="XIChannelToSAP_ConnectionTab.jpg" style="width: 712px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147526i69F9D4631F3A8490/image-size/large?v=v2&px=999" role="button" title="XIChannelToSAP_ConnectionTab.jpg" alt="XIChannelToSAP_ConnectionTab.jpg" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="XIChannelToSAP_ProcessingTab.jpg" style="width: 554px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147528i6606420D43F52F3B/image-size/large?v=v2&px=999" role="button" title="XIChannelToSAP_ProcessingTab.jpg" alt="XIChannelToSAP_ProcessingTab.jpg" /></span></P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="XIChannelToSAP_DeliveryAssuranceTab.jpg" style="width: 432px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147527i8A2E86F10A1E1334/image-size/large?v=v2&px=999" role="button" title="XIChannelToSAP_DeliveryAssuranceTab.jpg" alt="XIChannelToSAP_DeliveryAssuranceTab.jpg" /></span></P><P>Refer below blog for more details on how to connect CPI to SAP OnPrem via Proxy method-</P><P><A title="https://community.sap.com/t5/technology-blogs-by-sap/cloud-integration-configuring-scenario-using-the-xi-receiver-adapter/ba-p/13358288" href="https://community.sap.com/t5/technology-blogs-by-sap/cloud-integration-configuring-scenario-using-the-xi-receiver-adapter/ba-p/13358288" target="_self">Cloud Integration - Configuring scenario using the XI receiver adapter</A> </P><P><STRONG>Script to construct the expected Inbound Proxy Payload-</STRONG></P><P>The below Groovy script within the ZPayloadLogger Iflow constructs the payload required by the Inbound Proxy program.</P><P> </P><P> </P><pre class="lia-code-sample language-javascript"><code>import com.sap.gateway.ip.core.customdev.util.Message
import groovy.xml.MarkupBuilder
def Message processData(Message message) {
//Get headers
def headers = message.getHeaders()
def messageGuid = headers.get("MessageGUID")
def payloadType = headers.get("PayloadType")
//Get payload content from message body
def payloadContent = message.getBody(String)
//Create XML structure
def writer = new StringWriter()
def xml = new MarkupBuilder(writer)
xml.'n0:MT_CPIPAYLOAD'('xmlns:n0': 'http://sap.com/Basis/CustomFields/Generated/*') {
Payload {
PayloadContent {
mkp.yieldUnescaped "<![CDATA[$payloadContent]]>"
}
MessageGUID(messageGuid)
PayloadType(payloadType)
}
}
// Set the output message body
message.setBody(writer.toString())
return message
}</code></pre><P> </P><P> </P><P><STRONG>Step 3 – Consuming CPI’s monitoring API from CPI Dashboard App</STRONG></P><P>Below is the CPI monitoring API endpoint to fetch all the monitoring logs into the UI5 app.</P><P>“/v1/MessageProcessingLogs”</P><P>Below is the link to the Business Accelerator Hub which gives an in-depth API reference and guidelines to consume it.</P><P>Reference - <A href="https://api.sap.com/api/MessageProcessingLogs/resource/Logs" target="_blank" rel="noopener noreferrer">https://api.sap.com/api/MessageProcessingLogs/resource/Logs</A></P><P> </P><P>Destination service in BTP-</P><P>Below is the destination that needs to be created in BTP to connect to the CPI service.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DestinationToCPI_CID.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147563i0852BE939AB85819/image-size/large?v=v2&px=999" role="button" title="DestinationToCPI_CID.jpg" alt="DestinationToCPI_CID.jpg" /></span></P><P>Then, refer this destination within your neo-app.json (NEO) or xs-app.json (CloudFoundry) file of the UI5 app.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NeoAppJSONFile_CID.jpg" style="width: 301px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147564iFB05E0053490F0B0/image-size/large?v=v2&px=999" role="button" title="NeoAppJSONFile_CID.jpg" alt="NeoAppJSONFile_CID.jpg" /></span></P><P><STRONG>Step 4 – OData service to be called by the UI5 Dashboard App to get the saved payloads using MessageGUID</STRONG></P><P>The payloads stored in AL11 directory need to be accessed by our CPI Dashboard app. For this reason, we will create a Function module which takes MessageGUID as an input and returns the resultant payload from the AL11 directory.</P><P><STRONG>Function Module Code-</STRONG></P><P>The below code accepts Message GUID as an input and responds back with the Payload and Filetype.</P><P> </P><P> </P><pre class="lia-code-sample language-abap"><code>FUNCTION Z_GET_PAYLOAD.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(LV_GUID) TYPE STRING
*" EXPORTING
*" VALUE(LV_PAYLOAD) TYPE STRING
*" VALUE(LV_FILETYPE) TYPE STRING
*"----------------------------------------------------------------------
DATA:
lv_al11filepath TYPE string,
lv_line TYPE string,
lv_dir TYPE eps2filnam,
p_file_n TYPE localfile,
lv_extension TYPE string,
lv_valid_extension TYPE abap_bool,
lv_extensions TYPE TABLE OF string.
lv_dir = '<AL11 Directory Path>'.
lv_PAYLOAD = ''.
APPEND 'csv' TO lv_extensions.
APPEND 'json' TO lv_extensions.
APPEND 'xml' TO lv_extensions.
LOOP AT lv_extensions INTO lv_extension.
lv_al11filepath = lv_dir && lv_guid && '.' && lv_extension.
p_file_n = lv_al11filepath.
OPEN DATASET lv_al11filepath FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc = 0.
lv_filetype = lv_extension.
lv_valid_extension = abap_true.
DO.
READ DATASET p_file_n INTO lv_line.
IF sy-subrc <> 0.
EXIT.
ENDIF.
lv_PAYLOAD = lv_PAYLOAD && lv_line && cl_abap_char_utilities=>cr_lf.
ENDDO.
CLOSE DATASET p_file_n.
EXIT.
ENDIF.
ENDLOOP.
IF lv_valid_extension <> abap_true.
lv_PAYLOAD = 'No valid file found'.
ENDIF.
IF sy-subrc <> 0.
lv_PAYLOAD = 'Error occurred while reading file'.
ENDIF.
ENDFUNCTION.</code></pre><P> </P><P> </P><P>Next step is to expose this Function module as an OData service, which will then be consumed by our Dashboard App. You can follow the below blog for your reference for this.</P><P><A title="https://community.sap.com/t5/technology-blogs-by-members/steps-to-build-an-rfc-based-odata-service-with-multiple-selection-values/ba-p/13292174" href="https://community.sap.com/t5/technology-blogs-by-members/steps-to-build-an-rfc-based-odata-service-with-multiple-selection-values/ba-p/13292174" target="_self">Steps to build an RFC based OData service with multiple selection values</A> </P><P>This is a screenshot of how your generated OData service will look-</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FunctionModuleToODataServ.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147569i59178D6C76CD91E8/image-size/large?v=v2&px=999" role="button" title="FunctionModuleToODataServ.jpg" alt="FunctionModuleToODataServ.jpg" /></span></P><P>Testing the OData service giving Message GUID as a reference-</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ODataServiceReturningPayload.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147570iE719EC8F51FA3B79/image-size/large?v=v2&px=999" role="button" title="ODataServiceReturningPayload.jpg" alt="ODataServiceReturningPayload.jpg" /></span></P><P>The xml payload is returned in response to the OData request call.</P><P>Below is the destination service configuration in BTP to connect to this OData service-</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DestinationToSAP_v2.jpg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147574iF2884ECD6679C8C7/image-size/large?v=v2&px=999" role="button" title="DestinationToSAP_v2.jpg" alt="DestinationToSAP_v2.jpg" /></span></P><P>Then, reference the above destination within your neo-app.json (NEO) or xs-app.json (CF) file as shown below-</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NeoAppJSONFile_SAP_v2.jpg" style="width: 277px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/147575i1A57A24FBDF7247C/image-size/large?v=v2&px=999" role="button" title="NeoAppJSONFile_SAP_v2.jpg" alt="NeoAppJSONFile_SAP_v2.jpg" /></span></P><P>As shown above, once all the steps shown in the Solution Diagram are implemented, you should be able to run your Dashboard app and view payloads of IFlows that are using this functionality.</P><P><STRONG>Demo-</STRONG></P><P>Now that we have completed all the required configurations, we will go ahead and demonstrate the functionality using a message triggered from Postman client.</P><P>Send a sample xml payload using Postman client to the endpoint of ZPayloadLogger_Src Iflow in CPI-</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SendingXMLInPostman_LightTheme_v2.JPG" style="width: 574px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/148170iF61CCC3E55A3981C/image-size/large?v=v2&px=999" role="button" title="SendingXMLInPostman_LightTheme_v2.JPG" alt="SendingXMLInPostman_LightTheme_v2.JPG" /></span></P><P>Message processed as per CPI message monitor- Note that ZPayloadLogger_Src is the actual flow whose payload we want to log, whereas ZPayloadLogger flow is the one which calls our Inbound Proxy program to store the payload within SAP’s directory.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CPIMessagesInMonitor.JPG" style="width: 404px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/148171iBEDE8236E77DB2D0/image-size/large?v=v2&px=999" role="button" title="CPIMessagesInMonitor.JPG" alt="CPIMessagesInMonitor.JPG" /></span></P><P>Inbound proxy message processed successfully in SAP-</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PayloadMessageInSAP.JPG" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/148173i39A7DEEC6ACF3EDF/image-size/large?v=v2&px=999" role="button" title="PayloadMessageInSAP.JPG" alt="PayloadMessageInSAP.JPG" /></span></P><P>Payload content in SAP- Shows the actual xml file within CDATA tag.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PayloadContentInSAPMONI.JPG" style="width: 677px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/148174i68CA6EE33FEF428E/image-size/large?v=v2&px=999" role="button" title="PayloadContentInSAPMONI.JPG" alt="PayloadContentInSAPMONI.JPG" /></span></P><P>File saved in AL11 directory-</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FileInAL11.JPG" style="width: 404px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/148175i3F849B40C848981F/image-size/large?v=v2&px=999" role="button" title="FileInAL11.JPG" alt="FileInAL11.JPG" /></span></P><P>XML content displays as expected in AL11 directory-</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FileContentInAL11_v2.JPG" style="width: 590px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/148176i00C3B4922C6CC0D5/image-size/large?v=v2&px=999" role="button" title="FileContentInAL11_v2.JPG" alt="FileContentInAL11_v2.JPG" /></span></P><P>CPI Dashboard App – Displays 2 messages in overview page. Click on ZPayloadLogger_Src.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dashboard_Overview3.JPG" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/148177iE69FD27C6A1804C2/image-size/large?v=v2&px=999" role="button" title="Dashboard_Overview3.JPG" alt="Dashboard_Overview3.JPG" /></span></P><P>This opens the message monitor window. Notice that the Message GUID matches the one from our CPI and SAP monitoring screens. Click on the message.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SelectedMessageInDashboard.JPG" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/148178i1A9B80C378F8BEC0/image-size/large?v=v2&px=999" role="button" title="SelectedMessageInDashboard.JPG" alt="SelectedMessageInDashboard.JPG" /></span></P><P>This opens the message details page which finally displays our XML message.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PayloadDisplayInDashboardApp.JPG" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/148179i899B74873391F824/image-size/large?v=v2&px=999" role="button" title="PayloadDisplayInDashboardApp.JPG" alt="PayloadDisplayInDashboardApp.JPG" /></span></P><P>Message displayed on successfully downloading the message.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MsgOnPayloadDownloadSuccessfully.JPG" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/148180iF7E64F836AA19019/image-size/large?v=v2&px=999" role="button" title="MsgOnPayloadDownloadSuccessfully.JPG" alt="MsgOnPayloadDownloadSuccessfully.JPG" /></span></P><P>Click on the downloaded payload-</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DownloadedFile1.JPG" style="width: 329px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/148181i45AACA0A6DD69DD2/image-size/large?v=v2&px=999" role="button" title="DownloadedFile1.JPG" alt="DownloadedFile1.JPG" /></span></P><P>Payload displayed in our xml editor-</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DownloadFileInEditor.JPG" style="width: 430px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/148182iE227C6CF53B55B75/image-size/large?v=v2&px=999" role="button" title="DownloadFileInEditor.JPG" alt="DownloadFileInEditor.JPG" /></span></P><P>We now arrive at the end of this blog post. This solution effectively addresses the need for efficient payload extraction in CPI, offering a practical and user-friendly tool for integration monitoring. The integration of CPI, ABAP, and UI5 showcases a comprehensive approach, leveraging the strengths of each technology to create a cohesive solution.</P><P>Comments and suggestions for improvement are welcome.</P>2024-08-09T15:22:35.731000+02:00https://community.sap.com/t5/technology-blogs-by-members/essential-groovy-script-solutions-for-sap-cloud-integration/ba-p/13792034Essential Groovy Script Solutions for SAP Cloud Integration2024-08-13T08:59:24.938000+02:00naveen4796https://community.sap.com/t5/user/viewprofilepage/user-id/13527<P><STRONG>Introduction:</STRONG></P><P>In SAP Cloud Integration (CI and formerly known as CPI), Groovy scripts play a crucial role in customizing and fine-tuning integration flows. Whether you're manipulating XML structures, handling data transformations, or performing complex validations, Groovy scripts provide the flexibility you need. In this blog post, I’ll share several essential Groovy script solutions that address common challenges in SAP CI. These scripts, which you can integrate into your flows, include logic for sorting XML segments, managing data formats, and more.</P><H3 id="toc-hId-1152080610">1. <STRONG>Sorting XML Segments in an IDoc</STRONG></H3><P>When working with IDocs in SAP CI, the order of segments can be critical. This first script ensures that specific segments within an IDoc are sorted correctly according to a predefined order.</P><P> </P><pre class="lia-code-sample language-java"><code>import com.sap.gateway.ip.core.customdev.util.Message
import groovy.xml.XmlUtil
import groovy.xml.StreamingMarkupBuilder
def Message processData(Message message) {
def body = message.getBody(java.lang.String) as String
def xml = new XmlSlurper().parseText(body)
// Define the desired order of segments
def desiredOrder = [
'EDI_DC40',
'ZAP2PO_MESSCONTRO',
'ZAP2PO_OPTIONS',
'ZAP2_POHEADER',
'ZAP2_POITEM',
'ZAP2_POACCOUNT',
'ZAP2_POACCOUNTPROFITSEGMENT',
'ZAP2_POSCHEDULE'
]
// Ensure xml.IDOC is a Node and get its children
def idocNode = xml.IDOC[0]
def sortedChildren = idocNode.children().sort { a, b ->
desiredOrder.indexOf(a.name()) <=> desiredOrder.indexOf(b.name())
}
// Rebuild the IDOC element with sorted children
def builder = new StreamingMarkupBuilder()
def sortedXml = builder.bind {
ZAP2POCREATE {
IDOC(BEGIN: '1') {
sortedChildren.each { child ->
mkp.yield child
}
}
}
}.toString()
// Set the sorted XML back to the message body
message.setBody(sortedXml)
return message
}</code></pre><P> </P><P><STRONG>Explanation:</STRONG></P><P>This script parses an incoming XML, sorts the segments within an IDoc according to a predefined order, and reconstructs the XML to ensure that downstream systems receive it in the expected format.</P><H3 id="toc-hId-955567105">2. Replacing the Root Node of an XML Payload</H3><P>Sometimes, you may need to replace the root node of an XML document to conform to a new schema or to meet specific integration requirements. The following Groovy script shows how to replace the root node of an XML payload in SAP CI.</P><P> </P><pre class="lia-code-sample language-java"><code>import com.sap.gateway.ip.core.customdev.util.Message
import groovy.xml.StreamingMarkupBuilder
import groovy.xml.XmlUtil
def Message processData(Message message) {
def body = message.getBody(java.lang.String) as String
def xml = new XmlSlurper().parseText(body)
// New root node name
def newRootNodeName = 'NewRootNode'
// Build the new XML structure with the new root node
def builder = new StreamingMarkupBuilder()
def newXml = builder.bind {
"${newRootNodeName}" {
xml.children().each { child ->
mkp.yield child
}
}
}.toString()
// Set the new XML back to the message body
message.setBody(newXml)
return message
}</code></pre><P> </P><P>#1 Test Execution result</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="naveen4796_0-1723487217379.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/150636i6F709066AC894114/image-size/medium?v=v2&px=400" role="button" title="naveen4796_0-1723487217379.png" alt="naveen4796_0-1723487217379.png" /></span></P><P><A href="https://ide.contiva.com/?data=H4sIAAAAAAAAA3VT3WrbMBROl22wXexqDyDMoA50yjYGg5IWmsSUkMU1TQbdMAzFPnPc2JKR5aRZyN1eYy%2Bx673NHmM3O%2FJPGptOxkj6zjmfzvl05Izbj5%2B39Pj7%2FcXnX%2B2fP363Wy39P0PMZ4rR21TwrZF6MkzUiCeZMk6N3pcL551zNbi2LmbWucsJ6Y2GVwPSty5H9plrvHWNHEXcGo6%2BDgfv35CpdTmx7Flh7RZBXR2Fy163RmiclOfhUWGcCKmIJ2KasoQGTMGabWiYUE9IoF6WKhH7sKKZCiM6gTRlAbjS5WVgIIVYbehdHNGpksDikAcTJpdZ0s%2FCyAf5sO9NHH1CQm3Uvw%2FfSMlNEik8XA5RHLPC4mLukK321oXriLnwN%2BSsMtIAVB8R85atGI0YD3RGmE6HsJQUy8NoTAODOawJJjONMpmANDs0YTKFGdwpU9N3qgx1VLdLbHTHKhThwgfCWQyHlEh2jUYbbTaakP7YvoeOG1y5QEQtoEhi8pGkSmaeyiSQdagWe9P%2BwFrxhbxlCQ9rb3Ya2d3kNZehdB5y%2F15RPVzj1bZRxM416j566Cv0FsgigaNmwLwF2ZIcIa%2FPm956xMuEbkJAe%2B7VdNkdAvvNjipRXJzZvIgpqJp0c%2BYtiRI5VjZE3h9VSNUkadkkhRg1VgkoPa88NZongq9lAQz1So3T7e7EwP7ETlEh5PudMz569LL1%2F0deH%2Fsn74yfPNXAEX4fcP7T1rt%2FwegZhDAEAAA%3D" target="_self" rel="nofollow noopener noreferrer">2.a.groovyIDE_link</A></P><P>#contiva IDE tool</P><P>If you need to change the root element from <ZAP2POCREATE> to <NewRootNode>, this script makes it easy and efficient to handle such transformations within your SAP CI flows.</P><H3 id="toc-hId-759053600">3. Remove XML Declaration</H3><P>When working with XML documents in Groovy, you might need to remove the XML declaration, especially if you're processing the XML further or integrating it with other systems. The XML declaration can vary in format, including different cases for encoding, the use of single or double quotes, or even omitting the encoding attribute altogether.</P><P><EM>XML declaration types:</EM></P><div class="lia-spoiler-container"><a class="lia-spoiler-link" href="#" rel="nofollow noopener noreferrer">Spoiler</a><noscript> (Highlight to read)</noscript><div class="lia-spoiler-border"><div class="lia-spoiler-content"><P><?xml version=<SPAN class="">"1.0"</SPAN> encoding=<SPAN class="">"UTF-8"</SPAN>?><BR /><?xml version='1.0' encoding='UTF-8'?><BR /><?xml version="1.0" encoding="utf-8"?><BR /><?xml version='1.0' encoding='utf-8'?><BR /><?xml version="1.0"?><BR /><?xml version='1.0'?></P></div><noscript><div class="lia-spoiler-noscript-container"><div class="lia-spoiler-noscript-content"><?xml version="1.0" encoding="UTF-8"?><?xml version='1.0' encoding='UTF-8'?><?xml version="1.0" encoding="utf-8"?><?xml version='1.0' encoding='utf-8'?><?xml version="1.0"?><?xml version='1.0'?></div></div></noscript></div></div><P>Here’s a Groovy script that handles all these variations:</P><P> </P><pre class="lia-code-sample language-java"><code>import com.sap.gateway.ip.core.customdev.util.Message;
import groovy.xml.XmlUtil;
import groovy.xml.MarkupBuilder;
import java.util.HashMap;
import java.util.Map;
import groovy.xml.StreamingMarkupBuilder;
def processData(Message message) {
def body = message.getBody(java.lang.String) as String
// Regular expression to match all variations of the XML declaration
//Use (?i) within the regular expression to make it case-insensitive
def xmlDeclarationPattern = /(?i)<\?xml.*version\s*=\s*['"]1\.0['"](.*encoding\s*=\s*['"](utf-8)['"])?\s*\?>/
// Remove the XML declaration
body = body.replaceAll(xmlDeclarationPattern, "")
message.setBody(body) // Set the modified XML back to the message body
return message
}</code></pre><P> </P><H3 id="toc-hId-562540095">4. Mapping with Groovy - XML Input and XML Output</H3><P>Using groovy to transform XML input into a custom XML output.</P><pre class="lia-code-sample language-abap"><code>import com.sap.gateway.ip.core.customdev.util.Message
import groovy.xml.MarkupBuilder
def Message processData(Message message) {
// Get the XML input as a string
def body = message.getBody(String)
def inputXml = new XmlSlurper().parseText(body)
// Initialize StringWriter to hold the new XML content
def writer = new StringWriter()
def xmlBuilder = new MarkupBuilder(writer)
// Handle single records ( 'Records' elements)
xmlBuilder.root {
User {
firstName(inputXml.Records.name1.text())
lastName(inputXml.Records.name2.text())
email(inputXml.Records.mailaccount.text())
phone(inputXml.Records.mailaccount.text())
recordtype("User Account")
}
}
//Handle unbounded records (multiple 'Records' elements)
/** xmlBuilder.root {
inputXml.Records.each{ recData ->
User {
firstName(recData.name1.text())
lastName(recData.name2.text())
email(recData.mailaccount.text())
phone(recData.mailaccount.text())
recordtype("User Account")
}
}
} **/
// Set the generated XML as the message body
message.setBody(writer.toString())
return message
}</code></pre><P>#1 Test Execution - when the input contains one record</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="naveen4796_0-1723645268105.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/151866i44D89D37F7330F94/image-size/medium?v=v2&px=400" role="button" title="naveen4796_0-1723645268105.png" alt="naveen4796_0-1723645268105.png" /></span></P><P>#2 Test Execution - when the input contains multiple records</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="naveen4796_1-1723645335370.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/151867i372CE0DCBB3B07BE/image-size/medium?v=v2&px=400" role="button" title="naveen4796_1-1723645335370.png" alt="naveen4796_1-1723645335370.png" /></span></P><P> <A href="https://ide.contiva.com/?data=H4sIAAAAAAAAA5VVW0%2FbMBQuu6HtYU%2FTnq28kFbMEeUq1FUbmjQQY6pWJpjUF5McWjPHjmyH0lX9JfuzO86FJkA7cFUlPj7fOZ%2FPZ5%2F0jp%2B%2FeNNwg5i3vy7f%2F417q42G%2B79GW8Qso1dGyalnQs0TeyST1Hr7XkcrZbsDSUjnB4RKRyabuNGRLIaN7iEIoTpBPqmttbtnSosoX2vP12LGBQtDlUrbHTn02Ll9Gjo7DVXcCaoet7BQSctCK9P4AnR3o725tb2zu9cJ6vaMalDnuoj6KYu5WEC9D%2BKaL6VuHdo4tydS39vd2d7abG%2F8j3onyIrvrReaoBw8TpS2BDNRwxI6ZBbGbEJ5gsk10DA1VsURXNPUIqETMIYNYaAHsgAOMeL1hN7EuMj07zQ5SLmIQDsX94%2FgkhQokmgV4usXPBp%2BaYvzZ5NMnbfbWxCQr2CJHQE5P%2FlGuDs3hBnCiLGay2Hp5yJfqGhCPpZB6BDsAVr8fubYrHpmYc5jgd4SxgTf%2BiLVCWi%2FSROmDZzCjfVdvGZJvSBzJLnlTPA%2FQPK4Z5pb0MQqMlIiyohmIZGsKz9IW008zr3ztNUAfo0fFrCoXOFaq6afR7lL7ZDJSAAxGBMfOteZ%2BGStkHyNgIAYCZkyV9BqVVJRdxzmlXfjp0EGNYsbl1wb%2Bx1Prl%2FWkRYpaHbWqXXVazbv4gRbBmsvgoE78%2FcxlZuwCJmMlHwg2yOQefXsJAF%2F4GVV%2BJwDBl7Nd1ZOZq1WUL7fOgRBoUkqLxAcQTSXJU6F5QmuLZZnuTb3tgUsHE1dAnelyIfu3T09LGZd0AK9XMeallXEQgnnMpbuj9BgruATQY8VryZgXc2qlJUr1i9a0RAkaGyOUXbPsR05Y9F3sjZUYspeZIpelN9calV%2B9ysb0GBTLUuAs2YksDuPgOEJMN7%2BdLbuYdfENmU5ZPNZ73jl2bvG4g9vfdx%2BhnvHL185wwr%2BdvE5XnWzf1P8oKzEBwAA" target="_self" rel="nofollow noopener noreferrer">4.a.groovyIDE_link</A></P><H3 id="toc-hId-366026590">5. Mapping with Groovy - JSON Input and JSON Output</H3><P>Using groovy to transform XML input into a custom JSON output.</P><pre class="lia-code-sample language-abap"><code>import com.sap.gateway.ip.core.customdev.util.Message
import groovy.json.JsonSlurper
import groovy.json.JsonBuilder
def Message processData(Message message) {
// Get the JSON input as a string
def body = message.getBody(String)
def inputJson = new JsonSlurper().parseText(body)
// Initialize a map to build the new JSON content
//Handle single record
/* def jsonContent = [
record: [
firstName : inputJson.root.Records.name1, //if input json is an error, even if it has one record, then define like this "inputJson.root.Records[0].name1"
lastName : inputJson.root.Records.name2,
email : inputJson.root.Records.mailaccount,
phone : inputJson.root.Records.mailaccount,
recordtype : "User Account"
]
]*/
//Handle muliple records (multiple 'Records' elements)
// Create a list to hold the JSON records
def jsonRecords = []
// Iterate over each <Records> element and build JSON objects
inputJson.root.Records.each { record ->
def jsonRecord = [
firstName: record.name1,
lastName: record.name2,
email: record.mailaccount,
phone: record.contactnumber,
recordtype : "User Account"
]
jsonRecords << jsonRecord
}
def jsonBuilder = new JsonBuilder(jsonRecords)
// Set the generated JSON as the message body
message.setBody(jsonBuilder.toPrettyString())
return message
}</code></pre><P>#1 Test Execution - when the input contains one record</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="naveen4796_2-1723648763062.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/151890iCF536F497FAA5D95/image-size/medium?v=v2&px=400" role="button" title="naveen4796_2-1723648763062.png" alt="naveen4796_2-1723648763062.png" /></span></P><P>#2 Test Execution - when the input contains multiple records</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="naveen4796_3-1723648773681.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/151891iC244C2E2357F0268/image-size/medium?v=v2&px=400" role="button" title="naveen4796_3-1723648773681.png" alt="naveen4796_3-1723648773681.png" /></span></P><P><A href="https://ide.contiva.com/?data=H4sIAAAAAAAAA61WS28TMRBueQk4cOKOtZcmKGxoebSKCuIlQakoFeEh1M3B3Z0mhl17ZXtTQpXfyoXfwJkZrx02KVEB4SrZ9fib8Teez9Ps756%2FcHWFxvfJtY83frz%2B1r28skKfK2jLuOXxJ6PkSWRSLUq7I8vKRr3oJJGMJZFWyiZRj7kpGd5AqnRmyHZQ21hYrAGSF7BOy0n0AvJcJVFncXmjXv6gdJ4tLBdc5DxNVSVtDRpRjGNCPhrSYpyqYsEnVdLy1MqqOARde61v3Ll77%2F7mVhIF4LRzFtu3vBD5crZ9yMfiLLaWYhhC%2Fg3brc379%2B7e2VhvsK1fBvTA92nU8eXByoiiVNoyjBwbXsZDbuGYT2JR4mYa4rQyVhUZjOPKIoFXYAwfQqIT6R2HWNPxxBU9folf%2FbzSJVJZjnhSiTyrEfTJ4Ij5sKzUKsXXZyijVrAV9bONJ63rPLpd9hwssyNgL%2Fuv95ggkTFuGGfGaiGHAUihD1U2YQ9ClHgI9glaWn0HbDeRLgwRRLiEY9bIptWOS64NvIUvtkUR24G957MjhRU8F18BSRS8ZFaxQ8rTsXTRiClVC7C6M8cXXGY5MINc8KHdbWD1cvdmTYvO7Wnth8QOgi%2BNGt%2BbN9I4EtrYPVQb6%2F1KK6bbF%2FsbFzupdjy%2B2xU%2Bf7cdE3iWkoHWSncYjAEtuG7ZCA9ZyUC0Q8lJIinQlovPgAZ0TaLf73lwexD7G7JIOOd%2Fwnejs%2BgHdC2WOzVu1CnXckSZ%2FJNrnb6dlOSfRO8MaPY4XNwmeBAmg5vd8Hqq%2BEWVi3JWfcNaaLDOsubJrDHIoUABmHZDc0814GVFveXCWBLcSHm9Oa35cE2FU219SJLS4DQltmNBU1Q1xpyApyO27T0eBhIojcyL222kDj9BamcbLTlPF%2BskSPzWw%2BYxzXNbVPmcoHs%2BgtfvMh3NwZbIZoY5UyUz5Fy3%2FQ%2ByoNEsyvZ2YxpA08US%2BgbaaFPe0mrEWuxQfd8xhyBdhX3x8EKT1bdH1y2DU2iZxrfMxtaxVfsarJ3UbbTVnukSrZWWwZesjj7%2BxxkBR08T9U6mnQgbPbZVK8DNp%2Fu7q%2Beuryz%2FXTE%2FZr8y9ncvXiLDKv5t4vP9ZZr9BBckQ9WjCAAA" target="_self" rel="nofollow noopener noreferrer">5.a.groovyIDE_link</A></P><P><EM>Scripts 4 and 5 can be interchanged or customized as needed.</EM></P><P><STRONG>Conclusion:</STRONG></P><P>In this blog post, we’ve covered several essential Groovy script solutions that address common challenges in SAP CI. </P><P>Feel free to adapt these scripts to your specific integration needs, and don’t hesitate to reach out if you have any questions or suggestions for additional topics!</P>2024-08-13T08:59:24.938000+02:00https://community.sap.com/t5/technology-blogs-by-sap/sap-integration-suite%E3%82%92%E4%BD%BF%E3%81%A3%E3%81%A6sap-datasphere%E3%81%8B%E3%82%89%E3%83%87%E3%83%BC%E3%82%BF%E3%82%92%E6%8A%BD%E5%87%BA%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95-odata%E7%B7%A8/ba-p/13795654SAP Integration Suiteを使ってSAP Datasphereからデータを抽出する方法 OData編2024-08-15T10:19:34.554000+02:00yureshinohttps://community.sap.com/t5/user/viewprofilepage/user-id/44011<H3 id="toc-hId-1152175811">はじめに</H3><P>SAP の連携ツールである SAP Integration Suite を使用して SAP Datasphere からデータを抽出するには、以下の2つの方法があります。本ブログでは①の方法について紹介します。</P><P>① SAP Datasphere の OData サービスを利用したデータ抽出(本ブログ)</P><P>② SAP Datasphere データベースユーザでの JDBCを利用したデータ抽出(次回ブログにて記載予定)</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_15-56-41.jpg" style="width: 675px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152247iB41F17DB21F8091E/image-dimensions/675x275?v=v2" width="675" height="275" role="button" title="2024-08-15_15-56-41.jpg" alt="2024-08-15_15-56-41.jpg" /></span></P><P>今回は下記のバージョンで検証を行いました。<BR />SAP Datasphere : バージョン2024.16.46<BR />SAP Integration Suite : バージョン 3.66.0</P><H3 id="toc-hId-955662306">手順</H3><OL><LI><P><STRONG>SAP Datasphere で OAuth クライアントを作成する</STRONG></P></LI><LI><STRONG>SAP Integration Suite で OAuth2 Authorization Code を作成・認証する</STRONG></LI><LI><STRONG>SAP Integration Suite で Integration Flow を作成する</STRONG></LI><LI><STRONG>SAP Integration Suite で Integration Flow をデプロイする</STRONG></LI><LI><STRONG>SAP Integration Suite で Integration Flow の動作を確認する</STRONG></LI></OL><P>ポイント</P><UL><LI>SAP Datasphere が 3-legged OAuth 2.0 であるため、SAP Integration Suite 側で OAuth2 Authorization Code を作成する必要があります</LI><LI>SAP Datasphere で作成する OAuth クライアントの用途は「インタラクティブ用途」を設定します</LI><LI>SAP Datasphere には、OAuth2 Authorization Code 認証時の SAP Datasphere ユーザでアクセスするため、当該ユーザが参照できる範囲のオブジェクトのデータが抽出できます</LI></UL><P>ここから具体的な方法を紹介します。</P><H4 id="toc-hId-888231520">手順1.SAP Datasphere で OAuth クライアントを作成する</H4><P>1.SAP Datasphere にログインします</P><P>2.トップページのナビゲーションバーから システム > 管理 を選択します</P><P>3.[アプリ統合] タブをクリックします</P><P>4.OAuth クライアント の [+ 新規 OAuth クライアントを追加] をクリックします</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_16-11-54.jpg" style="width: 656px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152268iA06F3D4A1EFF96C1/image-size/large?v=v2&px=999" role="button" title="2024-08-15_16-11-54.jpg" alt="2024-08-15_16-11-54.jpg" /></span></P><P>5.以下の情報を入力し、[追加] ボタンをクリックして OAuth クライアントを作成します</P><UL><LI>名称: 任意のOAuth クライアントの名称(この例では Cloud_Integration)</LI><LI>目的: インタラクティブ用途 を選択</LI><LI>リダイレクト URI: https://<hostname>/itspaces/odata/api/v1/OAuthTokenFromCode<BR />(Token Service が Authorization Code を返す(リダイレクトする) SAP Cloud Integration の URI)</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_16-12-09.jpg" style="width: 384px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152259i28C593EAB4A976DF/image-size/medium?v=v2&px=400" role="button" title="2024-08-15_16-12-09.jpg" alt="2024-08-15_16-12-09.jpg" /></span><BR />参考: <A href="https://help.sap.com/docs/cloud-integration/sap-cloud-integration/oauth-2-0?locale=en-US" target="_blank" rel="noopener noreferrer">OAuth 2.0 Authorization Code Grant</A></P><P>6.[シークレットコードをコピー] ボタンをクリックしてクリップボードにコピーしたクライアントシークレットをメモ帳などにコピーしておきます</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_16-15-40.jpg" style="width: 368px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152261i27577E36E8D15F2F/image-size/medium?v=v2&px=400" role="button" title="2024-08-15_16-15-40.jpg" alt="2024-08-15_16-15-40.jpg" /></span></P><P>7.併せて “OAuth クライアント ID” もメモ帳などにコピーしておきます</P><P>8.[アプリ統合] タブの OAuth クライアントに表示されている “権限 URL” と “トークン URL” もメモ帳などにコピーしておきます</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_16-11-54.jpg" style="width: 656px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152267i5FE1ADF8E95CEDF9/image-size/large?v=v2&px=999" role="button" title="2024-08-15_16-11-54.jpg" alt="2024-08-15_16-11-54.jpg" /></span></P><H4 id="toc-hId-691718015">手順2.SAP Integration Suite で OAuth2 Authorization Code を作成・認証する</H4><P>1.SAP Integration Suite にログインします</P><P>2.Monitor > Integrations and APIs をクリックします</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_16-19-501.jpg" style="width: 198px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152264i923CB53CB3F19D60/image-dimensions/198x331?v=v2" width="198" height="331" role="button" title="2024-08-15_16-19-501.jpg" alt="2024-08-15_16-19-501.jpg" /></span></P><P>3.Security Material のタイルをクリックします</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_16-19-50.jpg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152265i8B049D30ABDBC791/image-size/medium?v=v2&px=400" role="button" title="2024-08-15_16-19-50.jpg" alt="2024-08-15_16-19-50.jpg" /></span></P><P>4.[Create] をクリックして表示されるコンテキストメニューから [OAuth2 Authorization Code] を選択します</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_16-20-06.jpg" style="width: 325px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152266i99F628F4E7B68082/image-size/medium?v=v2&px=400" role="button" title="2024-08-15_16-20-06.jpg" alt="2024-08-15_16-20-06.jpg" /></span></P><P>5.Create OAuth2 Authorization Code ダイアログで以下の情報を入力し、[Deploy] ボタンをクリックします</P><UL><LI>Name: 任意の名称(この例では Datasphere_AuthCode)</LI><LI>Provider: <I>Generic</I> を選択</LI><LI>Authorization URL: SAP Datasphere の認証 URL(前の手順でコピーしたもの)</LI><LI>Token Service URL: SAP Datasphere のトークン URL(前の手順でコピーしたもの)</LI><LI>Client ID: SAP Datasphere で作成した OAuth クライアントのクライアント ID(前の手順でコピーしたもの)</LI><LI>Client Secret: SAP Datasphere で作成した OAuth クライアントのクライアントシークレット(前の手順でコピーしたもの)</LI><LI>Send As: <I>Body Parameter</I> を選択</LI><LI>User Name: SAP Datasphere のログインユーザ名</LI><LI><SPAN>Scope: 空白で OK</SPAN></LI></UL><P><SPAN><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_16-26-30.jpg" style="width: 549px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152269iFFE9729FC1FDF563/image-size/large?v=v2&px=999" role="button" title="2024-08-15_16-26-30.jpg" alt="2024-08-15_16-26-30.jpg" /></span></SPAN></P><P>作成した OAuth2 Authorization Code の Status が Unauthorized になっているので、認証をおこないます</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Picture1.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152270i30C66E8DE1E521A3/image-size/large?v=v2&px=999" role="button" title="Picture1.png" alt="Picture1.png" /></span></P><P>6.作成した OAuth2 Authorization Code の [More] ボタン( ... )をクリックして表示されるコンテキストメニューから [Authorize] を選択します</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Picture1-2.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152273i18645360505BDBEB/image-size/large?v=v2&px=999" role="button" title="Picture1-2.png" alt="Picture1-2.png" /></span></P><P>7.Information ダイアログで内容を確認し、[OK] ボタンをクリックします</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Picture2.png" style="width: 486px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152274i5DC9DBB346E5BDF8/image-size/large?v=v2&px=999" role="button" title="Picture2.png" alt="Picture2.png" /></span></P><P>8.SAP Datasphere のログオン画面で、ユーザ名とパスワードを入力して [ログオン] ボタンをクリックします</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Picture3.png" style="width: 424px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152275i2A01892FD9C46228/image-size/large?v=v2&px=999" role="button" title="Picture3.png" alt="Picture3.png" /></span></P><P>9.認証成功のメッセージを確認します</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Picture4.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152276iFF59B38587049D3B/image-size/large?v=v2&px=999" role="button" title="Picture4.png" alt="Picture4.png" /></span></P><P>10.OAuth2 Authorization Code の Status が Deployed になっていることを確認します</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Picture5.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152277i394358BE13BE5720/image-size/large?v=v2&px=999" role="button" title="Picture5.png" alt="Picture5.png" /></span></P><H4 id="toc-hId-495204510">手順3.SAP Integration Suite で Integration Flow を作成する</H4><P>1.SAP Integration Suite のホームページから Design > Integrations and APIs をクリックします</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_16-43-14.png" style="width: 285px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152281i6BDC66FD92A8D16B/image-size/large?v=v2&px=999" role="button" title="2024-08-15_16-43-14.png" alt="2024-08-15_16-43-14.png" /></span></P><P>2.[Create] ボタンをクリックしてコンテンツパッケージを作成します</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_16-43-30.png" style="width: 365px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152282iE148C2F8419F7599/image-size/large?v=v2&px=999" role="button" title="2024-08-15_16-43-30.png" alt="2024-08-15_16-43-30.png" /></span></P><P>3.以下の情報を入力して [Save] ボタンをクリックします</P><UL><LI>Name: 任意のパッケージ名(この例では Datasphere_OData_Integration)</LI><LI>Technical Name: Name の内容から自動設定</LI><LI>Short Description: 任意の概要説明</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_16-44-07.png" style="width: 678px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152283i006EE392CFCB78C9/image-size/large?v=v2&px=999" role="button" title="2024-08-15_16-44-07.png" alt="2024-08-15_16-44-07.png" /></span></P><P>4.Artifacts タブに移動します</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_16-45-421.png" style="width: 423px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152285i506C0CCBC18FF705/image-size/large?v=v2&px=999" role="button" title="2024-08-15_16-45-421.png" alt="2024-08-15_16-45-421.png" /></span></P><P>5.Add をクリックして表示されるコンテキストメニューから [Integration Flow] を選択します</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_16-45-42.png" style="width: 512px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152286iDF310A9638A0E08E/image-size/large?v=v2&px=999" role="button" title="2024-08-15_16-45-42.png" alt="2024-08-15_16-45-42.png" /></span></P><P>6.Add Integration Flow ダイアログで以下の情報を入力し、[Add] ボタンをクリックします</P><UL><LI>Create を選択</LI><LI>Name: 任意の Integration Flow 名(この例では Datasphere_Odata_iFlow)</LI><LI>ID: Name から自動入力</LI><LI>Runtime Profile: Cloud Integration</LI><LI>Description: 任意の説明</LI><LI>Sender: 空白</LI><LI>Receiver: 空白</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_16-46-00.png" style="width: 670px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152287i1BA354DF76FD76D1/image-size/large?v=v2&px=999" role="button" title="2024-08-15_16-46-00.png" alt="2024-08-15_16-46-00.png" /></span></P><P>デプロイ時に一回だけ起動し、SAP Datasphere からデータを取得する Integration Flow を作成します</P><P>7.Artifacts から追加した Integration Flow を選択します</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_16-48-15.png" style="width: 772px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152289i85872D5A892C4A94/image-size/large?v=v2&px=999" role="button" title="2024-08-15_16-48-15.png" alt="2024-08-15_16-48-15.png" /></span></P><P>8.右のような Integration Flow を作成します</P><UL><LI>Request Reply から Receiver への接続では、[HTTP] を選択します</LI></UL><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_16-48-23.png" style="width: 779px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152291i3BAFD9BD22921FBA/image-size/large?v=v2&px=999" role="button" title="2024-08-15_16-48-23.png" alt="2024-08-15_16-48-23.png" /></span></P><P>9.Groovy Script の Processing タブをクリックします</P><P>10.Script File の [Select] ボタンをクリックします</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_16-50-52.png" style="width: 605px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152296iBD5BB90E16C6099A/image-size/large?v=v2&px=999" role="button" title="2024-08-15_16-50-52.png" alt="2024-08-15_16-50-52.png" /></span></P><P>11.Select Resource ダイアログで、Local Resources タブをクリックして、[Upload from File System] ボタンをクリックします</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_16-51-07.png" style="width: 439px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152298iE21794453747F8A0/image-size/large?v=v2&px=999" role="button" title="2024-08-15_16-51-07.png" alt="2024-08-15_16-51-07.png" /></span></P><P>12.次のコードが記述されている Groovy Script ファイルをアップロードします(エディタ上で直接コードを記述することも可能です)</P><UL><LI>8行目の "Datasphere_AuthCode" 部分には前の手順で作成したOAuth2 Authorization Code 名を入れてください </LI></UL><P> </P><P> </P><pre class="lia-code-sample language-javascript"><code>import com.sap.gateway.ip.core.customdev.util.Message;
import com.sap.it.api.securestore.SecureStoreService;
import com.sap.it.api.securestore.AccessTokenAndUser;
import com.sap.it.api.securestore.exception.SecureStoreException;
import com.sap.it.api.ITApiFactory;
def Message processData(Message message) {
SecureStoreService secureStoreService = ITApiFactory.getService(SecureStoreService.class, null);
AccessTokenAndUser accessTokenAndUser = secureStoreService.getAccesTokenForOauth2AuthorizationCodeCredential(“Datasphere_AuthCode");
String token = accessTokenAndUser.getAccessToken();
message.setHeader("Content-Type", "application/json");
message.setHeader("Authorization", "Bearer "+token);
def messageLog = messageLogFactory.getMessageLog(message);
if (messageLog != null) {
messageLog.setStringProperty("logging#1", "accessTokenAndUser=" + accessTokenAndUser.toString());
messageLog.setStringProperty("logging#2", "token=" + token);
}
return message;
}</code></pre><P> </P><P> </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Picture7.png" style="width: 838px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152299i00ADC3E973723D70/image-size/large?v=v2&px=999" role="button" title="Picture7.png" alt="Picture7.png" /></span></P><P>13.HTTP の Connection タブをクリックし、以下の情報を入力します</P><UL><LI>Address: データを取得する SAP Datasphere の OData API </LI><LI>Query: OData API をコールするときのクエリパラメータ</LI><LI>Proxy Type: <I>Internet</I> を選択</LI><LI>Method: <I>GET</I> を選択</LI><LI>Authentication: <I>None</I> を選択</LI><LI>Request Headers: Authorization (<STRONG>必須</STRONG>)</LI><LI>Response Headers: *</LI></UL><P>※データを取得する SAP Datasphere の OData API については、<A href="https://help.sap.com/docs/SAP_DATASPHERE/43509d67b8b84e66a30851e832f66911/7a453609c8694b029493e7d87e0de60a.html?locale=ja-JP" target="_self" rel="noopener noreferrer">こちらのヘルプページ</A>をご参照ください。今回はアクセス可能なスペースを一覧で取得するOData APIを利用したため、 <A target="_blank" rel="noopener">https://<tenant_url>/api/v1/dwc/catalog/assets</A> としています。</P><H4 id="toc-hId-298691005"><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Picture8.png" style="width: 763px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152300i403594A477C87782/image-size/large?v=v2&px=999" role="button" title="Picture8.png" alt="Picture8.png" /></span></H4><H4 id="toc-hId-102177500">手順4.<STRONG>SAP Integration Suite で Integration Flow をデプロイする</STRONG></H4><P>1.[Save] ボタンをクリックします</P><P>2.[Deploy] ボタンをクリックします</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_17-04-29.png" style="width: 488px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152310i1D73C9314AC07D93/image-size/large?v=v2&px=999" role="button" title="2024-08-15_17-04-29.png" alt="2024-08-15_17-04-29.png" /></span></P><P>3.Confirmation ダイアログで Runtime Profile でCloud Integrationを選択して、[Yes] ボタンをクリックします</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_17-04-37.png" style="width: 473px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152311i6299D9DA18F0AB5E/image-size/large?v=v2&px=999" role="button" title="2024-08-15_17-04-37.png" alt="2024-08-15_17-04-37.png" /></span></P><P>4.Deployment ダイアログで [OK] ボタンをクリックします</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_17-04-45.png" style="width: 440px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152312iFD42F07B13EF3052/image-size/large?v=v2&px=999" role="button" title="2024-08-15_17-04-45.png" alt="2024-08-15_17-04-45.png" /></span></P><P>5.Deployment Status タブをクリックし、Deployment Status と Runtime Status を確認します</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_17-07-27.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152314iE31DE5E3B3E739C1/image-size/large?v=v2&px=999" role="button" title="2024-08-15_17-07-27.png" alt="2024-08-15_17-07-27.png" /></span></P><P>6.Navigate to Manage Integration Content リンクをクリックします</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_17-08-01.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152315iB5CC0DD09427636F/image-size/large?v=v2&px=999" role="button" title="2024-08-15_17-08-01.png" alt="2024-08-15_17-08-01.png" /></span></P><P>7.Manage Integration Content 画面で実行状態を確認します</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_17-10-14.png" style="width: 692px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152317i0B6A66FEFCBF0715/image-size/large?v=v2&px=999" role="button" title="2024-08-15_17-10-14.png" alt="2024-08-15_17-10-14.png" /></span></P><P>8.Integration Flow の実行をトレースするためにLog Configuration の Log Level を Trace に変更します</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_17-11-21.png" style="width: 516px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152318i7BA479C1E517AF34/image-size/large?v=v2&px=999" role="button" title="2024-08-15_17-11-21.png" alt="2024-08-15_17-11-21.png" /></span></P><P>9.Integration Flow の Edit 画面で再度 [Deploy] ボタンをクリックし、Integration Flow をデプロイします</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_17-11-33.png" style="width: 490px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152319i4F29050F58FE09B5/image-size/large?v=v2&px=999" role="button" title="2024-08-15_17-11-33.png" alt="2024-08-15_17-11-33.png" /></span></P><H4 id="toc-hId--94336005">手順5.<STRONG>SAP Integration Suite で Integration Flow の動作を確認する</STRONG></H4><P>1.Monitor > Integrations and APIs をクリックします</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_17-13-17.png" style="width: 216px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152321iA32616E57F21E32B/image-size/large?v=v2&px=999" role="button" title="2024-08-15_17-13-17.png" alt="2024-08-15_17-13-17.png" /></span></P><P>2.Monitor Message Processing の All Artifacts タイルをクリックします</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_17-13-31.png" style="width: 319px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152322i71ACC1B0A85AF3E5/image-size/large?v=v2&px=999" role="button" title="2024-08-15_17-13-31.png" alt="2024-08-15_17-13-31.png" /></span></P><P>3.作成・デプロイした Integration Flow を選択します</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_17-13-47.png" style="width: 424px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152324i34525CC258D9EC95/image-size/large?v=v2&px=999" role="button" title="2024-08-15_17-13-47.png" alt="2024-08-15_17-13-47.png" /></span></P><P>4.Logs タブをクリックし、Log Level の Trace リンクをクリックします</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_17-13-59.png" style="width: 524px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152326iCC8D70722147AF78/image-size/large?v=v2&px=999" role="button" title="2024-08-15_17-13-59.png" alt="2024-08-15_17-13-59.png" /></span></P><P>5.Run Steps の End をクリックします</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_17-15-36.png" style="width: 277px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152333iA6783B3016387419/image-size/large?v=v2&px=999" role="button" title="2024-08-15_17-15-36.png" alt="2024-08-15_17-15-36.png" /></span></P><P>6.Message Content をクリックします</P><P>7.Payload タブをクリックして、データが取得できていることを確認します(JSON 形式)</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024-08-15_17-15-46.png" style="width: 983px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/152330i0EA23FD1EE06D401/image-size/large?v=v2&px=999" role="button" title="2024-08-15_17-15-46.png" alt="2024-08-15_17-15-46.png" /></span></P><P>以上ですべての手順が完了しました。最後までお読みいただきありがとうございました。</P><P>Special thanks to Ikeguchi Daisuke-san!</P>2024-08-15T10:19:34.554000+02:00https://community.sap.com/t5/technology-blogs-by-sap/sap-integration-suite-connect-shopify-and-integration-suite-over-webhooks/ba-p/13803323SAP Integration Suite - Connect Shopify and Integration Suite over webhooks2024-08-23T09:09:51.067000+02:00svenhubertihttps://community.sap.com/t5/user/viewprofilepage/user-id/108430<P>So you decided to leave your IT job and sell your home-made candles online?</P><P style=" text-align: center; "><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="svenhuberti_0-1724396190300.jpeg" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/156369i31607870F4494318/image-size/medium?v=v2&px=400" role="button" title="svenhuberti_0-1724396190300.jpeg" alt="svenhuberti_0-1724396190300.jpeg" /></span></P><P>Chances are you are doing so through an online business platform such a Shopify.</P><P>But as you business grows, you need to integrate your Shopify shop with other systems such as an ERP. And this is my job: explaining you how to do so!<BR /><BR /></P><P>This can be achieved using SAP BTP Integration Suite and we'll see how to do that in this blog, especially how to connect the Shopify Webhook to a Cloud Integration integration flow.</P><P>In this blog, we will assume that you know the SAP Business Technology Platform (BTP) and the Integration Suite - a least from a basic perspective.</P><P> </P><H1 id="toc-hId-914265276">Setting the scene</H1><P data-unlink="true">Cloud-native solutions such as Shopify often provide <STRONG>webhooks</STRONG> which let you call a REST API when a specific event happens. This is perfect to call an integration flow that will process the Shopify data.<BR />However, webhooks are <A href="https://hookdeck.com/webhooks/guides/complete-guide-to-webhook-security" target="_self" rel="nofollow noopener noreferrer">not very good at security</A>. Hence we will need to use both API Management and Cloud Integration to implement the pilot.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAP BTP - IS - Shopify (1).jpeg" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/155842i0371F844E1D2AF14/image-size/large?v=v2&px=999" role="button" title="SAP BTP - IS - Shopify (1).jpeg" alt="SAP BTP - IS - Shopify (1).jpeg" /></span></P><P><STRONG>What do we need?</STRONG></P><P>First of all, the scenario will need <STRONG>data massage</STRONG>.<BR />Indeed, the data coming from Shopify cannot be used "as-is" in S/4HANA since the data structure is completely different. This is done in an integration flow in the <STRONG>Cloud Integration</STRONG> capability (but will not be part of this blog). Also, if you connect to another system than S/4HANA, you may need <STRONG>connectivity</STRONG> using out-of-the-box <A href="https://help.sap.com/docs/cloud-integration/sap-cloud-integration/connectivity-adapters?locale=en-US" target="_blank" rel="noopener noreferrer"><STRONG>Cloud Integration Adapters</STRONG></A>.</P><P>Secondly, the scenario will need specific <STRONG>security</STRONG> features.<BR />Indeed, Shopify webhooks have no way to authorize against the target API and the webhook sends the full payload when triggered. <STRONG>API Management capability </STRONG>can come to the rescue: it sits between the consumer and the API implementation (ie. Shopify webhook and integration flow) and can receive non-authorized requests and perform further security checks.</P><P>Let's implement all that in the next steps! </P><P> </P><H1 id="toc-hId-717751771">Technical implementation</H1><P> </P><H2 id="toc-hId-650320985">Setting up Cloud Integration</H2><P>The integration flow that will be called by Shopify's webhook will be very simple: it will be exposed as REST API and will eventually contain the mapping to the backend system (eg. S4).</P><P>Start by creating an integration flow in the package of your choice. I created a dedicated package for Shopify for instance.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Iflow0.png" style="width: 853px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/155924iA414B4F659DCF23A/image-size/large?v=v2&px=999" role="button" title="Iflow0.png" alt="Iflow0.png" /></span><SPAN><BR />As you may know, to call an integration flow, you need to have the right credentials and roles to do it.</SPAN></P><P>An integration flow can be called using basic authentication, with a check on the caller's role. This is fine for a pilot, hence we'll use that as security mechanism.</P><P>Add an HTTP Sender Adapter with the configuration as depicted below.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Iflow1.png" style="width: 474px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/155910i268936C833712128/image-size/large?v=v2&px=999" role="button" title="Iflow1.png" alt="Iflow1.png" /></span></P><P>Deploy your integration flow so we can test it later on.</P><P>To call that integration flow, you will need to create an API Service key that will contain credentials (clientId & clientSecret) for a specific role, such as "ESBMessaging.send".<BR />You may have created an API Key: in that case you can use its credentials. If not, follow the next steps.</P><P>The whole process of creating an API key is described in detail <A href="https://help.sap.com/docs/btp/sap-business-technology-platform/creating-service-keys" target="_self" rel="noopener noreferrer">here</A>, but basically you need to:</P><UL><LI>go to your subaccount</LI><LI>create a new instance of <STRONG>SAP Process Integration Runtime ("integration-flow" plan)</STRONG></LI><LI>create a service key for that instance</LI></UL><P>The result looks somewhat like this:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="BTPsetup1.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/155917i66E33F7A661F50EF/image-size/large?v=v2&px=999" role="button" title="BTPsetup1.png" alt="BTPsetup1.png" /></span></P><P>Once the key is created, copy <STRONG>clientId</STRONG> and <STRONG>clientSecret: </STRONG>we will need it later to trigger the iflow.</P><H2 id="toc-hId-453807480">Setting up Postman for testing</H2><P>I am a big fan of Postman since its very beginning, so I will use that to test the call against my integration flow. But you can also use free tools such as <A href="https://reqbin.com/" target="_blank" rel="noopener nofollow noreferrer">ReqBin.</A></P><P>Before you create the request, we need to get the endpoint URL of the integration flow. It can be found in the <STRONG>Monitor / Integration and APIs / Manage Integration Content</STRONG> screen.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Iflow2.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/155927iBF7BA1E213E0BD39/image-size/large?v=v2&px=999" role="button" title="Iflow2.png" alt="Iflow2.png" /></span></P><P>Copy the URL of the endpoint and use it in the client of your choice to create your <STRONG>POST</STRONG> request.</P><P>In the Authentication tab, select <STRONG>Basic Authentication</STRONG> and enter your clientId and clientSecret as credentials.<BR />It should look like that.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Iflow2.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/155932iA6B38A823D0EECB2/image-size/large?v=v2&px=999" role="button" title="Iflow2.png" alt="Iflow2.png" /></span></P><H2 id="toc-hId-257293975"> </H2><H2 id="toc-hId-60780470">Setup Shopify Webhook</H2><P>Let's now define a webhook in Shopify. To do so, login to Shopify and navigate to the <STRONG>Settings</STRONG> (the link is at the bottom left of your screen).</P><P>Now select <STRONG>Notifications / Webhooks.</STRONG></P><P><STRONG>Create</STRONG> a webhook for order creation and insert the <STRONG>URL of your integration flow</STRONG>.</P><P>Also, <STRONG>c</STRONG><STRONG>opy</STRONG> the value of the key since we will need it later.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Shopify1.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/155934iDFDC260260E24164/image-size/large?v=v2&px=999" role="button" title="Shopify1.png" alt="Shopify1.png" /></span></P><P>Don't get too excited though: this won't work (test it if you want: <STRONG>...</STRONG> / <STRONG>Send Test</STRONG>) because the integration flow requires authentication!</P><P>A way to enable that, is to use API Management, to inject the credentials there.</P><P> </P><H2 id="toc-hId--135733035">Setup API Management</H2><P>The main reason behind using API Management is to centralize security, traffic management and analytics of APIs - making the management of your IT landscape easier.</P><P>This works mainly through the usage of so called API Management <STRONG>API Proxies</STRONG> which sit between the caller and the implementation of the API.</P><P>To create an API proxy, navigate to your Integration Suite, <STRONG>Configure / APIs</STRONG>.</P><P>Click on <STRONG>Create</STRONG> and fill in the fields as depicted below.<BR />The <STRONG>URL</STRONG> should be the endpoint URL of your iFlow.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="APIM1.png" style="width: 809px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/155959i74BEB3DD91020ADE/image-size/large?v=v2&px=999" role="button" title="APIM1.png" alt="APIM1.png" /></span></P><P> Once the API Proxy is created, click on the <STRONG>Key Value Maps</STRONG> tab on the top.</P><P>Indeed, in order to safely inject the Cloud Integration credentials, we will use the <A href="https://help.sap.com/docs/sap-api-management/sap-api-management/key-value-map?locale=en-&version=Cloud&q=keyvaluemapsoperations" target="_self" rel="noopener noreferrer">Key Value Map</A> feature of API Management: you can store values in an encrypted way, available only to the API proxy during runtime (vs. hardcoded in the API proxy itself).</P><P><STRONG>Create</STRONG> 2 encrypted KVMs named <STRONG>Shopify</STRONG> and <STRONG> Cloud Integration.</STRONG></P><P><STRONG><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="APIM2.png" style="width: 967px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/155961i894DA9547EBCB1F0/image-size/large?v=v2&px=999" role="button" title="APIM2.png" alt="APIM2.png" /></span></STRONG></P><P>In the <STRONG>Shopify</STRONG> KVM, create a key named <STRONG>WebHookKey</STRONG> containing the value of the Shopify key you copied before.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="APIM3.png" style="width: 751px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/155963i8D8C7B71280BFC52/image-size/large?v=v2&px=999" role="button" title="APIM3.png" alt="APIM3.png" /></span></P><P> Do the same for <STRONG>CloudIntegration</STRONG>, with the clientId and clientSecret values from your Cloud Integration API Service key.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="APIM4.png" style="width: 767px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/155964iD92C3EA42967E1BA/image-size/large?v=v2&px=999" role="button" title="APIM4.png" alt="APIM4.png" /></span></P><P>Go back to your previously created API proxy and click on <STRONG>Policies </STRONG>(top right on your screen).</P><P>Create the following policies to secure the API Call (at least a bit).</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="svenhuberti_0-1724329953462.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/155966i7764AB09872C8D61/image-size/large?v=v2&px=999" role="button" title="svenhuberti_0-1724329953462.png" alt="svenhuberti_0-1724329953462.png" /></span></P><P>1- <STRONG>KeyValueMapOperations</STRONG> policy: retrieve the value of the Shopify key from the KVM. This policy will set the KVM value in a private variable (not exposed through logs or in debug mode).<BR /><BR /></P><PRE><KeyValueMapOperations mapIdentifier="Shopify" async="true" continueOnError="false" enabled="true" xmlns="http://www.sap.com/apimgmt"><BR /> <Get assignTo="private.Shopify.webhookkey"><BR /> <Key><BR /> <Parameter>WebHookKey</Parameter><BR /> </Key><BR /> </Get><BR /><Scope>environment</Scope><BR /></KeyValueMapOperations></PRE><P>2- <STRONG>KeyValueMapOperations</STRONG> policy: same as above, retrieve the value of the Cloud Integration credentials from the KVM.</P><PRE><KeyValueMapOperations mapIdentifier="CloudIntegration" async="true" continueOnError="false" enabled="true" xmlns="http://www.sap.com/apimgmt"><BR /> <Get assignTo="private.clientId"><BR /> <Key><BR /> <Parameter>clientId</Parameter><BR /> </Key><BR /> </Get><BR /> <Get assignTo="private.clientSecret"><BR /> <Key><BR /> <Parameter>clientSecret</Parameter><BR /> </Key><BR /> </Get><BR /><Scope>environment</Scope><BR /></KeyValueMapOperations></PRE><P>3- <STRONG>BasicAuthentication</STRONG> policy: creates a base64-encoded Authorization header, ie. basic authentication, for the integration flow, using the previously retrieved clientId and clientSecret from the KVM.</P><PRE><BasicAuthentication async='true' continueOnError='false' enabled='true' xmlns='http://www.sap.com/apimgmt'><BR /> <Operation>Encode</Operation><BR /> <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables><BR /> <User ref='private.clientId'></User><BR /> <Password ref='private.clientSecret'></Password><BR /> <AssignTo createNew="false">request.header.Authorization</AssignTo><BR /></BasicAuthentication></PRE><P>4- <STRONG>Python Script</STRONG> policy: executes a hash check. Indeed, we want to check that the call originated from Shopify and was not altered. This is done through the verification of the HMAC (Hash Message Authentication Code) sent from Shopify in a header, using the key available only to Shopify admins (in the encrypted KVM).</P><PRE><Script async="false" continueOnError="false" enabled="true" timeLimit="200" xmlns='http://www.sap.com/apimgmt'><BR /> <ResourceURL>py://HashCheck.py</ResourceURL><BR /></Script></PRE><P>Now add a new script on the left-hand side menu and name it just like the one you are referencing in your policy, eg. <STRONG>HashCheck.py.</STRONG></P><PRE>import hashlib<BR />import hmac<BR />import base64<BR />import random<BR />import string<BR /><BR />def make_digest(secret, payload):<BR />hashBytes = hmac.new(secret, msg=payload, digestmod=hashlib.sha256).digest();<BR />base64Hash = base64.b64encode(hashBytes);<BR />return base64Hash;<BR /><BR />message = "";<BR />message = flow.getVariable("request.content");<BR /><BR />webhookHash = flow.getVariable("request.header.X-Shopify-Hmac-Sha256");<BR />resultHash = make_digest( flow.getVariable("private.Shopify.webhookkey"), str(message) );<BR />flow.setVariable("resultHash",resultHash);<BR /><BR />lettersAndDigits = string.ascii_letters + string.digits;<BR />randomKey = ''.join((random.choice(lettersAndDigits) for i in range(44)));<BR /><BR />flow.setVariable("randomKey",randomKey);<BR />doubleWebhookHash = make_digest( randomKey, webhookHash );<BR />doubleResultHash = make_digest( randomKey, resultHash );<BR /><BR />flow.setVariable("doubleWebhookHash",doubleWebhookHash);<BR />flow.setVariable("doubleResultHash",doubleResultHash);<BR /><BR />if (doubleResultHash != doubleWebhookHash):<BR />raise NameError("Invalid Origin! Different HMAC.")</PRE><P><STRONG>Update, save and deploy</STRONG><STRONG> </STRONG>the API Proxy.</P><P>Now copy the URL of the API Proxy from the overview.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="svenhuberti_1-1724330603431.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/155987i6369F7A681E272EB/image-size/large?v=v2&px=999" role="button" title="svenhuberti_1-1724330603431.png" alt="svenhuberti_1-1724330603431.png" /></span></P><P>If you test the API Proxy through Postman, you will see that API Management is preventing you to do so since the Hash-Check was unsuccessful. Indeed: both the HMAC-SHA header as well as the payload are missing.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="svenhuberti_2-1724330898695.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/155988i98D4E32DD4F5B63B/image-size/large?v=v2&px=999" role="button" title="svenhuberti_2-1724330898695.png" alt="svenhuberti_2-1724330898695.png" /></span></P><P>This is why we now test it <EM>in situ</EM>, using Shopifiy's webhook.</P><P> </P><H2 id="toc-hId--332246540">Update Shopify</H2><P>Go back to your Shopify account and update the WebHook URL with the API proxy URL.</P><P>If you perform a new test, you should now see the integration flow being triggered properly:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="svenhuberti_3-1724331066253.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/155989i421807A498E92CD2/image-size/large?v=v2&px=999" role="button" title="svenhuberti_3-1724331066253.png" alt="svenhuberti_3-1724331066253.png" /></span></P><P>If you have time, you can also intercept the webhook call from Shopify through API Management Debug, and recreate the call in Postman using the <SPAN>X-Shopify-Hmac-Sha256 header value and the payload. This call will work, but as soon as you play the "man-in-the-middle", ie. as soon as you alter the payload, you will get an error.</SPAN></P><P><span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="svenhuberti_0-1724393554687.png" style="width: 999px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/156286iEFE35012CF68138E/image-size/large?v=v2&px=999" role="button" title="svenhuberti_0-1724393554687.png" alt="svenhuberti_0-1724393554687.png" /></span></P><H2 id="toc-hId--528760045"> </H2><H2 id="toc-hId--725273550">Mapping in the integration flow</H2><P>In order to properly communicate to the backend system, you need to perform a mapping between incoming Shopify message and the expected S/4HANA message structures.</P><P>This is done using the <STRONG>message mapping</STRONG> flow step, but very much depends on your own setup. Hence I am not going through the details.</P><P>However, note that you will need to create an OpenAPI specification from the Shopify webhook call since it is not provided in the documentation. Also, AFAIK, there is no documentation of the data structure of an order, at least not in a usable YAML or JSON format. Feel free to comment if I have overseen anything!</P><P>For the OpenAPI spec, the steps I took were:</P><OL><LI>Get the payload from the Webhook APICall (Debug of API Management for instance)</LI><LI>Transform the payload into a JSON data structure<BR /><A href="https://roger13.github.io/SwagDefGen/" target="_blank" rel="noopener nofollow noreferrer">https://roger13.github.io/SwagDefGen/</A><BR /><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="svenhuberti_1-1724394090600.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/156306i6F0E3F9D34BB124C/image-size/medium?v=v2&px=400" role="button" title="svenhuberti_1-1724394090600.png" alt="svenhuberti_1-1724394090600.png" /></span></LI><LI>Create an OpenAPI file and inject that data structure in the schema part of the OpenAPI definition<BR /><A href="https://editor.swagger.io/" target="_blank" rel="noopener nofollow noreferrer">https://editor.swagger.io/</A> <BR /><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="svenhuberti_2-1724394297290.png" style="width: 400px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/156307i9E2498EE3570B0A0/image-size/medium?v=v2&px=400" role="button" title="svenhuberti_2-1724394297290.png" alt="svenhuberti_2-1724394297290.png" /></span><BR />When importing that OpenAPI specification into the message mapping flow step of your integration flow, you will notice that some fields could not properly be translated into a proper structure because of missing values.<BR />I replaced the empty properties with dummy properties, enough for the pilot.<PRE>"note_attributes": {<BR /> "type": "array",<BR /> "items": {<BR /> "type": "object",<BR /> <STRONG><FONT color="#FF0000">"properties": { }</FONT></STRONG><BR /> }<BR />},</PRE><PRE>"note_attributes": {<BR /> "type": "array",<BR /> "items": {<BR /> "type": "object",<BR /> <FONT color="#339966"><STRONG>"properties": {</STRONG></FONT><BR /><FONT color="#339966"><STRONG> "note_attribute_property": {</STRONG></FONT><BR /><FONT color="#339966"><STRONG> "type": "string",</STRONG></FONT><BR /><FONT color="#339966"><STRONG> "description" :"Dummy note attribute property"</STRONG></FONT><BR /><FONT color="#339966"><STRONG> }</STRONG></FONT><BR /><FONT color="#339966"><STRONG> }</STRONG></FONT><BR /> }<BR />},</PRE></LI></OL><H1 id="toc-hId--281129691"> </H1><H1 id="toc-hId--477643196">Conclusion</H1><P>Using the SAP BTP Integration Suite, we have quite quickly created the communication between a cloud application webhook and an S/4HANA system.</P><P>As said before, this is only a pilot and a production-grade setup would need additional features such as traffic management or IP filtering, as well as a mapping, possibly more processing in the integration flow and a better security concept.</P><P>Best regards!<BR />Sven</P><P> </P>2024-08-23T09:09:51.067000+02:00https://community.sap.com/t5/technology-blogs-by-members/sap-cloud-integration-archiving-with-quot-opentext-core-archive-for-sap/ba-p/13804711SAP Cloud Integration archiving with "OpenText Core Archive for SAP Solutions"2024-08-23T11:22:20.605000+02:00maxi1555https://community.sap.com/t5/user/viewprofilepage/user-id/126013<P>Hi all,</P><P>This blog is just to bring to light a standard archiving solution working out of the box for SAP Cloud Integration using the "OpenText Core Archive for SAP Solutions".</P><P>In one hand If you check carefully <A href="https://www.opentext.com/products/core-archive-for-sap-solutions" target="_self" rel="nofollow noopener noreferrer">the documentation of such product</A> you will notice that there is a standard "CMIS interface" to "Store & Retrieve any content", in the other hand SAP Cloud Integration uses "CMIS interface" <A href="https://help.sap.com/docs/cloud-integration/sap-cloud-integration/archiving-data-cloud-foundry-environment" target="_self" rel="noopener noreferrer">out of the box for archiving</A>, so why not put them together? <span class="lia-unicode-emoji" title=":winking_face:">😉</span></P><P>In a nutshell the following steps need to be followed to have a successful integration:</P><P><STRONG>OpenText – Core Archive - Administration ( http://<host>:<port>/archive/ba/index.jsp )</STRONG><BR />-Creation of Retention Policy ( Optional )<BR />-Creation of Collection with CMIS Client: You will get the CMIS Browser Binding & RepositoryId - required for the SAP BTP Destination</P><P><STRONG>CMIS Workbench ( in your local machine ) </STRONG><BR />-Import custom CMIS type into OpenText Core Archive: It would be nice than SAP provided this definition, but you can extract it from the traces of Cloud Connector or OpenText Core Archive ( SAP Cloud Integration check if the CMIS type exist via APIs, in case that it does not exist it will try to create on the fly, but this will not work due to OpenText Core Archive, so it must be created manually ).<BR />-Export custom CMIS type from OpenText Core Archive: You will extract the ID for the CMIS type ( OpenText create randoms IDs internally, it is not keeping the IDs provided for the import file ) - required for the SAP BTP Destination ( <A href="https://help.sap.com/docs/cloud-integration/sap-cloud-integration/configuring-destination" target="_blank" rel="noopener noreferrer">https://help.sap.com/docs/cloud-integration/sap-cloud-integration/configuring-destination</A> )</P><P><STRONG>SAP Cloud Connector Set-Up</STRONG><BR />-Expose the OpenText Core Archive & CMIS resources: Add the OpenText Core archive system and expose everything under "/as_cmis"</P><P><STRONG>SAP – BTP – Service Instance & Service Key</STRONG><BR />-Create Destination: Just use the CMIS Browser Binding & RepositoryId, Cloud Connector Location ID, and user with write permissions, and the most important part is the additional property "CustomAttributeAndTypeNamesMapping" ( <A href="https://help.sap.com/docs/cloud-integration/sap-cloud-integration/configuring-destination" target="_blank" rel="noopener noreferrer">https://help.sap.com/docs/cloud-integration/sap-cloud-integration/configuring-destination</A> )</P><P><STRONG>SAP Cloud Integration enable archiving</STRONG><BR />-Enable archiving: enable the archiving functionality ( <A href="https://help.sap.com/docs/cloud-integration/sap-cloud-integration/enable-archiving-in-cloud-foundry-environment" target="_blank" rel="noopener noreferrer">https://help.sap.com/docs/cloud-integration/sap-cloud-integration/enable-archiving-in-cloud-foundry-environment</A> )</P><P><STRONG>OpenText – Core Archive - Access ( http://<host>:<port>/archive/access/index.jsp )</STRONG><BR />-Navigate the collection: Enjoy an out of the box solution to navigate & search archived files by all the attributes enabled for it.</P><P>Not forget, be curious! <span class="lia-unicode-emoji" title=":winking_face:">😉</span></P><P>Max.</P><P> </P><P> </P><P> </P><P> </P>2024-08-23T11:22:20.605000+02:00https://community.sap.com/t5/technology-blogs-by-members/exciting-course-alert-modernizing-integration-with-sap-integration-suite/ba-p/13805385🚀 Exciting Course Alert: Modernizing Integration with SAP Integration Suite 🚀2024-08-23T16:23:05.162000+02:00ShaikAzmathullahttps://community.sap.com/t5/user/viewprofilepage/user-id/130494<P>Exciting news for those looking to enhance their integration expertise! Starting August 28, 2024, SAP is offering a free learning course titled "Modernizing Integration with SAP Integration Suite." This course provides a thorough introduction to SAP Integration Suite and its transformative capabilities.</P><P><STRONG>Course Overview</STRONG></P><P>The course covers essential aspects of SAP Integration Suite, including:</P><UL><LI><STRONG>Key Capabilities</STRONG>: Learn about the core features of SAP Integration Suite and how they streamline integration processes.</LI><LI><STRONG>Enterprise-Wide Integration Strategy</STRONG>: Understand the critical role of a well-defined integration strategy in today’s digital landscape.</LI><LI><STRONG>AI and iPaaS Integration</STRONG>: Explore how artificial intelligence and SAP’s integration platform-as-a-service (iPaaS) can modernize and innovate your enterprise.</LI></UL><P><STRONG>Why Enroll?</STRONG></P><UL><LI><STRONG>Accelerate Cloud Migration</STRONG>: Implement a hybrid integration approach to speed up your transition to the cloud.</LI><LI><STRONG>Enhance Business Agility</STRONG>: Utilize the diverse tools and prepackaged content of SAP Integration Suite to boost business responsiveness.</LI><LI><STRONG>Modernize Your Enterprise</STRONG>: Leverage SAP’s iPaaS to transform your organization into an intelligent, modern enterprise.</LI></UL><P><STRONG>Join the Discussion</STRONG></P><P>The course includes access to an online discussion forum from August 28 to September 30, 2024. Engage with SAP experts, ask questions, and collaborate with fellow learners to enrich your understanding.</P><P><STRONG>Register Now</STRONG></P><P>Don’t miss this opportunity to advance your skills with SAP. <A href="https://learning.sap.com/learning-journeys/modernizing-integration-with-sap-integration-suite" target="_blank" rel="noopener noreferrer">Sign up today</A> and start your journey to mastering SAP Integration Suite!</P>2024-08-23T16:23:05.162000+02:00https://community.sap.com/t5/technology-blogs-by-members/cpilint-version-1-0-5-is-here/ba-p/13810431CPILint version 1.0.5 is here2024-08-29T01:40:40.485000+02:00MortenWittrockhttps://community.sap.com/t5/user/viewprofilepage/user-id/40<P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CPILint-1.0.5.png" style="width: 796px;"><img src="https://community.sap.com/t5/image/serverpage/image-id/159107i1095FE3FB0EE3D02/image-size/large?v=v2&px=999" role="button" title="CPILint-1.0.5.png" alt="CPILint-1.0.5.png" /></span></P><P>The very first version of CPILint was released on August 31st, 2019. With the 5th anniversary just around the corner, I am excited to announce that version 1.0.5 is complete and ready for you to install.</P><P>If you already run version 1.0.4, you will automatically be notified that there is a new version available. You can also go <A href="https://github.com/mwittrock/cpilint/releases/latest" target="_blank" rel="noopener nofollow noreferrer">directly to GitHub</A> to download it.</P><P>In this blog post, I will give you an overview of what’s in version 1.0.5. If you are new to CPILint, let me start by giving you the elevator pitch:</P><P>CPILint is an open-source tool that automates your SAP Cloud Integration governance. It ships with a range of built-in rules covering topics like developer guidelines, naming conventions and security. You choose the rules you want to put in place, and CPILint does the heavy lifting of checking your integration flows for compliance.</P><P>Now, let’s take a look at all the good stuff in the new release!</P><H2 id="toc-hId-1044183133">OAuth 2.0 support</H2><P>CPILint communicates with your SAP Cloud Integration tenant via the official OData API. This requires authorization, of course, and so far we’ve done this by providing a username and password.</P><P>In version 1.0.5, however, you can authorize simply by creating a service key for CPILint in the SAP BTP Cockpit and downloading it to your local machine. You use the new <FONT face="courier new,courier">-key</FONT> command line option to point to that key. CPILint then uses your key to authorize its API calls using the OAuth 2.0 client credentials flow.</P><P>This has several benefits for you. First off, you no longer need to provide a username and password. Second, since the tenant hostname is already in the key, you no longer need to provide that either. Third, running CPILint with minimal permissions is now very easy to get right. Finally, the OAuth 2.0 client credentials flow is more secure than basic authentication.</P><P>With the new OAuth 2.0 support, checking your entire tenant for compliance is now as simple as:</P><P><FONT face="courier new,courier">cpilint -key my-key.json -rules my-rules.xml</FONT></P><P>Short and sweet!</P><H2 id="toc-hId-847669628">Rules file import</H2><P>Up until now, every single rule you wanted to check had to be stored in a single rules file. With CPILint version 1.0.5, we get a lot more flexibility. The new version introduces the ability to import a rules file into another rules file. You do this using the new <FONT face="courier new,courier"><import></FONT> element.</P><P>If you have, for instance, a separate rules file for a specific project package but also want to reuse naming conventions that apply to the entire tenant, you can now simply import those naming conventions into the project’s rules file like this:</P><P> </P><pre class="lia-code-sample language-markup"><code><cpilint>
<imports>
<import src="/path/to/naming-conventions.xml"/>
</imports>
<rules>
<!-- Your project-specific rules would go here. -->
</rules>
</cpilint></code></pre><P> </P><P>This feature opens up entirely new ways to shape and mold your rules files and I’m excited to see how the community will put it to use! To learn more about rules file imports, visit <A href="https://github.com/mwittrock/cpilint/wiki/Rules-and-the-rules-file" target="_blank" rel="noopener nofollow noreferrer">this wiki page</A>.</P><H2 id="toc-hId-651156123">New rule: UserRoles</H2><P>UserRoles is a new rule in CPILint 1.0.5 that lets you specify which user roles should and should not be used in sender channels that support user role authorization (meaning AS2, AS4, HTTPS, IDoc, SOAP, XI, and OData). If you, for instance, do not allow the use of the default user role (ESBMessaging.send), you would add this rule:</P><P> </P><pre class="lia-code-sample language-markup"><code><disallowed-user-roles>
<disallow>ESBMessaging.send</disallow>
</disallowed-user-roles></code></pre><P> </P><P>You can also use the UserRoles rule to require, for instance, that only certain custom user roles be used.</P><H2 id="toc-hId-454642618">Other news</H2><P>1.0.5 adds 30 supported names to the NamingConventions rule. Check out <A href="https://github.com/mwittrock/cpilint/wiki/The-NamingConventions-rule" target="_blank" rel="noopener nofollow noreferrer">this page</A> in the CPILint wiki for the full list of supported names.</P><P>There’s a new command line option called <FONT face="courier new,courier">-skipvercheck</FONT> that skips the automatic check for a new version. If you run CPILint in a non-interactive way, like for instance in a CI/CD pipeline or other automation context, you might want to do this to save a little time and bandwidth.</P><P>The DuplicateResourcesNotAllowed rule now supports JSON resources.</P><P>There is now <A href="https://github.com/mwittrock/cpilint/wiki/FAQ" target="_blank" rel="noopener nofollow noreferrer">an FAQ page</A> in the project wiki.</P><P>Last but definitely not least: The CPILint ASCII art is now 3D. Yes, I saved the best for last!</P><H2 id="toc-hId-258129113">Over to you</H2><P>That’s it for the CPILint 1.0.5 overview. Take the new release for a spin and please share your feedback with me in the comments below.</P>2024-08-29T01:40:40.485000+02:00