一、创建数据模型
基于官方的flight demo创建数据模型,包括机场航班等信息。
1.创建element
相同的步骤,创建ZKDL_CITY_TO
,描述为Destination
。将两个Element保存,激活。
2.创建表
代码如下
@EndUserText.label : 'Connection table'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table zkdlaconn {
key client : abap.clnt not null;
key uuid : sysuuid_x16 not null;
carrier_id : /dmo/carrier_id;
connection_id : /dmo/connection_id;
airport_from_id : /dmo/airport_from_id;
city_from : zkdl_city_from;
country_from : land1;
airport_to_id : /dmo/airport_to_id;
city_to : zkdl_city_to;
country_to : land1;
local_created_by : abp_creation_user;
local_created_at : abp_creation_tstmpl;
local_last_changed_by : abp_locinst_lastchange_user;
local_last_changed_at : abp_locinst_lastchange_tstmpl;
last_changed_at : abp_lastchange_tstmpl;
}
保存,激活。
二、生成Odata
右键选中创建的表,选择`Generate ABAP Repository Objects``。
三、查看ODATA UI SERVICE
添加数据试试。
总结
打完收工。