前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >使用Chrome开发者工具研究SAP UI5应用里的Odata请求

使用Chrome开发者工具研究SAP UI5应用里的Odata请求

作者头像
Jerry Wang
发布2019-05-30 18:20:17
6290
发布2019-05-30 18:20:17
举报

Suppose I need to investigate how the entities of Initiatives displayed in the table control below is accessed via OData in UI5 application Customer Engagement Initiative (CEI):

在这里插入图片描述
在这里插入图片描述

Requirement1: find out the OData Access URL for Initiatives in table control. Launch the CEI application via Chrome, click F12 to open development tool, go to tab Network, switch on Record mode by clicking button “Record Network Log”.

在这里插入图片描述
在这里插入图片描述

Then click the INITIATIVES work center and display the table control as usual. The record icon turns red which indicates currently the network traffic is recorded. You should observe lots of traffic logged as below.

在这里插入图片描述
在这里插入图片描述

Click filter button, and filter by “XHR” ( Xml Http Request), then check starting from the bottom-most, and soon you find the OData access url for initiatives:

在这里插入图片描述
在这里插入图片描述

So this url “https://:44300/sap/opu/odata/sap/CUAN_COMMON_SRV/Initiatives?KaTeX parse error: Expected 'EOF', got '&' at position 7: skip=0&̲top=110&$inlinecount=allpages” is just what we are looking for. Write it down for later usage.

Click Preview tab, and you can check the initiative instance contained in Odata response, to compare each field with UI ( for example, ID, Creator, CreatedOnDate, EndDate etc ).

在这里插入图片描述
在这里插入图片描述

The CreatedOn and EndDate store the Unix time-stamp since 1970, you can easily convert it via the link below, the converted time is now exactly the same as what you see in UI.

http://www.unixtimestamp.com/index.php

在这里插入图片描述
在这里插入图片描述

Requirement2: find out which application view has consumed this OData url to access Initiatives data from ABAP backend Go to Chrome development tool, expand tab “XHR Breakpoints”, choose “Add breakpoint” from context menu, and type the url part we find in step1: /sap/opu/odata/sap/CUAN_COMMON_SRV/Initiatives?KaTeX parse error: Expected 'EOF', got '&' at position 7: skip=0&̲top=110&$inlinecount=allpages.

在这里插入图片描述
在这里插入图片描述

And click Initiative work center, then the breakpoint is triggered. Type “o” in Watch Expressions and we can observe the OData access request is set via line 332 below with the very url we find in step1.

Now we need to find out which view has consumed this OData service. Expand tab “Call Stack”:

在这里插入图片描述
在这里插入图片描述

From the call-stack it is very clear the table which displays the initiative data is being rendered. We focus on call-stack highlighted below, the variable c[i] contains the information of table view. Type “c[i]” in Watch Expressions tab and expand it:

在这里插入图片描述
在这里插入图片描述

Here we could find view name and thus could identify the application view in the right hierarchy, and then find how the OData model is bound to the table control in CUAN_INI_OW_WSI.view.js and how the OData model is initialized in controller CUAN_INI_OW_WSI.controller.js.

在这里插入图片描述
在这里插入图片描述
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018年11月22日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档