Financial Management Blog Posts by SAP
Get financial management insights from blog posts by SAP experts. Find and share tips on how to increase efficiency, reduce risk, and optimize working capital.
cancel
Showing results for 
Search instead for 
Did you mean: 
paulgabog
Product and Topic Expert
Product and Topic Expert
2,190

There are several strategies on how to read and manipulate data from external application in SAP PaPM Cloud. However there are instances wherein if database are not exposed, we are only limited to do specific pulling mechanism. In this blogpost, I will share with you step by step guide on how you can leverage S/4HANA Cloud APIs to be used in SAP PaPM Cloud Standard Model (SM) and Universal Model (UM).

 

Prerequisite

  1. You have access with proper admin roles to an S/4HANA Public Cloud system
  2. You have destination administration access to SAP BTP where your SAP PaPM Cloud resides. Including SAP PaPM Cloud roles for Modeling and Connection configuration.  

 

Scenario:

User1 is tasked to read general ledger account line items from S/4HANA Public Cloud System. User1 saw in the help portal documentation that there is an API OData V2 which can be used for it which is G/L Account Line Items - Read (A2X). User2 on the other hand wants to read consolidation task and assignments of consolidation document type and found an API Odata V4 which can be used: Consolidation Task ‒ Read

Both users would want to use SAP PaPM Cloud SM or UM to check if they can read on through using above API Service.

Read on through for the steps 😊

S/4HANA Cloud Setup

There are three main setup to be done here namely: Maintaining Communication User, Creation of Communication System and Creation of communication arrangements, read on below to see how it can be done:

1.      Create Communication User

  1. In your SAP S/4HANA Cloud system, go to Communication Management .
  2. Choose Maintain Communication Users Tile
  3. Choose New and in the dialog box which appears enter your desired UserName, Description and Propose a password. Please take note to save the password into a secured location on your local since it will not appear again once you hit Create.
  4. Choose Create
    CreateCommunicationUserGIF3.gif

2.      Create Communication System

  1. Go back to Communication Management and choose Communication Systems Tile
  2. Choose New and in the dialog box which appears enter your desired System ID. System Name will automatically be populated. Choose Create
  3. Since we are only aiming for inbound connection to PaPM Cloud, choose the checkbox for Inbound Only.
    CreateCommunicationSystemP1.gif
  4. Choose Users for Inbound Communication tab and Choose ‘+’ button.
  5. Add the Communication User created in Step 1 then choose OK.
  6. Choose Save.
    CreateCommunicationSystemP2.gif

 

3.      Create Communication Arrangement

  1. Go back to Communication Management and choose Communication Arrangements Tile
  2. Choose New and in the dialog box which appears enter the Scenario and desired Arrangement Name.
    Note: You can verify what Communication Scenario you need in the API Resource Attribute section in the api documentation. See example below.
    Communication Arrangement - Scenario Screenshot.png
  3. Choose Create
    CommunicationArrangementP1.gif
  4. In the required field communication System, Choose the Communication System you created from Step 2.
  5. Please take note of the API-URL as you would need this to create SAP BTP Destination in a later step.
  6. User Name will be populated automatically because it have assigned it in the selected Communication system.
  7. Please take note of the Service URL/Service Interface information as you would need this to populate information of SM or UM connections in a later step. In addition, be aware that this part https://my300470-api.s4hana.ondemand.com changes depending on your S/4HANA Cloud system.
    e.g.

    Service

    Application Protocol

    Service URL/Service Instance

    G/L Account Line Items - Read (A2X)

    Odata V2

    https://my300470-api.s4hana.ondemand.com/sap/opu/odata/sap/API_GLACCOUNTLINEITEM    

    Consolidation Task ‒ Read

    Odata V4

    https://my300470-api.s4hana.ondemand.com/sap/opu/odata4/sap/api_consolidationtask/srvd_a2x/sap/conso...

CommunicationArrangementP2.gif

h. Scroll down to Outbound communication section. This is required only if you will do outbound scenarios however this blogpost is only limited to inbound scenario. In order to bypass the required User Name field, untick all Outbound Service Status.

i. Choose Save.
CommunicationArrangementP3.gif

j. Perform steps a-i for the other required Communication Scenario if needed.

 

BTP Destination Configuration

Use below information to create Destination relevant to bridge S/4HANA Public Cloud to SAP PaPM Cloud.

  1. In SAP BTP Cockpit, go to the subaccount and Choose Destinations.
  2. Choose Create Destination and populate with below information

    Name

    Unique name of destination in current subaccount.
    e.g. S4toPaPMC

    Type

    Select “HTTP”.

    Description

    Any description for the destination name.

    URL

    API-URL from Step 3e of Create Communication Arrangement
    e.g. https://my300470-api.s4hana.ondemand.com

    Proxy Type

    Internet

    Authentication

    BasicAuthentication

    User

    User created from Step 1c of Create Communication User
    e.g. PAPMCS4_TECHUSER

    Password

    Proposed Password from Step 1c of Create Communication User

  3. Choose Save.
    CreateBTPDestination.gif

