ERPClimb logoERPClimb
OData V4 Model Deep Dive
Fiori & SAPUI5advanced 6 min read

OData V4 Model Part 2: Batch Groups, Updates and Saving Changes

Preview · a free account unlocks the full lesson

Key takeaway

Control when the V4 model sends changes: $auto, $direct and application group IDs, deferred updates submitted with submitBatch, creating and deleting entities, and how to give users a clear save or cancel experience.

Visual overview

OData V4 Model Part 2: Batch Groups, Updates and Saving Changes — learning sheetFlow: User edits → Changes in update group → submitBatch on Save → $batch request → Messages or success. Key ideas: BATCH GROUPS; DEFERRED UPDATES; CREATE AND DELETE; DRAFTS VERSUS DEFERRED UPDATES. Watch out: Mixing auto and deferred groups unknowingly leads to partial saves.ERPClimb.com / FIORI / LESSON 2/14 / LEARNING SHEETOData V4 Model Part 2: Batch Groups, Updates and SavingChanges1 · HOW IT FLOWS1User edits2Changes inupdategroup3submitBatchon Save4$batchrequest5Messages orsuccess2 · KEY IDEAS EXPLAINEDBatch GroupsEach binding and change belongs to a group. $autocollects requests and sends them in a $batchautomatically at a suitable time. $direct sends…Deferred UpdatesIf the update group is an application group suchas 'changes', edits accumulate locally until theapp calls submitBatch('changes'). This supports an…Create And DeleteNew rows are created through the list binding'screate method, optionally with initial data, andappear immediately as transient contexts until…Drafts Versus Deferred UpdatesFiori elements apps on draft-enabled services savechanges to the draft continuously and activate onSave. Freestyle apps without drafts often use…3 · REMEMBER · WATCH OUTRememberRequests are grouped in batch groups: $auto sends automatically,$direct sends immediately without $batch.Application-defined group IDs defer changes until submitBatch iscalled, enabling an explicit Save.resetChanges discards pending changes for a group or binding.!Watch outMixing auto and deferred groupsunknowingly leads to partial saves.4 · IN A REAL PROJECTA freestyle app saved each field change immediately via $auto, so users who abandoned a form left half-updatedrecords in the back end. Switching to an application update group with explicit Save and resetChanges oncancel restored all-or-nothing behaviour.Original ERPClimb learning sheet • Verify against your SAP release and edition

Explanation

Part 1 covered reading data; Part 2 covers writing it, and controlling exactly when requests are sent, through batch groups, updates and saving changes.

Each binding and change belongs to a batch group. $auto collects requests and sends them automatically in a $batch at a suitable time. $direct sends requests individually and immediately, without batching. The default update group can be configured for the model as a whole.

If the update group is instead an application-defined group, such as "changes," edits accumulate locally until the app explicitly calls submitBatch('changes'). This is what supports an explicit Save button: the user edits several fields and rows, and only then saves everything in one batch — or cancels everything with resetChanges, which discards pending changes for a group or binding.

Free account

Create a free account to keep reading

You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.

  • Full explanation
  • Real project scenario
  • Common mistakes
  • Best practices
  • Interview angle

One tap with Google works too. Every topic keeps its first lesson open to everyone.

Keep exploring

Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.