Prepare SAP S/4HANA System by Activating the Business Partner OData Service
- How to activate your Business Partner OData service
- How to create a technical user in your SAP S/4HANA system
- How to assign a role to your technical user
- Consume the External Service in the UI of Your Application
- On SAP BTP side:
- You have an enterprise global account in SAP BTP
- You must be an administrator of the SAP BTP global account where you want to register your SAP S/4HANA system.
- Your SAP BTP subaccount has quota for the services
SAP Launchpad serviceand
SAP HTML5 Applications Repository serviceas described in Prepare for SAP BTP Development
- You have to Use an existing SAP HANA Cloud service instance or Set up a new SAP HANA Cloud service instance for the deployment. After the deployment, you need to Subscribe to the SAP Launchpad Service.
- On SAP S/4HANA side:
- You have a dedicated SAP S/4HANA system
- You must be an administrator of the SAP S/4HANA system
- Step 1
Welcome to this collection of tutorials for application development on SAP Business Technology Platform (SAP BTP). In the following tutorials, we provide information and examples on how to consume external services step by step using SAP S/4HANA. To get an overview about what is CAP, see Introduction to Consuming Remote Services using CAP for more details.
- Step 2
With this tutorial, you expose the Business Partner service as an OData service and create a technical user with the required permissions to maintain business partners and to access the service. This user is later used to access the Business Partner service from the cloud.
Open your SAP S/4HANA system and log in as an administrator.
/n/IWFND/MAINT_SERVICEin the command field and hit Enter to start transaction Activate and Maintain Services. The Service Catalog of the transaction is opened.
Choose Add Service in the Service Catalog.
LOCALfor System Alias and
API_BUSINESS_PARTNERfor External Service Name, and hit Enter to search for all matching services.
API_BUSINESS_PARTNERservice from the results and choose Add Selected Services.
On the next screen, choose Local Object. This will automatically fill in
$TMPin the Package Assignment field.
Click the checkbox to Enable OAuth for Service and choose ☑.
Acknowledge the confirmation message and choose ☑. You have successfully activated Business Partner OData service in your SAP S/4HANA system.
Now, let’s create a user in your SAP S/4HANA system and assign the required authorizations.
What is the name of the external service?
- Step 3
Choose Exit to go back to the initial screen.
SU01in the command field and hit Enter to start transaction User Management.
Enter a name for the user in the User field and choose Technical User to create.
Set the User Type to
Dialogfrom the dropdown list.
Generate a new password for your user by copying it from the message and choosing Save.
Useful password tips:
- This is an initial password that has to be changed at first user login.
- Note down this password so you have it at hand later when you’ll have to log in with your newly created user.
- Step 4
On your initial screen, type in transaction name
/nPFCGand hit Enter.
ENTERPRISEMESSAGINGin the Role field and choose Single Role.
On the next screen, enter a Description for the role and choose Save.
In the Menu tab, choose Transaction.
In the Assign Transactions dialog, type in
BPunder Transaction Code and hit Enter to find the Business Partner transaction.
Click the checkbox to select the transaction and choose Assign Transactions.
In the Menu tab, choose Authorization Default.
Expand the dropdown list under Transaction to find the option Authorization Default.
A Service dialog opens. Choose
SAP Gateway: Service Groups Metadatafrom dropdown list in the Authorization Default field.
Open the value help in the TADIR Service column.
Find the Business Partner API and choose ☑.
Switch to the Authorizations tab and choose Change Authorization Data. Save the role if prompted.
Choose Edit → Insert authorization(s) → From template….
In the Choose Template dialog, select
/IWFND/RT_GW_USERand choose ☑.
Choose Status and confirm assignment of full authorizations to the role in the Assign Full Authorization for Subtree dialog by choosing ☑.
Choose Generate and confirm in the Assign Profile Name for Generated Authorization Profile dialog by choosing ☑.
Go back and switch to the User tab.
Under User Assignments, type in the name of your technical user (in this case,
CPAPP) and hit Enter to select it.
Choose User Comparison and save the role if prompted.
Choose Full Comparison in the Compare Role User Master Record dialog.
Close the Compare Role User Master Record dialog when you see the updated status message.
Choose System → Log Off from the menu.
Log in to your SAP S/4HANA system using your newly created technical user (CPAPP) and the password you generated in sub-step 2.5 Create a technical user. Change the initial password when prompted.
For the purposes of the tutorial, we’re going to set the password to
Welcome1. You can set your own password, but make sure you note it because you’ll need it in the upcoming tutorials.
You have successfully logged in with your new technical user.