How does feature control work in RAP? Explain static versus dynamic and global versus instance.
Say your answer out loud first.
Practise another way
Feature control decides what the UI offers: which operations and actions are enabled, and which fields are read-only or mandatory. Static control is fixed in the BDEF, like field ( readonly ).
Dynamic control is code: global features depend on something outside the instance, instance features depend on the instance state. I implement them in the get features handler methods. It is a usability layer, not security, so authorization stays separate.
Static
Declared once in the behavior definition and the same for every instance:
field ( readonly ) TravelID, CreatedAt;
field ( mandatory : create ) CustomerID;
Dynamic
You switch it on per operation, action or field and then implement a handler.
action ( features : instance ) acceptTravel result [1] $self;
update ( features : instance );
field ( features : instance ) BookingFee;
create ( features : global );
- Global (
FOR GLOBAL FEATURES): the answer does not depend on one instance, for example a system switch or a user setting. It applies to the whole entity. - Instance (
FOR INSTANCE FEATURES): the answer depends on the instance state, for example an accepted travel cannot be accepted again. The handler isMETHODS get_features FOR INSTANCE FEATURES IMPORTING keys REQUEST requested_features FOR travel RESULT result. It reads the state withREAD ENTITIES ... IN LOCAL MODE(passingfailedthrough, because invalid keys can fail the read) and returns oneresultline per key.
result = VALUE #( FOR t IN travels
( %tky = t-%tky
%features-%action-acceptTravel = COND #( WHEN t-OverallStatus = 'A'
THEN if_abap_behv=>fc-o-disabled ELSE if_abap_behv=>fc-o-enabled )
%assoc-_Booking = COND #( WHEN t-OverallStatus = 'X'
THEN if_abap_behv=>fc-o-disabled ELSE if_abap_behv=>fc-o-enabled )
%field-BookingFee = COND #( WHEN t-OverallStatus = 'A'
THEN if_abap_behv=>fc-f-read_only ELSE if_abap_behv=>fc-f-unrestricted ) ) ).
%assoc-_Booking controls create-by-association (the BDEF needs association _Booking { create ( features : instance ); }). SAP's help page confirms the action and association results.
The field-level %field result with fc-f- constants was not on the pages I could open, so check those constants in your system. An operation is enabled by default, so you only set what you want to restrict.
What to say about the limits
- Feature control is evaluated by the framework for outside consumers. EML calls with
IN LOCAL MODEskip feature control, authorization and prechecks. - It is not a replacement for validation: always protect the data rule on the server in a validation, too.
- When a field change must refresh the feature state in a Fiori app, add a side effect with
permissions(...).
Separates static, global and instance control, shows the handler result columns, and says feature control is usability, not security, so a validation still guards the rule.
Treats feature control as authorization, or only knows field ( readonly ) and cannot say how an action is disabled by state.
Using feature control to enforce a business rule. A consumer that calls the BO in local mode, or a changed state between read and save, bypasses it.
- Why does the button stay enabled after you change a field in the UI?
- Does feature control apply to calls made with IN LOCAL MODE?
- Which operations support instance features, and which do not?
- How is this different from authorization master?
5 official pages. Confidence: high. Checked 21 Nov 2026.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.
- Official page Backs the answer.