Beyond ABAPdesigned by@Tejoram97
Beyond ABAP / RAP / EML

EML

RAP · ABAP Development ·

Open the interactive lesson →
  1. Why EML: one front door for every caller
  2. READ ENTITIES and MODIFY ENTITIES
  3. Derived types and component groups
  4. Responses and COMMIT ENTITIES
  5. GET PERMISSIONS, SET LOCKS, IN LOCAL MODE and PRIVILEGED
  6. R12 end to end: the nightly approval job
  7. Interview questions

This page teaches EML, the ABAP statements that read and change RAP business objects: READ, MODIFY, COMMIT and ROLLBACK ENTITIES, derived types, responses, permissions, locks, local mode and privileged access. It implements R12 – other ABAP programs and a nightly job create and approve sales orders through the same checks as the Fiori app.

Part 1 – Why EML: one front door for every caller

Requirements on this page

R-ID

Requirement

Where on this page

R12

Other ABAP programs and a nightly job create or approve orders

Parts 1–6, full job in Part 6

R7 / R3

Approve only for status N and only for managers – also when a program calls it

Part 5 (permissions, local mode, privileged)

R18

Create SAP's standard sales order from our order

One line here; EML on I_SalesOrderTP → 11 · Files, Custom Entities & Integration

R20

Automated tests

Tests also use EML → 12 · Extensibility & Testing

R12 – besides the Fiori app, other ABAP programs and a nightly job must create orders and approve them. They must go through exactly the same checks as a rep or a manager in the app: status N on create (R4), customer validation (R6), "Approve only for status N and only for managers" (R7), locks (R10), the order number (R9) and the audit log (R14).

EML (Entity Manipulation Language) is the set of ABAP statements that read and change RAP business objects – your own BO or SAP's released BOs such as I_SalesOrderTP. Think of it as the front desk of a hotel: every request goes through the desk, so the BO's checks always run. A program that writes zsales_hdr with UPDATE sneaks into the kitchen and skips all of them.

Who uses EML for the Sales Order BO: the Fiori app (the RAP runtime issues the EML), another ABAP program and the nightly job (R12), the behavior pool itself in local mode and ABAP Unit tests (R20). Every call passes the same checks – authorization (R3, R7), feature control (R7), lock (R10), determinations (R4, R5) and at COMMIT ENTITIES validations (R6) and the order number (R9) – before zsales_hdr and zsales_itm are written once

Where EML is used: in behavior pools (to read or change your own BO), in other classes, reports and background jobs (R12), in ABAP Unit tests (R20) and to call SAP's released BOs instead of BAPIs (R18).

Anatomy of a MODIFY ENTITIES statement: BO name, ENTITY alias, operation, FIELDS filling %control, the WITH table of derived type TABLE FOR CREATE, %cid and %cid_ref, and the MAPPED, FAILED and REPORTED responses, followed by COMMIT ENTITIES

The statements at a glance

Statement

What it does

Where allowed

READ ENTITIES OF zr_salesorder

Reads instances from the transactional buffer (or the database if not yet buffered), also by association (BY \_Item)

Everywhere

MODIFY ENTITIES OF zr_salesorder

CREATE, CREATE BY association, UPDATE, DELETE, EXECUTE action – changes go only to the buffer

Handlers and consumer code

COMMIT ENTITIES

Starts the save sequence: finalize → check_before_save → adjust_numbers → save → cleanup

Only in consumer code (class, report, job, test) – never in a behavior pool

ROLLBACK ENTITIES

Throws away the whole buffer and releases the locks

Consumer code

GET PERMISSIONS

Asks which operations, actions and fields are allowed (feature control + authorization) without executing anything

Everywhere

SET LOCKS

Locks instances explicitly (MODIFY normally locks automatically)

Handlers and consumer code

READ ENTITY / MODIFY ENTITY

Short form for one entity

Same as the long form

READ ENTITIES OPERATIONS / MODIFY ENTITIES OPERATIONS

