基于gateway实现odata(4)–查询选项1-select

在此贴先介绍the single read  ( get_entity )。


前面章节介绍了,简单ODATA的开发,但在ODATA的使用中,还有很多ODATA的参数的使用,
此介绍介绍ODATA的查询
更详细学习请参看:SAP Press – OData and SAP NetWeaver Gateway

ODATA学习(SAP Press – OData and SAP NetWeaver Gateway)第6.5.2章节,第269页

That’s  why  the single read  ( get_entity )  is  typi-

cally implemented after the  get_entityset .

Sim il ar to the  QU E RY  method,  you  can easily develop the single read via

the  ABAP  Class  Builde r.  Th is time, expand the  SERVICE  IMPLEMENTATION  •

PRODUCT(OLLECTION  node, right-click on  GETENTITY  (READ),  and choose

GoTo  ABAP  WORKBENCH.  An  information pop-up screen appears

because the method hasn’t yet been implemen te d.

————————————————————————————————————
在上一节中,我们学习了简单ODATA开发时,在重定义了类的get_entityset方法,并取出数据,
但在使用ODATA时,有时我们会使用如 /sap/opu/odata/sap/ZSALE_SRV/ZTSALE_H(Gjahr=’2016′,Zsaleid=’1002′).的查询方式 ,这里就需要对get_entity方法进行重定义了,
写入方法如下:

这里就可以使用/sap/opu/odata/sap/ZSALE_SRV/ZTSALE_H(Gjahr=’2016′,Zsaleid=’1002′).的查询方式查询出数据了。

更详细学习ODATA请参看:SAP Press – OData and SAP NetWeaver Gateway
后面将说明Query  Options更多的查询选项$select ,  $filter ,  Hop ,  $skip , $in li necou nt , and $orderby。

 

留下一个回复

你的email不会被公开。