SAP创建ODATA服务-Structure
1、创建数据字典
进入se11创建透明表ZRICO_USR,并创建对应字段
2、创建OData service
-
首先创建Gateway service project,事务码:SEGW,点击Create Project 按钮
Gateway service Project分四个部分:
♦ Data Model: 数据模型,主要包括 Entity type,( 比如说 product entity,customer entity 等),Entity set (Entity 的集合,多笔数据) 和 Association (Entity 之间的关联)
♦ Service Implementation: Entity set 的 CRUD 实现
♦ Runtime Artifacts:基于Entity set 的代码框架,包括数据模型 (Data model),数据提供者 (Data provider)
♦ Service maintenance:注册服务,测试服务
-
创建Data Model
-
创建Entity
选中Data Model,右键,Import->DDIC Structure
输入Entity Name以及数据表结构 ZRICO_USR,若勾选Create Default entity set则自动创建Entity set,然后next
选中所有字段,点击next
选择字段MANDT、USRID为主键,并将Name值按照规范首字符需大写,如下图所示。
点击finish,如下图所示:
完成后查看Entity属性
-
调整Entity Sets
设置Entity集合可CRUD
-
-
设置Entity集合可CRUD
选中项目名,右键Generate Runtime
保持所有值默认,点击Continue按钮,运行
系统生成Runtime objects