Supply Chain Management Blogs by Members
Learn about SAP SCM software from firsthand experiences of community members. Share your own post and join the conversation about supply chain management.
cancel
Showing results for 
Search instead for 
Did you mean: 
joaog_romio
Explorer
1,379


In the latest SAP IBP 2502 release, SAP introduced SAP_COM_0A72 – Planning - Detailed Pegging Data Read, an API designed for pegging data extraction, enabling integration with external systems.

SAP has provided official documentation, which you can check out at this link:

🔗SAP IBP Detailed Pegging Data Read API Documentation

Additionally, you can test the API in the SAP Business Accelerator Hub using the link below:

🔗Test IBP_DetailedPeggingService API

However, while attempting to execute the process, I found that some key points were not entirely clear in the documentation.

For that reason, I created this detailed post to guide you through the process. I hope it proves useful for anyone looking to explore this new functionality!

So, let's get started with our step-by-step guide! 🚀


First, we need to create two communication arrangements:

  • SAP_COM_0A44 – Planning – Order Data Snapshot Integration
  • SAP_COM_0A72 – Planning – Detailed Pegging Data Read Integration

Creating the communication arrangements is straightforward:

  1. Create a communication user:
    Access the "Maintain Communication Users" app. In this step, you only need to fill in the "User Name" and "User Description" fields. You can either manually enter a password or click "Propose Password" to generate one automatically. If you choose the latter, make sure to save the password, as it will not be visible after saving, and you will need it in the following steps. Click Save.

    1.png
  2. Create a communication system:
    Go to the "Communication System" app and create a new system. Again, fill in the Name and Description fields.
    • In the General Data tab → Technical Data section → General, select the option "Inbound Only".
    • Finally, in the Users for Inbound Communication tab, click "+", select "User Name and Password", and then search for the communication user created in the previous step.
    • Click Save2.png3.png
  3. Create the communication arrangements:
    • Open the "Communication Arrangements" app, click New, and search for the scenario SAP_COM_0A44.
    • In the setup screen, select the Communication System created in the previous step.

Repeat this process for the SAP_COM_0A72 scenario. You can use the same Communication System and Communication User.4.png

Ok, now you have everything set up on the IBP side to call the APIs.

We can proceed in two ways: either by using SAP's website to test the API or by using API testing software such as Postman. In this case, we will use SAP's website.

The first step is to create our snapshot. To do this, go to:
https://api.sap.com/api/IBP_Snapshot_RAP_ODataService/tryout

Once the page loads, go to "Select Environment" and create a new environment.

5.png

 

On this screen, you need to fill in the following parameters:

  • Display Name – You can choose any name.
  • Hostname – This typically looks like myxxxxxx-api.scmibp.ondemand.com, but you can check the correct name in the "Communication Arrangement" app under the "API-URL" field.
  • User Name – The user created in the Communication User setup step.
  • Password – The password set during the Communication User creation (I hope you noted it down as I suggested!).

  • Finally, click Configure.
    6.png

