Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
2,101

Introduction


SAP Project and Resource Management (SPRM) is a cloud-based solution for collaboration between all partners in construction and engineering projects. The application uses a digital twin as the central point for integrating and fostering collaboration between all involved parties. From conceptualization to delivery, all partners in a project can work closely to design and build facilities and assets.
With SPRM, you can share crucial information and important documentation about the project with project partners.

SAP Project and Resource Management also provides APIs which can be used to integrate with other applications or to extend the core capabilities offered.

Sometimes, people face difficulties in getting started with consuming such APIs by just relying on the SAP help documentation. In this blog, this is explained in a simple step-by-step manner.

Prerequisites



    • You have onboarded to SAP Project and Resource Management. Refer to the onboarding guide for more details.

        • Verification criteria

            • Your subaccount should have an entitlement for SAP Project and Resource Management




            • You should have subscribed to SPRM in your subaccount with the Application plan - "standard"







 

    • You have the necessary authorizations to manage the subaccount



Steps


Summary

    1. Enable Cloud Foundry in the subaccount

 

    1. Create a service instance of SAP SPRM API service

 

    1. Create a service key

 

    1. Assign roles

 

    1. Perform API invocation



Enable Cloud Foundry in the subaccount


This is needed to consume services in cloud foundry. "SPRM" API service is one of such services.

    1. Log on to SAP Business Technology Platform cockpit

 

    1. Navigate to the subaccount by following the steps

 

    1. Select the created subaccount in the cockpit

 

    1. Choose "Enable Cloud Foundry"

 

    1. Provide a Cloud Foundry organization name, and then click on "Create"



Create SPRM API service instance


The service instance that gets created shall act as an OAuth Client

    1. Navigate to the subaccount in BTP Cockpit where SPRM is subscribed to

 

    1. Go to Services and Marketplace

 

    1. Choose "Service" from the filter for "types"

 

    1. Search for "SPRM"



 

    1. Click on the tile shown above

 

    1. Choose the "default" plan under the "Service Plans" section

 

    1. Click on "Create" button as highlighted in the screenshot



 

    1. In the dialog that opens, click on the "Create a space" link if you do not have an existing space



 

    1. Provide an appropriate name for the space name and click on "Create"



 

    1. Enter a suitable instance name



 

    1. Click on "Next"

        1. Optional step:


            1. Background - When using the OAuth 2.0 authorization code grant, you can specify the allowed redirect-URIs to the application that calls SPRM APIs or the integration system that handles the callback call.



            1. The redirect URIs information has to be entered in a JSON object in the dialog





              {
              "xs-security": {
              "xsappname": "<unique-appname>",
              "oauth2-configuration": {
              "redirect-uris": [
              "https://<your-domain>/**"
              ]
              }
              }
              }





 

    1. Click on "Create"

 

    1. You'll see a success message like below





 

 

 

 

 

 

 

 

Create a service key


The service key provides the credentials to talk to the UAA associated with the subaccount and the SPRM API endpoint URL

    1. Go to the service instance created in the previous step

 

    1. OR

 

    1. Click on "View Instance" in the previous dialog



 

    1. Click on the "Create" button in the "Service Keys" section as shown above

 

    1. Enter a name for the service key and click on "Create" in the dialog



 

    1. Now, click on "View" service key by clicking on the "..." button as shown


        •  


 

    1. Note down the values of the below parameter from the json shown

        1. clientid

        1. clientsecret

        1. apiurl

        1. url  - under "uaa" in the json




Assign Roles


To execute certain operations in SPRM, the necessary roles have to be assigned. Refer here.

Perform API invocation


SPRM enables API access via OAuth 2.0 Authorization Code flow

    1. Go to Postman app

 

    1. Create a new request

 

    1. Get access token

        1. In the "Authorization" section choose the type as oAuth 2.0

        1. Provide the previously noted credentials in the Authorization screen

            • You can either enter the details directly or use Postman environment variables like shown below




        1. Click on "Get New Access Token"

        1. Click on "Use Token" in the dialog





 

    1. Let's invoke the SPRM Projects API to test if the credentials work

        1. Enter the following text in the URL field: "{{API_URL}}/ProjectService/v1/Projects"

        1. Replace {{API_URL}} with the "apiUrl" noted earlier




        1. Click on "Send"

        1. In the response, you shall get the list of projects you are authorized to view (in case projects exist)





 

    1. You can explore other APIs by referring to the APIs in SAP API Hub



Summary


I hope that after going through this blog, you were able to perform the necessary configurations as described and invoke SPRM APIs.

In case of any queries, feedback w.r.t API consumption, you can post a comment. If there are general queries on SPRM please post a Question and assign the tag "SAP Project and Resource Management"

3 Comments