Dynamic form – BO and entity names at runtime (generic tools)

Same as the long form

MODIFY AUGMENTING ENTITY

Enriches a request in a projection behavior pool → 04 · Behavior Definition & Behavior Pool

Projection behavior pool only

  • A program in another software component should call the BO through its interface BDEF (released, stable), not the ZR_ base BO → 04 · Behavior Definition & Behavior Pool.

Part 2 – READ ENTITIES and MODIFY ENTITIES

READ ENTITIES

" READ – header fields + items by association (active instances)
READ ENTITIES OF zr_salesorder
ENTITY SalesOrder
FIELDS ( SalesOrderID Status NetAmount ) WITH VALUE #( ( OrderUUID = order_uuid ) )
RESULT DATA(orders)
ENTITY SalesOrder BY \_Item
ALL FIELDS WITH VALUE #( ( OrderUUID = order_uuid ) )
RESULT DATA(items)
FAILED DATA(read_failed).

" Inside a handler: keys already carry %tky (incl. %is_draft) – pass them on unchanged
READ ENTITIES OF zr_salesorder IN LOCAL MODE
ENTITY SalesOrder
FIELDS ( Status ) WITH CORRESPONDING #( keys )
RESULT DATA(orders_in_buffer).
  • order_uuid stands for a key you selected before. FIELDS ( ... ) fills %control for you; ALL FIELDS requests every field.
  • READ sees what is in the buffer, including unsaved changes of the same transaction. A plain SELECT does not – one reason to use READ ENTITIES inside handlers.
  • Instances that do not exist come back in FAILED with %fail-cause = if_abap_behv=>cause-not_found, not as an exception.

MODIFY ENTITIES – a program creates an order (R12)

" CREATE – header and item in one call, linked by %cid / %cid_ref
MODIFY ENTITIES OF zr_salesorder
ENTITY SalesOrder
CREATE FIELDS ( CustomerID OrderDate Currency )
WITH VALUE #( ( %cid       = 'H1'
CustomerID = '0010100001'
OrderDate  = cl_abap_context_info=>get_system_date( )
Currency   = 'EUR' ) )
CREATE BY \_Item FIELDS ( ItemNo MaterialID Quantity Unit NetPrice Currency )
WITH VALUE #( ( %cid_ref = 'H1'
%target  = VALUE #( ( %cid       = 'I1'
ItemNo     = '000010'
MaterialID = 'MAT-001'
Quantity   = 5
Unit       = 'ST'
NetPrice   = '20.00'
Currency   = 'EUR' ) ) ) )
MAPPED DATA(mapped)
FAILED DATA(failed)
REPORTED DATA(reported).

" Nothing is on the database until COMMIT ENTITIES runs the save sequence (Part 4)
COMMIT ENTITIES RESPONSE OF zr_salesorder
FAILED   DATA(commit_failed)
REPORTED DATA(commit_reported).
IF sy-subrc <> 0.                     " 4 = early save failed, e.g. validateCustomer (R6)
ROLLBACK ENTITIES.
ENDIF.
  • Status, OrderUUID and the item key are not sent: the determination setInitialStatus sets status N (R4), managed numbering creates the UUIDs, and calculateTotal fills the net amount (R5).
" UPDATE / EXECUTE action / DELETE in one statement
MODIFY ENTITIES OF zr_salesorder
ENTITY SalesOrder
UPDATE FIELDS ( CustomerID )
WITH VALUE #( ( OrderUUID = order_uuid  CustomerID = '0010100002' ) )
EXECUTE approve FROM VALUE #( ( OrderUUID = other_uuid ) )
DELETE FROM VALUE #( ( OrderUUID = old_uuid ) )
FAILED DATA(failed2)
REPORTED DATA(reported2).
COMMIT ENTITIES.

The same UPDATE written with a typed table and an explicit %control – this is what FIELDS ( ... ) does behind the scenes (order is a row of a READ result):

