SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Save, Filter and Get your needed data in your Integration Flow

Boost your Integration Suite skills leveraging different tasks to store and filter messages travelling through your Integration Flow.

Overview

🎓 beginner 10 min. SAP Integration SuiteBeginnerFree TierCloud IntegrationSAP Business Technology Platform

You will learn

  • โœ”How to store, get and filter data to prepare your payload for specific request calls within the Integration Flow.
Mariajose Martinez M Mariajose Martinez November 21, 2022
Created by October 28, 2022
Contributors

Prerequisites

Prerequisites

Steps

Step 1 Add Converters, Write and Filter Tasks
โ€”

  1. As SAP Cloud Integration works with XML and the expected payload from Open Connector/Stripe is in JSON, you need to add a JSON to XML converter in order to store the initial payload from SAP Build Apps in CPI and retrieve it when the payment transaction is successfully done.

  2. Uncheck the “Add XML Root Element” box. You’ll use the payload with the root as it comes.

    Adding the JSON to XML Converter
    Adding the JSON to XML Converter

  3. Add a Write task to store the initial payload you are going to send from SAP Build Apps. Select it from the cube “Persistence” and “Data Store Operations”.

    Write Task
    Write Task

  4. Add the following:

    • Data Store Name: AppGyverSavedPayload

    • Visibility: Integration Flow

    • Entry ID: message1

    • Retention Threshold for Alerting (in days): reduce it to 1 day.

    • Expiration Period (in days): reduce it to 2 days.

    • Uncheck the “Encrypt Stored Message” box. For this exercise you are not going to encrypt the message.

      Write Task
      Write Task

  5. Add a “Filter” task. This is needed to only send the payment data to stripe.

  6. Add this Xpath Expression in the Processing Tab: /AppGyverSalesOrder/paymentData and select Nodelist as the Valuetype. It is needed to select Nodelist as there is a list in the main payload:

    JSON
    {
    "AppGyverSalesOrder": {
        "customer": {
        "ObjectID": "<Object ID from SAP C4C>",
        "BuyerPartyID": <BuyerPartyID from SAP C4C>
        },
        "paymentData": {
        "amount": <Payment transaction amount to be processed in Stripe>,
        "customer": "<stripe customer id>",
        "currency": "<currency selected in stripe account>",
        "source": "<card id>",
        "description": "Test payment via CPI"
        },
        "product": [
        {
            "ProductID": "<Product ID from SAP C4C>",
            "Quantity": <Product quantity to be purchased>
        }
        ]
    }
    }

    Note: Bear in mind that the “customer” and “product” objects are included as part of the whole scenario. You’ll need them for requesting SAP Sales and Service Core a sales order creation, which you’ll see in the next tutorial.

    It should look like this:

    Filter Task
    Filter Task

  7. Add a XML to JSON converter. Stripe needs a JSON object to create the payment transaction. Make sure you select UTF-8 as the JSON Output Encoding, and check the box “Suppress JSON Root Element”, this is important to be able to enter the data inside the XPath Expression without the “parent” root:

    XML to JSON Converter
    XML to JSON Converter

Step 2 Test your Integration Flow
+
Step 3 Add a Get Task
+
Step 4 Check your knowledge
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 4
1. Add Converters, Write and Filter Tasks 2. Test your Integration Flow 3. Add a Get Task 4. Check your knowledge

Learn more →