当前位置:网站首页>在 Excel 内使用 ODBC 消费 SAP ABAP CDS view
在 Excel 内使用 ODBC 消费 SAP ABAP CDS view
2022-07-20 10:14:00 【InfoQ】
为什么我们需要针对 ABAP 的 ODBC Driver?
使用 ABAP ODBC Driver 的前置步骤
创建和填充测试数据库表
@EndUserText.label : 'ORDER ITEMS'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table zorderitems {
key orderid : abap.numc(10) not null;
key pos : abap.int4 not null;
item : abap.char(100) not null;
amount : abap.int4 not null;
}
@EndUserText.label : 'Jerry ORDERS'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
@AbapCatalog.dataMaintenance : #RESTRICTED
define table zorders {
key id : abap.numc(10) not null;
creationdate : abap.datn;
}
class zcl_fill_orders definition
public
final
create public.
public section.
interfaces if_oo_adt_classrun.
protected section.
private section.
endclass.
class zcl_fill_orders implementation.
method if_oo_adt_classrun~main.
data: lt_orders type table of zorders.
delete from zorders.
lt_orders = value #(
( id = '1' creationdate = '20210801' )
( id = '2' creationdate = '20210802' )
( id = '3' creationdate = '20210803' )
).
insert zorders from table @lt_orders.
out->write( sy-dbcnt ).
data: lt_orderitems type table of zorderitems.
delete from zorderitems.
lt_orderitems = value #(
( orderid = '1' pos = '1' item = 'Apple' amount = '5' )
( orderid = '1' pos = '2' item = 'Banana' amount = '5' )
( orderid = '1' pos = '3' item = 'Orange Juice' amount = '2' )
( orderid = '2' pos = '1' item = 'Orange' amount = '10' )
( orderid = '2' pos = '2' item = 'Apple' amount = '5' )
( orderid = '3' pos = '1' item = 'Bottle Water' amount = '5' )
).
insert zorderitems from table @lt_orderitems.
out->write( sy-dbcnt ).
endmethod.
endclass.

@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'ORDERS'
define view entity ZORDERSVIEW as select from zorders {
key id as Id,
creationdate as CreationDate
}
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'ORDER ITEMS'
define view entity ZORDERITEMSVIEW as select from zorderitems {
key orderid as OrderId,
key pos as Pos,
item as Item,
amount as Amount
}


@EndUserText.label: 'test SQL service'
define service Z_SERVICE_DEF_SQL {
expose ZORDERSVIEW as Orders;
expose ZORDERITEMSVIEW as OrderItems;
}































总结
边栏推荐
猜你喜欢
【系统设计】分布式键值数据库
Leetcode simple problem strong password checker II
Excel-vba quick start (VIII. Cell objects - common cell operations)
Are there any interesting web games website recommendations?
第二章 第一节:基础数据类型详解
jenkins pipeline下载代码到指定workspace
知识点滴 - 有关剧本的网站
[u-boot] main line analysis of u-boot operation [02] - board_ init_ f
足球队巡礼 - 英超西汉姆联
工控安全PLC固件逆向一
随机推荐
自定义持久层框架MyORMFramework(二)—框架设计
大数处理--使用案例
一个诡异的 JedisConnectionException: Connection refused 问题
【u-boot】u-boot运行主线分析【03】—board_init_r
Redis key hierarchical format
掌握JedisPoolConfig参数配置,学会调优技能
Redis-Set类型
Custom persistence layer framework myormframework (III) - framework implementation
聊一聊 C# 后台GC 到底是怎么回事?
Le point d'interrogation est en place! Yu Jingchuan 2013 Best think "China Space Station", stars of the Sea to navigate!...
Excel-VBA 快速上手(八、单元格对象-常见的单元格操作)
[u-boot] main line analysis of u-boot operation [03] - board_ init_ r
Network architecture in Skynet
利用神器Typora+PicGo,实现有道云不用会员就可在Markdown自动上传图片
Chapter 1, section 6: Variables
MySQL索引原理
win10开机启动ps1脚本
LeetCode简单题之强密码检验器 II
Redis set type
基于CLAR架构打造的宝马i3,并非是简单的“油改电”产品