SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
⤢ Open full site

Perform S/4HANA CRUD Operations in SAP Build Apps

Using SAP Build Apps, create an app that performs all the CRUD operations for the SAP S/4HANA Cloud business partner address API, and handles $expand for nested entities and API rules.

Overview

🎓 beginner 40 min. SAP Build AppsBeginnerSAP Business Technology PlatformSAP Build

You will learn

  • How to connect your app to SAP S/4HANA Cloud
  • How to perform all the CRUD actions
  • How to build and navigate to additional app pages
Daniel Wroblewski D Daniel Wroblewski October 7, 2024
Created by December 20, 2023
Contributors

Prerequisites

Prerequisites

  • You have enabled SAP Build Apps on your trial tenant, as described in Set Up SAP Build Apps (with Booster) on SAP BTP Trial Account.
  • You have created a destination to your SAP S/4HANA Cloud system’s Business Partners API. See the documentation for destinations being used in SAP Build Apps. The service URL should be in the form: https://{host}:{port}/sap/opu/odata/sap/API_BUSINESS_PARTNER
  • To get started, you can create a destination to the APIs on the SAP Business Accelerator Hub (see Access Demo SAP APIs for SAP Build) and build the entire UI, but you will not be able to update the data.

Steps

Intro

The point of this tutorial is to show you how you would perform all the CRUD operations, and how you would handle some of the complexities of the SAP backend APIs (e.g., nested entities or strict requirements for the data).

App
App

You will create an app with 3 pages:

  • Page 1: Display all business partners
  • Page 2: Display all addresses for a business partner
  • Page 3: Create or update an address

As for complexities of the API, here are a few:

  • You cannot delete an address if it is labeled as the default address (AddressUsage = XXDEFAULT).
  • Whether an address is the default is determined by the AddressUsage nested entity, which you will need to expand.
  • If you add an address to a business partner that has no addresses, that address must be labeled as the default address, but if you are adding an additional address, that address CANNOT be labeled as the default address.
  • There are all types of conditions for the data. For example, if you add an address from the United Kingdom, it must include a postal code (Postal codes are not needed for the US or Sweden). Or, you cannot delete the default address.

The tutorial will handle the complexities listed above. You can learn about the API on the SAP Business Accelerator Hub .

API reference
API reference

Step 1 Create project

In the lobby of your SAP Build Apps, click Create.

Lobby create
Lobby create

Select Build an Application.

Build an application
Build an application

Select Web & Mobile Application.

Create project
Create project

For the project name, enter S4HANA CRUD, then click Create.

Step 2 Enable BTP authentication
+
Step 3 Connect to S/4HANA Cloud API
+
Step 4 Create page for updating address
+
Step 5 Set logic for getting data
+
Step 6 Set logic for saving data
+
Step 7 Create page for displaying addresses
+
Step 8 Add logic to delete address
+
Step 9 Create page for displaying business partners
+
Step 10 Test app
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 10
1. Create project 2. Enable BTP authentication 3. Connect to S/4HANA Cloud API 4. Create page for updating address 5. Set logic for getting data 6. Set logic for saving data 7. Create page for displaying addresses 8. Add logic to delete address 9. Create page for displaying business partners 10. Test app

Learn more →