在SAP云平台ABAP编程环境里使用CAP模型创建Fiori应用

创建必须的CDS view,激活,然后基于CDS view创建behavior definition:

@Semantics.user.createdBy: true
key holiday_id,
@Semantics.user.lastChangedBy: true
month_of_holiday,
@Semantics.systemDateTime.createdAt: true
day_of_holiday,
@Semantics.systemDateTime.lastChangedAt:true
changedat

该behavior definition基于的CDS view为之前创建好的ZCAL_I_HOLIDAY_JERRY:

这个behavior definition实现代码如下:

managed; // implementation in class zbp_cal_i_holiday_jerry unique;

define behavior for ZCAL_I_HOLIDAY_JERRY alias holidayRoot
persistent table ZCAL_HOLIDAY_001
lock master
/*
This defines the root node as main locking object to avoid multiple persons editing the same object.
Sub nodes have to be defined as lock dependent later on.
*/
//authorization master ( instance )
//etag master <field_name>
{
  create;
  update;
  delete;
}

基于data definition创建service definition:

在Service definition里,将CDS view暴露出来,重命名为HolidayRoot:

再基于service definition创建service binding:

如果遇到语法错误,回过头去检查你的behavior definition或者service definition是否未激活。


service binding成功创建后,激活,就可以通过preview按钮,打开对应的Fiori应用了:





要获取更多Jerry的原创文章,请关注公众号"汪子熙":

猜你喜欢

转载自www.cnblogs.com/sap-jerry/p/12315735.html