当前位置:网站首页>7. SAP ABAP OData 服务如何支持 $orderby (排序)操作
7. SAP ABAP OData 服务如何支持 $orderby (排序)操作
2022-08-01 09:34:00 【汪子熙】
序言
本文详细介绍了 SAP ABAP OData 服务如何支持 $orderby (排序)操作,以一个图书管理的 OData 服务实现为例,阐述了如何基于图书的名称和作者名称这两个字段进行排序操作。
我们在本教程第一篇文章 1. 在 SAP ABAP 事物码 SEGW 里创建 SAP OData 项目 里创建的 OData 模型,在 book_name 和 author_name 这两个字段的 sort 属性打上了勾,意思是这两个属性需要支持 OData 标准协议的 $orderby 操作即排序操作。

为了更清楚的看到我们的图书管理 OData 服务,在支持了 $orderby 操作之后的运行时效果,我们再往之前存储图书信息的 ZBOOKS 数据库表里添加一行测试数据:

我们如果不加任何参数,直接通过 OData 服务读取系统所有的 book 数据,那么返回给消费者的 book 数据的顺序,和上图数据库表里记录的顺序一致,这三条记录的 Author,依次为 Jerry,Tom 和 Arena.
我们使用本教程之前步骤提到的 Postman,在请求所有图书数据的 OData 请求的 HTTP 头部字段里&
边栏推荐
- STM32个人笔记-嵌入式C语言优化
- Shell:条件测试操作
- The soul asks: How does MySQL solve phantom reads?
- network basic learning
- sql server, FULL模式, dbcc shrinkfile(2,1) 不能收缩事务日志,还是原来的大小,是为什么?
- ASP.NET Core 6框架揭秘实例演示[30]:利用路由开发REST API
- various network protocols
- 获取页面数据的方法
- [Beyond programming] When the fig leaf is lifted, when people begin to accept everything
- sqlserver怎么查询一张表中同人员的交叉日期
猜你喜欢

Prime Ring Problem(素数环问题)

企业微信群:机器人定时提醒功能数据库配置化

js中如何实现深拷贝?

AC与瘦AP的WLAN组网实验

ClickHouse多种安装方式

Leicester Weekly 304 6135. The longest ring in the picture Inward base ring tree

Microsoft Azure & NVIDIA IoT 开发者季 I|Azure IoT & NVIDIA Jetson 开发基础

Opencv creates a window - cv.namedWindow()

将Servlet项目改为SSM项目

Intensive reading of ACmix papers, and analysis of its model structure
随机推荐
高级驾驶辅助系统ADAS简介
STM32个人笔记-程序跑飞
TiDB的真实数据库数据是存在kv和还是pd上?
BGP综合实验
ClickHouse入门介绍与其特性
程序员如何学习开源项目,这篇文章告诉你
SkiaSharp 之 WPF 自绘 五环弹动球(案例版)
Detailed explanation of JVM runtime data area and JMM memory model
various network protocols
淘宝商品详情又见淘宝详情,升级高级版 API
sqlserver怎么查询一张表中同人员的交叉日期
C language game - minesweeper
Pod environment variables and initContainer
Ogg synchronizes oracle to mysql, there may be characters that need to be escaped in the field, how to configure escape?
A problem with writing to the database after PHP gets the timestamp
Naive Bayes--Study Notes--Basic Principles and Code Implementation
Lsky Pro 企业版手动升级、优化教程
CTO强烈禁止使用Calendar,那用啥?
How to query database configuration parameters in GBase 8c, such as datestyle
Shell:条件测试操作