
To enable standard operation create for an entity, add the statement create; to the entity behavior body (curly brackets after statement define behavior for …). To disable the operation, remove the statement or turn it into a comment.
Note
In a managed implementation scenario, create can only be declared for root entities. Child entities are implicitly create-enabled for internal usage. That means, an external consumer can only create a new instance of a child entity via its parent (create-by-association operation). In unmanaged implementation scenarios, direct creates on child entities are possible but not recommended.
Interesting additions to the create statement are as follows:
- Internal
Prefix which disables the operation for external consumers of the BO.
- features: global
Enable dynamic feature control. The decision, when the operation is enabled, is made dynamically in a behavior implementation.
- precheck
A method is called before the create request to prevent unwanted changes from reaching the application buffer.
- authorization: none
Excludes the create operation from the global authorization checks.

To make standard operation create available in OData and SAP Fiori, it has to be exposed in the behavior definition on projection level (behavior projection).
To include standard operation create in the OData service, add the statement use create; to the entity behavior body (curly brackets after statement define behavior for …). To disable the operation, remove the statement or turn it into a comment.
Note
Behavior projections can have their own implementations, which can be used to augment the implementation of a standard operation or provide more prechecks. This is a special case that we don't cover in this class.
When the standard operation Create is available in the OData service, the service preview displays a Create button on the List Report Page for the related RAP BO entity. By choosing this button, the user navigates to an Object Page for a new entity instance.
Hint
After editing the behavior projection, you can press Ctrl + F5 to perform a hard refresh of the service preview before you can see the new button. Sometimes, you even have to clear your browsing data. (Press Ctrl + Shift + Del for that).












