ERPClimb logoERPClimb
RAP Basics
Architect / Cross-trackintermediate 8 min read

RAP Basics Part 6: Behavior Definition — CRUD, Field Control and Features

Preview · a free account unlocks the full lesson

Key takeaway

Control what a RAP BO allows with the behavior definition: CRUD operations, static field properties (readonly, mandatory, readonly:update), dynamic field and operation control via features: instance, global features, field mapping, and strict mode.

In this lessonShow sections

Visual overview

RAP Basics Part 6: Behavior Definition — CRUD, Field Control and Features — learning sheetFlow: List fields: editable, readonly, mandatory, create-only → Add static field control in the BDEF → Add features : instance for status-dependent update/delete/actions → Implement get_instance_features in the handler class. Key ideas: OPERATIONS; STATIC FIELD CONTROL; DYNAMIC FEATURE CONTROL; GLOBAL FEATURES. Watch out: Hiding a button in the UI is not protection — only BDEF feature control (and authorization) enforces it for every consumer, including APIs and EML.ERPClimb.com / ARCH / LESSON 6/11 / LEARNING SHEETRAP Basics Part 6: Behavior Definition — CRUD, FieldControl and Features1 · HOW IT FLOWS1List fieldseditable, readonly,mandatory, create-only2Add static fieldcontrol in theBDEF3Add featuresinstance forstatus-dependent…4Implementget_instance_featuresin the handler…2 · KEY IDEAS EXPLAINEDOperationscreate; update; delete; — standard operations.Leave out delete if the BO must never be deleted.Static Field Controlfield ( readonly ) TravelID, OverallStatus; — setonly by logic.field ( mandatory ) AgencyID, CustomerID; — mustbe filled (checked on save, marked in UI).Dynamic Feature Controlupdate ( features : instance ); delete ( features: instance );action ( features : instance ) acceptTravel …;Global Features( features : global ) — independent of aninstance, e.g. disable create outside businesshours or by configuration.3 · REMEMBER · WATCH OUTRememberThe BDEF is the contract of the BO: which operations exist, whichfields are editable, which actions are available, and under which…Static field control: field ( readonly ), ( mandatory ), ( readonly :update ) — applies always, no code.Dynamic control: features : instance on operations/actions/fields →implemented in get_instance_features, evaluated per instance (e.g. no…!Watch outHiding a button in the UI is notprotection — only BDEF featurecontrol (and authorization) enforcesit for every consumer, includingAPIs and EML.4 · IN A REAL PROJECTOn a pricing-agreement BO, the UI team hid the Edit button for approved agreements using a UI5 extension.Three months later, an integration partner used the Web API binding of the same BO and changed approvedagreements, which triggered a compliance finding. The fix was to move the rule into the BDEF: update (…Original ERPClimb learning sheet • Verify against your SAP release and edition

Explanation

Part 5 built the composition tree; now we control what each entity actually allows. The behavior definition (BDEF) is the contract of the business object: which operations exist, which fields are editable, which actions are available, and under what conditions. Operations are declared plainly — create; update; delete; — and delete can simply be left out if the BO must never allow deletion; for children, create happens via an association on the parent, while update and delete are declared on the child itself.

Static field control needs no code at all: field ( readonly ) TravelID, OverallStatus; marks fields that can only be set by logic, field ( mandatory ) AgencyID, CustomerID; marks fields that must be filled, checked on save and flagged in the UI, field ( readonly : update ) CustomerID; makes a field editable only at creation, and field ( readonly, numbering : managed ) TravelUUID; is typical for a managed, system-assigned key.

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
  • Code example
  • 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.