ITPub博客

首页 > 应用开发 > IT综合 > 在SAP云平台ABAP编程环境里使用CAP模型创建Fiori应用

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

原创 IT综合 作者:i042416 时间:2020-02-25 09:02:51 0 删除 编辑

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

```sql

@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实现代码如下:

```abap

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应用了:


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/24475491/viewspace-2677052/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
测试

注册时间:2018-01-20

  • 博文量
    3822
  • 访问量
    1983865