DATA orders_upd TYPE TABLE FOR UPDATE zr_salesorder\\SalesOrder.

orders_upd = VALUE #( ( %tky                = order-%tky          " key + %is_draft
CustomerID          = '0010100002'
%control-CustomerID = if_abap_behv=>mk-on ) ).   " only CustomerID is changed

MODIFY ENTITIES OF zr_salesorder
ENTITY SalesOrder UPDATE FROM orders_upd
FAILED DATA(upd_failed)
REPORTED DATA(upd_reported).

The factory action copyOrder (R8) creates a new instance, so it needs a %cid; the new key comes back in MAPPED:

MODIFY ENTITIES OF zr_salesorder
ENTITY SalesOrder
EXECUTE copyOrder FROM VALUE #( ( %tky = order-%tky  %cid = 'COPY1' ) )
MAPPED DATA(copy_mapped)
FAILED DATA(copy_failed).

DATA(new_order_uuid) = copy_mapped-salesorder[ 1 ]-OrderUUID.
  • Without %control (or FIELDS), an UPDATE changes nothing – RAP only touches fields whose control flag is mk-on. This is how RAP tells "set to initial" apart from "not sent".
  • Status is readonly for consumers. A program that wants status A must call approve, not UPDATE Status – the action carries the R7 rules.
  • CREATE AUTO FILL CID lets RAP generate the %cid values when you do not need to reference them (check your release).

Part 3 – Derived types and component groups

Every BDEF automatically gives you derived types – structures and tables whose shape follows the BO. They contain the entity fields plus special component groups that start with %.

Nested key components: %key inside %pky (with %pid) inside %tky (with %is_draft), and a map of derived types: TABLE FOR CREATE, UPDATE, DELETE, ACTION IMPORT, ACTION RESULT, READ IMPORT, READ RESULT and RESPONSE FOR MAPPED, FAILED, REPORTED

Component

Meaning

Typical use

%cid / %cid_ref

Content ID: temporary name for a new instance / reference to it

Create header + items in one MODIFY; factory action

%key

Primary key fields only (OrderUUID)

Non-draft keys, database lookups

%pid

Preliminary ID before late numbering assigns the real key

Late numbering → 06 · Feature Control, Authorization & Numbering

%pky

%pid + %key

Keys that must work with late numbering

%is_draft

'01' draft instance, '00' active (if_abap_behv=>mk-on / mk-off)

Draft BOs → 07 · Locking, Draft & Side Effects

%tky

Transactional key = %is_draft + %pky – the complete identity of an instance in the buffer

Use it everywhere in handlers

%control

One flag per field: was it sent / is it requested (mk-on)

UPDATE, CREATE, READ

%data

All entity fields as one substructure

Copy all field values at once

%param

Action/function parameter (import) or result row

%param-<field>, result[ 1 ]-%param

%target

Child rows in CREATE BY association

Header + items in one call

%fail

In FAILED: %fail-cause = not_found, unauthorized, locked, disabled, unspecific, ...

Why an instance failed

%msg / %element / %state_area / %other

Message object / field to highlight / message group / messages without instance

REPORTED → 05 · Business Logic & Messages

%action / %features / %field / %assoc / %update / %delete

Flags in permission, feature and authorization requests and results

GET PERMISSIONS, feature control

" Typed variables – the type follows the BDEF
DATA create_tab   TYPE TABLE FOR CREATE zr_salesorder.               " root entity
DATA item_tab     TYPE TABLE FOR CREATE zr_salesorder\_Item.         " create by association
DATA update_tab   TYPE TABLE FOR UPDATE zr_salesorder\\SalesOrder.   " entity by alias
DATA read_result  TYPE TABLE FOR READ RESULT zr_salesorder\\Item.
DATA action_in    TYPE TABLE FOR ACTION IMPORT zr_salesorder~approve.
DATA one_order    TYPE STRUCTURE FOR UPDATE zr_salesorder.
DATA failed_all   TYPE RESPONSE FOR FAILED zr_salesorder.            " failed-salesorder, failed-item
DATA mapped_all   TYPE RESPONSE FOR MAPPED EARLY zr_salesorder.
DATA reported_all TYPE RESPONSE FOR REPORTED EARLY zr_salesorder.
  • \ + association name = by-association type, \\ + alias = a specific entity, ~ + name = action, function or event.
  • EARLY / LATE in RESPONSE types: early = interaction phase and early save, late = late save (adjust_numbers, save, save_modified). Without the addition, EARLY is meant.

