User management using API in S4 Cloud system

Its an essential blog post for those:

  • Interested to know how API works
  • How user management in SAP cloud application can be achieved with ease

This blog post can be used for user management using API’s in both S4 Cloud and IBP Cloud system –  By following steps you would be able to manage user accounts, read user accounts or perform any other user management activities within Postman tool and also then similar learnings can be utilized to integrate your existing IdM solution (Sailpoint/Savient etc) to connect and manage users in SAP Cloud system.

In this document – We will focus on how we can read all user information from S4 Cloud using API:

Tools used in this blog post:

Postman API Tool – https://www.postman.com/product/tools/

SAP API documentation – https://api.sap.com/

You can find available API’s for S4 Cloud user management operations in api.sap.com website, Refer below:

API%20Page

API Page

How does S4 Cloud API “Business user -Read” works –

 1.  SAP_COM_0193 scenario need to be configured first in S4 Cloud system

Step 1.  Login to S4 Cloud system and select Fiori app ” Communication Agreement”

Step 2. Click on create new communication agreement

Creating%20new%20communication%20agreement

2. In next page – You would need to define new communication system and user name for that as well  – Click on new communication system

From here – Click on new to create new communication system – Please note there are inbound service details available at bottom – These are SOAP API’s which we would be using in POSTMAN to read user details and also manage users

Please check with your basis team for hostname and logical system setting – Or else you can refer existing communication system with your system ID already created.

You would also need to provide communication user detail in inbound service – Create a user using “Maintain communication user” fiori application and define same here.

3. Now you have successfully setup a new communication agreement and you are ready to consume business user read application using POSTMAN API

Go through below URL to make yourself aware on how to use POSTMAN API:

Create a new collection for testing your S4 HANA API

Now click on add request and make it a POST API as in below screenshot:

URL remain same but you would need to change URL by adding your host of S4 Cloud application and client details

In Authorization field define your communication user ID and password.

SOAP API needs a body to be passed to read user information or even to create , Here is sample body for your reference to read first 100 user information from cloud application.

Now if you have requirement to read only 1 user then you need to modify it , May be just add following code as well :

” <PersonIDInterval>
<IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
<LowerBoundaryPersonID>9980000000</LowerBoundaryPersonID>
</PersonIDInterval>?

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <n0:BusinessUserSimpleByElementsQuery_sync xmlns:n0="http://sap.com/xi/ABA"> <BusinessUser> <!-- <PersonExternalIDInterval> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryPersonExtID>{<PersonExtID>}</LowerBoundaryPersonExtID> </PersonExternalIDInterval> --> <BusinessPartnerRoleCodeInterval> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryBusinessPartnerRoleCode>BUP003</LowerBoundaryBusinessPartnerRoleCode> </BusinessPartnerRoleCodeInterval> </BusinessUser> <QueryProcessingConditions> <QueryHitsMaximumNumberValue>100</QueryHitsMaximumNumberValue> <QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator> </QueryProcessingConditions> </n0:BusinessUserSimpleByElementsQuery_sync> </soap:Body> </soap:Envelope>

Now click on send in POSTMAN API and you should be able to get all user information including their assigned role information:

You can also download this information in XML format and convert into tabular format using power query editor in excel.

Conclusion – By following above steps – You can easily learn and implement a basic API with Postman to read system data and also explore how to create/update data using API’s.

If you think this post has helped you in any way please like and share your thoughts in the comments section below. Incase of any questions please ask in the comments section below

Thanks & Regards

Deepak Gupta