SAP PaPM Cloud SM Modeling – Read Data via Odata Connection

As you may have already know, SAP PaPM Cloud Standard Model only supports Odata type V4 hence in this example, we will be using the information from Consolidation Task ‒ Read API.

  1. Login to Standard Model and go to Connection Management Application. By following the procedure on help portal documentation, Create an Odata Connection based from below data:

    Connection Name

    Unique name of connection in the tenant

    Connection Class

    Select “Default”

    Connection Source

    Select “Odata”

    Connection Description

    Any phrase you wish to describe details about the connection

    Destination Name

    Destination created from previous step e.g. S4toPaPMC

    Entity Set

    Service structure entity of the S/4HANA Cloud API e.g. ConsolidationTask

    Service Root

    Specifies the root of service URL from Step 3g of Communication Arrangement e.g.
    https://my300470-api.s4hana.ondemand.com/sap/opu/odata4/sap/api_consolidationtask/srvd_a2x/sap/consolidationtask/0001/

    Maximum page size

    1000 (Default)


    SMConnection.png

  2. In a Created Environment, configure a Model View Odata and feed the information of the connection created above. Activate the Model View Odata and choose ‘Run’ to populate the data.
    SMModelingModelView.png

SAP PaPM Cloud UM Modeling – Read Data via Odata Service Connection

OData V4

SAP PaPM Cloud Universal Model supports both Odata V2 and Odata V4 and in terms of configuration they follow the same steps. Let’s take a look if we can load the data of both APIs mentioned above.

  1. Login to Universal Model and go to Connection Application. By following the procedure on help portal documentation, Create an Odata Service Connection based from data below:

    Environment

    Environment ID to where a connection will be created
    e.g. ODATAV4CON

    Connection Target Type

    Select “Odata Service”

    Connection Name

    Unique name of Connection within the Environment
    e.g. S/4HANACloud to Universal Model OData V4

    Description

    Any phrase you wish to describe details about the connection

    Model Filter

    Used to filter out the models coming from the target to the ones which match the expression (pattern). Supports JavaScript regular expressions. It is optional and can be empty.

    Destination Name

    Destination created from previous step e.g. S4toPaPMC

    Service Path

    Specifies the root of service URL from Step 3g of Communication Arrangement e.g.
    https://my300470-api.s4hana.ondemand.com/sap/opu/odata4/sap/api_consolidationtask/srvd_a2x/sap/consolidationtask/0001/

    Default Key Field

    Existing environment field of data type “String” or “UUID” created by the user and not registered from a different connection.

    Parent Folder

    All models synced from the connection to the environment will have this folder function as parent. It is optional and can be empty.


    UMOdataV4FConnection.png
  2. On Edit Mode, you can rename and remove the Models which you do not want to be added in the Environment
    UM Rename Remove Model.png
  3. Choose a Model e.g. ConsolidationTaskME. On the left hand side,
    a. Choose the checkbox
    b. Choose Add Fields button to register the field into the environment
    c. If you do not want to carry over the relation, you can uncheck this option.
    d. Apply Changes then Save on next dialog box.
    UM Add Fields or Relations.png
  4. Choose Sync Model button to add the Model Entity to the environment.
    UMSyncModel.png
  5. Setup Reader Function on top of the Model Entity. Make sure to add the fields in the reader which you want data to be populated. Activate the Environment and Run the Reader to populate data on Model Entity.
    UMSetUpReader.png

OData V2

Now that you are done with setting it up for ODataV4, How about for OdataV2?

Like I said previously, steps in setting up Odata V2 for SAP PaPM Cloud UM should be the same as Odata V4. The only difference here would be the Service Path information from S4HANA Cloud Service URL/Service Interface which classifies whether what application protocol is used in this case, I used below information:

Service Path

Specifies the root of service URL from Step 3g of Communication Arrangement e.g.
https://my300470-api.s4hana.ondemand.com/sap/opu/odata/sap/API_GLACCOUNTLINEITEM

UMOdataV2Connection.png

Follow steps 2-5 from Odata V4 Setup in order to bring the Model Entity created from Odata Service Connection and use a reader to buffer the data to it.
UMSetUpReaderV2.png

User1 and User 2 has completed their activity! Hoooraay!

This sums up one way of using S/4HANA Cloud Data into SAP PaPM Cloud. By mastering the steps outlined, you can be better equipped in your implementation project. With due diligence in checking, you can also try out other available APIs and create your own personal guide. Like I always said, this is one way and there can be another and a more optimized one. Hope you enjoy and until the next one! 😎