In a basic TypeScript program, read the Business Partner API service using SAP Cloud SDK.
For the complete execution of the current exercise, you must have completed the following exercises:
- Creating your Pay-As-You-Go Account in SAP BTP
- Activating the APIs in SAP S/4HANA Cloud: this exercise activates the required API in the S/4HANA Cloud tenant.
For the full execution of this exercise, you need to have the following software installed on your laptop:
|Node.js||latest Recommended for Most Users version||application|
|Visual Studio Code||latest||application|
Some steps of this exercise depend on the https://api.sap.com website. As a consequence, they may not run properly if the website is not running 100% correctly. In this case, proceed with the exercise to reach the part that runs against the SAP S/4HANA Cloud instance.
Information for execution
The exercise comes with two archive files:
ts-call-api-initial.zip[download]: contains the NPM/TypeScript project in its initial status. This project has to be imported as a prerequisite for the execution of the exercise.
ts-call-api-solution.zip[download]: contains the NPM/TypeScript project in its final status after the correct execution of the exercise. This project can be used to clarify the correct solution or to copy and paste parts of the source code.
In the case you wish to run the solution application directly without going through the exercise steps, then complete the following actions (this is not a prerequisite to exercise execution):
- Extract the archive to a project folder in your local system.
- Edit the
- Replace >>>YOUR API KEY<<< with your own API Key. To get your API Key, open https://api.sap.com/api/API_BUSINESS_PARTNER, then Log On and choose Show API Key.
- Open the PowerShell. Execute the following commands:Code snippetCopy code
cd <project folder path> npm install npm run build npm run start