SAP

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

Create and Deep Insert with the Virtual Data Model for OData

Create and deep insert functionality for OData as supported by the SAP S/4HANA Cloud SDK.

Overview

🎓 intermediate 30 min. SAP Cloud SdkIntermediate

You will learn

  • How to build up a complex data structure using the virtual data model
  • How to write deeply nested data to SAP S/4HANA in a single call
  • How to write unit and integration tests for deep insertion

More from Charles Dubois

See all 2 tutorials by Charles Dubois →

Prerequisites

Prerequisites

Please note that the sandbox service does not support testing creating entities, you might have to use an actual S/4 system to try the tutorial out.

Steps

Intro

Use advanced features of the Virtual Data Model for OData.


Step 1 Motivation

Deep Insert is defined as:

  • A request to create an entity that includes related entities, represented using the appropriate inline representation, is referred to as a deep insert.

  • On success, the service MUST create all entities and relate them.

  • On failure, the service MUST NOT create any of the entities.

This means deep insert is an atomic operation that is either successful or fails for all entities.

Step 2 Write the application code
+
Step 3 Write an integration test
+
Step 4 Test yourself
+

Resources

Discussion

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

Submit detailed feedback Discuss in Community
Steps
Step 1 of 4
1. Motivation 2. Write the application code 3. Write an integration test 4. Test yourself