For the complete execution of current exercise, you must first execute 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:
js-call-api-initial.zip[download] contains the Node.js project in its initial status. This project has to be imported as a prerequisite for the execution of the exercise.
js-call-api-solution.zip[download] contains the Node.js 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 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 (for example,
"FDqbnElM7mgmgqbIKBFHRpS1dvpt6sHD"). To know your valid API Key, open https://api.sap.com/api/API_BUSINESS_PARTNER, then Log On and choose Show API Key).
- To run the program, in the Windows PowerShell, execute the following commands:Code snippetCopy code
cd <project folder path> npm install npm run start