Part 4 – Responses and COMMIT ENTITIES

EML never raises an exception for a business error. Each statement returns three response structures, with one internal table per entity (failed-salesorder, failed-item, ...). In a nightly job nobody watches the screen – if you do not check them, a rejected order goes unnoticed.

After MODIFY: MAPPED gives new keys for %cid, FAILED lists failed instances with cause, REPORTED holds messages. After COMMIT ENTITIES: sy-subrc 0 saved, 4 early save failed and back to the interaction phase, 8 late save failed
IF failed-salesorder IS NOT INITIAL.
LOOP AT reported-salesorder INTO DATA(msg).
DATA(text) = msg-%msg->if_message~get_text( ).     " message text for the job log
ENDLOOP.
ROLLBACK ENTITIES.
RETURN.
ENDIF.

" MAPPED: the real key the framework assigned to %cid 'H1'
DATA(new_uuid) = mapped-salesorder[ %cid = 'H1' ]-OrderUUID.

After

Check

Meaning

MODIFY / READ

failed-<entity>

Instance rejected (not found, locked, unauthorized, disabled ...)

MODIFY / READ

reported-<entity>, reported-%other

Messages for the user or the log

MODIFY CREATE

mapped-<entity>

%cid → real key (or %pid with late numbering)

COMMIT ENTITIES

sy-subrc = 0

Saved

COMMIT ENTITIES

sy-subrc = 4

Early save failed (finalize / check_before_save, e.g. validateCustomer). Nothing saved; the buffer is still there – fix and commit again, or ROLLBACK ENTITIES

COMMIT ENTITIES

sy-subrc = 8

Late save failed (after the point of no return, e.g. a saver raised CL_ABAP_BEHAVIOR_SAVER_FAILED) – the transaction is rolled back

COMMIT ENTITIES variants

COMMIT ENTITIES.                                           " simplest – check sy-subrc

COMMIT ENTITIES RESPONSE OF zr_salesorder                  " messages of the save sequence
FAILED   DATA(c_failed)
REPORTED DATA(c_reported).

COMMIT ENTITIES IN SIMULATION MODE.                        " run only the early save (checks), save nothing

" Late numbering: get the final key from the %pid while the commit scope is open
COMMIT ENTITIES BEGIN RESPONSE OF zr_salesorder
FAILED   DATA(b_failed)
REPORTED DATA(b_reported).
CONVERT KEY OF zr_salesorder\\SalesOrder
FROM mapped-salesorder[ 1 ]-%pid
TO DATA(final_key).
COMMIT ENTITIES END.
  • Simulation mode is useful for a "check" step in a custom tool or a test: you learn whether the validations pass without saving.
  • CONVERT KEY is needed only for BOs whose key uses late numbering, such as SAP's I_SalesOrderTP (R18): MAPPED has only the %pid, and the real number exists only inside the commit scope. Our order key is a UUID, so MAPPED already has the final OrderUUID.

Part 5 – GET PERMISSIONS, SET LOCKS, IN LOCAL MODE and PRIVILEGED

GET PERMISSIONS and SET LOCKS

" May the user update this order and run approve on it? (feature control + authorization, R7)
GET PERMISSIONS ENTITY zr_salesorder
FROM VALUE #( ( %tky = order-%tky ) )
REQUEST VALUE #( %update         = if_abap_behv=>mk-on
%action-approve = if_abap_behv=>mk-on )
RESULT DATA(permissions)
FAILED DATA(perm_failed)
REPORTED DATA(perm_reported).