First, we will execute the GET method:

  • GET /IBPTransaclSnapshot – Retrieves all created snapshot definitions.
    • This method displays the existing snapshots, but we will also use it to generate a token for our session, which will be required in the POST request. (Don't worry, I’ll show you how to do this.)

Next, we will execute the POST method:

  • POST /IBPTransaclSnapshot – Creates a pegging snapshot with the desired definitions.
    • In the header, we will pass the token obtained from the previous step.
    • In the body, we will define the snapshot parameters using JSON format. (Don't worry, I’ll provide an example.)
    • Once successfully executed, this method will return a Snapshot ID (IBPTransaclSnpshtID), which we will use in our final request.

The last transaction for the snapshot is:

  • POST /IBPTransaclSnapshot({IBPTransaclSnpshtUUID})/SAP__self.CalculateSnapshot
    • Here, {IBPTransaclSnpshtUUID} is the ID generated in the previous step.

Now, let’s get to work!

⚠️Before anything else, don’t forget to select the environment we created.

First, let’s execute the GET method:

  • GET /IBPTransaclSnapshot

7.png

Now, we need to generate the token. To do this, go to the Headers tab:

  • Click "Add New Header"
  • Find the parameter "x-csrf-token"
  • Set its value to "fetch", as shown in the example
    8.png

    Click "Run" and check the result in the "Response Body" tab.

    • If everything is correct, the response should return status code 200, indicating success.
    • Any 4xx status codes indicate an error, such as incorrect username/password or an invalid request URL. In this case, review the parameters configured in the environment or the steps followed when creating the Communication Arrangements.

    Since you haven’t created a snapshot yet, the response will likely be empty. However, in my case, it listed all previously created snapshots.


    9.png
    Now, go to the "Response Headers" tab and look for the parameter "x-csrf-token".
    Copy the value of this token, as we will use it in the next step.10.png

    Now, let’s execute the POST method:

    • POST /IBPTransaclSnapshot

    In the Headers tab:

    • Create a new parameter: "x-csrf-token"
    This time, instead of using "fetch", paste the token value copied from the previous step.

    11.png
  • In the Body section, you will define the parameters for generating your snapshot.
  • You can refer to SAP's help documentation for detailed configurations, but here, I will use the example I applied in my case.
    12.png

 

 

{
  "IBPTransaclSnpshtDesc": "Detailed Pegging in PLANNINGAREA VERSION",
  "IBPTransaclSnpshtID": "TEST BLOG",
  "PlanningAreaID": "YOUR_PA_ID",
  "VersionID": "BASELINE",
  "_IBPDetldPggngSnpshtFilter": {  
    "_IBPDetPggngPrimDmndDTpFilter": [
      {
        "Operator": "EQ",
        "PrimaryDemandDocTypeValueFrom": "SD_ITM"
      },
         {
        "Operator": "EQ",
        "PrimaryDemandDocTypeValueFrom": "DEL_ITM"
      },
	   {
        "Operator": "EQ",
        "PrimaryDemandDocTypeValueFrom": "DSTR_ITM"
      },
         {
        "Operator": "EQ",
        "PrimaryDemandDocTypeValueFrom": "FCST"
      }
    ],
       "_IBPDetPggngUnpSplIsSplFltr": [
      {
        "Operator": "EQ",
        "UnpeggedSupplyIsSplit": true
      }
    ],
        "_IBPDetPggngPeggingLvlFltr": [
      {
        "Operator": "LT",
        "PeggingLevelValueFrom": 6     
      }
    ],
        "_IBPDetPggngPrimDmndRTFltr": [
      {
        "Operator": "BT",
        "PrimaryDemandReqdTimeValueFrom": "2024-05-01T00:00:00Z",
        "PrimaryDemandReqdTimeValueTo": "2025-12-31T00:00:00Z"
      }
    ]
  }
}
​

 

 

 

  • Click Run and check the results! 

You will see that the request was executed successfully, and the response includes the Snapshot ID (IBPTransaclSnpshtUUID). We will use this ID in the next step. Please take note.


13.png


Also, note that the snapshot status is set to "INITIAL", meaning it is not yet ready to be extracted.

For the snapshot to be extractable, its status must change to "EXTRACTABLE".

Now, let's calculate the snapshot using the POST method:

  • POST /IBPTransaclSnapshot({IBPTransaclSnpshtUUID})/SAP__self.CalculateSnapshot

Steps:

  1. In the parameters section, fill in IBPTransaclSnpshtUUID with the ID generated in the previous step.
    14.png
  2. In the Headers tab, add "x-csrf-token" again, using the token obtained in Step 1.

    ⚠️Important: The x-csrf-token is only valid for the current session and is not a permanent ID. If the session expires, you will need to generate a new token.

    15.png

  3. Click Run and check the results! 16.png

    All set! Now our snapshot has the status "EXTRACTABLE", meaning it is ready for data extraction. 🎉

    Important Note: Snapshots have an expiration time after they are calculated. Their validity lasts for 6 hours, after which they lose the "EXTRACTABLE" status.

    How to extend the snapshot validity:

    You can use the POST method:

    🔹POST /IBPTransaclSnapshot({IBPTransaclSnpshtUUID})/SAP__self.ExtendSnapshotValidity

    • This works similarly to the snapshot calculation API.
    • You need to provide:
      • The x-csrf-token
      • The IBPTransaclSnpshtUUID of the snapshot you want to extend

    How to delete a snapshot:

    If needed, you can delete a snapshot using the DELETE method:

    🔹DELETE /IBPTransaclSnapshot({IBPTransaclSnpshtUUID})

    • Again, you need to pass the appropriate parameters (token and snapshot UUID).

    This ensures you can manage your snapshots efficiently!

    Now, let's move on to our second API, where we can extract the snapshot data:

    🔗IBP Detailed Pegging Service API

    17.png

    This API is very simple—it only has a GET method:

    • GET /IBPDetailedPegging

    You can apply filters, choose specific data, or simply run it.

    • If you have a snapshot with the status "EXTRACTABLE", the data will be retrieved automatically in JSON format.

    ⚠️Reminder: Don’t forget to configure the environment just like we did for the Snapshot API!

    18.png

    And that's it, everyone! 🎉 The data is now ready in a structured format. 🚀

3 Comments
LucasSei
Discoverer
0 Kudos

Hi everyone,

I'm encountering an issue while following the steps for creating and maintaining snapshot definitions and data. Specifically, when executing the POST /IBPTransactionalSnapshot request, I receive the following error:

"Version ID BASELINE does not exist for planning area *****"

LucasSei_0-1742421254637.png

Has anyone faced this issue before? Any insights on what might be causing this or how to resolve it would be greatly appreciated.

Thanks in advance!

joaog_romio
Explorer

Good afternoon, sorry for the delay in replying.

This is quite a strange error. Would it be possible for you to run the test in another version to see if the same error occurs?

Also, could you try testing with an underscore before BASELINE, like "_BASELINE", and see if the issue persists?

LucasSei
Discoverer

Hi Joao, thanks for the answer

We did exactly that a week ago and it works.
The issue was the Version ID, somehow using "__BASELINE" works.

Thank you again for the article which is very useful

Labels in this area