In this tutorial, wherever XXX appears, use a number (e.g. 000).
Step 1: Create behavior definition
-
Right-click on your data definition ZI_TRAVEL_M_XXX
and select New Behavior Definition.

-
Check your behavior definition. Your implementation type is managed.
Click Next >.

-
Click Finish to use your transport request.

-
Replace your code with following.
managed implementation in class ZCL_BP_I_TRAVEL_M_XXX unique;
define behavior for ZI_TRAVEL_M_XXX alias Travel
persistent table ztravel_xxx
etag master last_changed_at
lock master
{
// semantic key is calculated in a determination
field ( readonly ) travel_id;
// administrative fields (read only)
field ( readonly ) last_changed_at, last_changed_by, created_at, created_by;
// mandatory fields that are required to create a travel
field ( mandatory ) agency_id, overall_status, booking_fee, currency_code;
// mandatory fields that are required to create a travel
field ( mandatory ) Begin_Date, End_Date, Customer_ID;
// standard operations for travel entity
create;
update;
delete;
}
-
Save and activate.

A warning will appear first, but after the creation of the behavior implementation it will disappear.
Now the behavior definition is created and determines the create, update and delete functionality for travel booking.
Step 2: Create behavior definition for projection view
-
Right-click on your data definition ZC_TRAVEL_M_XXX
and select New Behavior Definition.

-
Check your behavior definition. Your implementation type is projection.
Click Next >.

-
Click Finish to use your transport request.

-
Replace your code with following:
projection;
define behavior for ZC_TRAVEL_M_XXX alias TravelProcessor
use etag
{
use create;
use update;
use delete;
}
-
Save and activate.

-
Now switch to your service binding and double click on TravelProcessor
.

-
Refresh your browser and check your result.
The create and delete button appears on the UI because of the managed scenario.
You can create and edit travel bookings or you’ re able to delete existing ones.
Please note that the semantic key Travel ID is not calculated yet. We will do this in the next tutorial.