IF permissions-instances[ 1 ]-%action-approve = if_abap_behv=>fc-o-enabled.
" offer approve in a custom UI
ENDIF.

" Only global authorization, no instance needed (may this user create orders at all?)
GET PERMISSIONS ONLY GLOBAL ENTITY zr_salesorder
REQUEST VALUE #( %create = if_abap_behv=>mk-on )
RESULT DATA(global_perm)
FAILED DATA(g_failed)
REPORTED DATA(g_reported).

" Lock explicitly (e.g. before a long calculation) – held until the transaction ends
SET LOCKS ENTITY zr_salesorder
FROM VALUE #( ( %tky = order-%tky ) )
FAILED DATA(lock_failed).
  • Other variants: ONLY INSTANCE, ONLY FEATURES, ONLY AUTHORIZATION and combinations such as ONLY GLOBAL FEATURES (check the keyword documentation of your release).
  • GET PERMISSIONS only asks; the real check runs again when you execute. A custom tool uses it to grey out buttons, not as a security check.

IN LOCAL MODE and PRIVILEGED

Addition

Skips

Who may use it

(none)

Nothing – all checks run, like for a Fiori user

Any consumer, e.g. the nightly job (R12)

IN LOCAL MODE

Feature control and authorization checks of the BO itself

Only the BO's own implementation (e.g. setInitialStatus setting the read-only Status, or the internal action recalcTotal)

PRIVILEGED

Only the authorization checks that the BDEF lists in the authorization context for privileged mode

Any trusted consumer, only if the BDEF declares with privileged mode disabling <context> → 06 · Feature Control, Authorization & Numbering

" In the determination setInitialStatus (R4): Status is read-only for users, but the BO may set it
MODIFY ENTITIES OF zr_salesorder IN LOCAL MODE
ENTITY SalesOrder
UPDATE FIELDS ( Status )
WITH VALUE #( FOR key IN keys ( %tky = key-%tky  Status = 'N' ) )
REPORTED DATA(update_reported).

" A trusted consumer skips the checks listed in the privileged authorization context
MODIFY ENTITIES OF zr_salesorder PRIVILEGED
ENTITY SalesOrder
EXECUTE approve FROM VALUE #( ( OrderUUID = order_uuid ) )
FAILED DATA(priv_failed)
REPORTED DATA(priv_reported).
  • PRIVILEGED skips authorization only – feature control still applies, so approve on an order that is not in status N fails even in privileged mode (R7).
  • FORWARDING PRIVILEGED (BTP 2408) passes the caller's privileged mode on to a BO you call from your handler – check your release.

Part 6 – R12 end to end: the nightly approval job

The business wants small orders approved automatically every night, so managers only see the large ones. In ABAP Cloud the job is an application job: a class that implements the released interfaces IF_APJ_DT_EXEC_OBJECT (design time: parameters) and IF_APJ_RT_EXEC_OBJECT (runtime: execute) – the older pattern, still released; current releases: IF_APJ_RT_RUN (execute). On-premise the same EML code can also run in a report scheduled in SM36.

CLASS zcl_so_nightly_approve DEFINITION PUBLIC FINAL CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES if_apj_dt_exec_object.            " job parameters (design time)
INTERFACES if_apj_rt_exec_object.            " execute( ) (runtime)
ENDCLASS.

CLASS zcl_so_nightly_approve IMPLEMENTATION.
METHOD if_apj_dt_exec_object~get_parameters.   " no parameters in this sketch
ENDMETHOD.

METHOD if_apj_rt_exec_object~execute.
" 1. candidates: read through the CDS view (DCL applies, R3), never the table
SELECT OrderUUID FROM zr_salesorder
WHERE Status = 'N' AND NetAmount <= 500
INTO TABLE @DATA(candidates).
IF candidates IS INITIAL.
RETURN.
ENDIF.

" 2. approve through the BO: feature control (status N) and authorization (R7) run as in the app
MODIFY ENTITIES OF zr_salesorder
ENTITY SalesOrder
EXECUTE approve FROM VALUE #( FOR c IN candidates ( OrderUUID = c-OrderUUID ) )
FAILED DATA(failed)
REPORTED DATA(reported).

" 3. save the orders that passed; the rejected ones stay in FAILED
COMMIT ENTITIES RESPONSE OF zr_salesorder
FAILED   DATA(commit_failed)
REPORTED DATA(commit_reported).
IF sy-subrc <> 0.
ROLLBACK ENTITIES.
ENDIF.

" 4. write failed / reported / commit_reported to the application log (e.g. cl_bali_log)
ENDMETHOD.
ENDCLASS.
  • The limit 500 is a placeholder for the business rule; a real job reads it from a job parameter.
  • The job runs under its own user. That user needs the approval authorization (R7) – or the BO offers privileged mode for this caller (Part 5). Do not "fix" a missing role with IN LOCAL MODE; it is not allowed outside the BO.
  • An order a rep is editing in draft right now is locked (exclusive lock phase of the draft): approve returns it in failed-salesorder with %fail-cause = locked. The job tries again the next night; details on draft locks → 07 · Locking, Draft & Side Effects.
  • An application job also needs a job catalog entry and a job template so it can be scheduled in the *Application Jobs* app (check your release for the ADT wizard).
  • Large volumes: commit in packages (e.g. 500 orders per MODIFY + COMMIT ENTITIES) so one failing early save does not hold back all orders and the buffer stays small.

Newer EML additions (check your release)

Feature

What it does

Since

READ ENTITIES ... IN LOCAL MODE ... WITH CHANGES

Read that also returns what changed in the current transaction (managed BOs only)

BTP 2511

SET ENTITIES

Blocks or unblocks EML access to BOs in a program section

ABAP 7.58 (S/4HANA 2023)

No EML reads in the late save

READ ENTITIES is not allowed in adjust_numbers / save / save_modified; take the data from the saver's importing parameters

BTP 2408

CL_ABAP_BEHV_AUX

get_current_phase( ), get_current_context( ) (e.g. privileged), get_current_handler_kind( ) – useful in shared helper classes

Released auxiliary class

Contract checks

Runtime error BEHAVIOR_BAD_HANDLER_RESPONSE when a handler returns a response that breaks the RAP contract (also fails unit tests)

Newer BTP releases

Common mistakes

  • COMMIT ENTITIES or COMMIT WORK inside a behavior pool → runtime error. The OData request or your consumer commits.
  • Using %key instead of %tky in a draft BO → you read or change the active instance instead of the draft (or get not_found).
  • Forgetting %control / FIELDS → UPDATE "succeeds" but changes nothing.
  • Not checking sy-subrc after COMMIT ENTITIES → a failed validation goes unnoticed in the nightly job.
  • Using IN LOCAL MODE from a consumer class – it is only allowed in the BO's own implementation.
  • UPDATE zsales_hdr from a program "because it is faster" → no R4–R9 checks, no lock, no audit log (R14), and the ETag of open drafts is not respected.

Interview tip

  • "What happens between MODIFY and COMMIT ENTITIES?" → MODIFY runs the interaction phase (locks, feature control, authorization, determinations on modify) and only fills the buffer. COMMIT ENTITIES runs the save sequence; sy-subrc 4 = early save (validation) failed, 8 = late save failed.

Part 7 – Interview questions

Q1. What is EML, and what are its main statements?

Entity Manipulation Language – ABAP statements to read and change RAP BOs: READ ENTITIES, MODIFY ENTITIES (create, create by association, update, delete, execute action), COMMIT ENTITIES and ROLLBACK ENTITIES, plus GET PERMISSIONS and SET LOCKS. It works for your own BOs and SAP's released ones such as I_SalesOrderTP, and every call passes the BO's checks.

Q2. Why IN LOCAL MODE, and what are %cid, %tky, %key and %control?

IN LOCAL MODE skips feature control and authorization inside the BO's own implementation – the determination setInitialStatus may set the read-only Status. %cid is a temporary ID for a new instance within one request (children refer to it with %cid_ref); %key holds the primary key; %tky = %key + %is_draft (+ %pid with late numbering) and should be used in handlers; %control flags which fields are supplied or requested.

Q3. Where may COMMIT ENTITIES be used, and what does sy-subrc tell you afterwards?

Only in consumer code – a class, report, application job or unit test – never in a behavior pool, where the OData request or the caller commits. sy-subrc 0 = saved; 4 = the early save failed (a validation or check_before_save rejected the data, nothing saved, buffer kept – fix or ROLLBACK ENTITIES); 8 = the late save failed and the transaction was rolled back.

Q4. An EML UPDATE returns no errors but nothing changes. Why?

The %control flags were not set – neither FIELDS ( ... ) nor %control-<field> = mk-on. RAP only changes fields whose control flag is on, so it can tell "set to initial" from "not sent". Another classic: the program never called COMMIT ENTITIES, so the change stayed in the buffer.

Q5. A nightly job must approve orders. How do you build it, and what can go wrong?

An application job class (IF_APJ_RT_RUN; older pattern IF_APJ_DT_EXEC_OBJECT / IF_APJ_RT_EXEC_OBJECT) that selects candidates from the CDS view, calls EXECUTE approve through EML, then COMMIT ENTITIES with a sy-subrc check, and logs FAILED/REPORTED in the application log. Pitfalls: the job user lacks the approval authorization, orders in draft are locked by a user, orders not in status N are rejected by feature control, and unchecked responses hide all of it.

Q6. Why not update zsales_hdr directly from the program – it is faster?

A direct UPDATE skips everything the BO guarantees: determinations (status, total), validations, feature control, authorization, locks and ETags, numbering and the additional save that writes the audit log. Draft users would also overwrite each other. EML is the only supported way to change a RAP BO.

Q7. IN LOCAL MODE vs PRIVILEGED?

IN LOCAL MODE is only allowed inside the BO's own implementation and skips its feature control and authorization. PRIVILEGED is for trusted external consumers and skips only the authorization checks the BDEF lists in its privileged authorization context; feature control still runs. Without with privileged mode in the BDEF, PRIVILEGED is not possible.

Q8. What is CONVERT KEY for?

For BOs whose key is assigned by late numbering, such as I_SalesOrderTP. After MODIFY, MAPPED holds only the preliminary %pid. Between COMMIT ENTITIES BEGIN and COMMIT ENTITIES END, CONVERT KEY turns the %pid into the final key, e.g. the real sales order number.

Q9. What does READ ENTITIES return that a SELECT does not?

READ ENTITIES reads the transactional buffer, so it sees unsaved changes of the current transaction and draft instances via %tky, and it reports missing instances in FAILED. A SELECT reads only what is already committed in the database – inside handlers that is usually stale.

🏠 Start Here · ◀ 07 · Locking, Draft & Side Effects · 09 · Unmanaged & Save Variants ▶ · Sections: CORE ABAP | OOPS ABAP | ABAP on HANA | Clean Core | RAP | ABAP Points | SAP Fiori | SAPUI5 | Mobile Development (MDK) | BTP Foundations | BTP Development | CAP | SAP Build | ABAP on BTP | Integration Suite | SAP Business AI | SAP BASIS | Security | SAP SDLC

Functional: FICO ABAP | TRM ABAP | VIM | SAP BIS | SD ABAP | MM ABAP | PP ABAP | QM ABAP | PM ABAP | PS ABAP | EWM | TM ABAP | GTM ABAP | EHS ABAP | HR ABAP | BW | SAP Datasphere | SAP Business Data Cloud | SAP MDG | SAP Analytics Cloud | SAP Ariba | SAP CX | SAP IBP