前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >APF filter到底支持多复杂的条件

APF filter到底支持多复杂的条件

作者头像
Jerry Wang
发布2019-05-31 09:28:38
9390
发布2019-05-31 09:28:38
举报

When I added 6 individual filters in the configuration:

clipboard1
clipboard1

And run it:

clipboard2
clipboard2

Add first step is OK, but when select Year 2016 and add second step, dump occurred:

clipboard3
clipboard3
clipboard4
clipboard4

The error is “Filter condition is too complex”

The batch request URL is as below:

https://jerry.sap.corp:1300/sap/opu/odata/sap/Z_SALESVOLUMEANALYSISQUERY_CDS/Z_SALESVOLUMEANALYSISQUERY(P_ExchangeRateType=‘M’,P_DisplayCurrency=‘EUR’)/Results?KaTeX parse error: Expected 'EOF', got '&' at position 76: …DisplayCurrency&̲filter=((((BillingDocumentDateYear%20eq%20%272015%27)%20or%20(BillingDocumentDateYear%20eq%20%272016%27)%20or%20(BillingDocumentDateYear%20eq%20%272017%27))%20and%20((BillingDocDateYearQuarter%20eq%20%271.2015%27)%20or%20(BillingDocDateYearQuarter%20eq%20%272.2015%27)%20or%20(BillingDocDateYearQuarter%20eq%20%273.2015%27)%20or%20(BillingDocDateYearQuarter%20eq%20%274.2015%27)%20or%20(BillingDocDateYearQuarter%20eq%20%271.2016%27)%20or%20(BillingDocDateYearQuarter%20eq%20%272.2016%27)%20or%20(BillingDocDateYearQuarter%20eq%20%273.2016%27)%20or%20(BillingDocDateYearQuarter%20eq%20%274.2016%27)%20or%20(BillingDocDateYearQuarter%20eq%20%273.2017%27)%20or%20(BillingDocDateYearQuarter%20eq%20%274.2017%27))%20and%20((BillingDocDateYearMonth%20eq%20%2702.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2705.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2706.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2707.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2708.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2709.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2710.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2711.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2712.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2701.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2702.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2703.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2704.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2705.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2706.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2709.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2711.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2708.2017%27)%20or%20(BillingDocDateYearMonth%20eq%20%2710.2017%27)))%20and%20((SalesOrganization%20eq%20%270001%27)%20or%20(SalesOrganization%20eq%20%270012%27)%20or%20(SalesOrganization%20eq%20%27ZBG1%27)%20or%20(SalesOrganization%20eq%20%27ZZZ1%27))%20and%20(BillingDocumentDateYear%20eq%20%272015%27))&$format=json Seems indeed it’s very complex… but all the filters are necessary, looks like I have to try Smart Filter instead…

I’ve copied the configuration, you could use the copied one:

clipboard5
clipboard5

我找到了具体引起这个错误的ABAP code,一会给你说怎么定位:

clipboard6
clipboard6

现在在看怎么避免这个error。你第一次添加step时能够正常工作,因为it_filter_select_options和iv_filter_string都是有值的:

clipboard7
clipboard7

而添加第二个step时,it_filter_select_options不知为何为空了,所以框架检查出错:

clipboard8
clipboard8

还需要继续看。第一个step传到后台的url: GET Z_SALESVOLUMEANALYSISQUERY(P_ExchangeRateType=%27M%27,P_DisplayCurrency=%27EUR%27)/Results?KaTeX parse error: Expected 'EOF', got '&' at position 74: …DisplayCurrency&̲filter=((((BillingDocumentDateYear%20eq%20%272015%27)%20or%20(BillingDocumentDateYear%20eq%20%272016%27)%20or%20(BillingDocumentDateYear%20eq%20%272017%27))%20and%20((BillingDocDateYearQuarter%20eq%20%271.2015%27)%20or%20(BillingDocDateYearQuarter%20eq%20%272.2015%27)%20or%20(BillingDocDateYearQuarter%20eq%20%273.2015%27)%20or%20(BillingDocDateYearQuarter%20eq%20%274.2015%27)%20or%20(BillingDocDateYearQuarter%20eq%20%271.2016%27)%20or%20(BillingDocDateYearQuarter%20eq%20%272.2016%27)%20or%20(BillingDocDateYearQuarter%20eq%20%273.2016%27)%20or%20(BillingDocDateYearQuarter%20eq%20%274.2016%27)%20or%20(BillingDocDateYearQuarter%20eq%20%273.2017%27)%20or%20(BillingDocDateYearQuarter%20eq%20%274.2017%27))%20and%20((BillingDocDateYearMonth%20eq%20%2702.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2705.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2706.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2707.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2708.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2709.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2710.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2711.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2712.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2701.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2702.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2703.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2704.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2705.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2706.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2709.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2711.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2708.2017%27)%20or%20(BillingDocDateYearMonth%20eq%20%2710.2017%27)))%20and%20((SalesOrganization%20eq%20%270001%27)%20or%20(SalesOrganization%20eq%20%270012%27)%20or%20(SalesOrganization%20eq%20%27ZBG1%27)%20or%20(SalesOrganization%20eq%20%27ZZZ1%27)))&format=jsonHTTP/1.1第二个step的url:GETZSALESVOLUMEANALYSISQUERY(PExchangeRateType=format=json HTTP/1.1 第二个step的url: GET Z_SALESVOLUMEANALYSISQUERY(P_ExchangeRateType=%27M%27,P_DisplayCurrency=%27EUR%27)/Results?format=jsonHTTP/1.1第二个step的url:GETZS​ALESVOLUMEANALYSISQUERY(PE​xchangeRateType=select=BillingDocDateYearQuarter,DisplayCurrency,NetAmountInDisplayCurrency&filter=((((BillingDocumentDateYearfilter=((((BillingDocumentDateYear%20eq%20%272015%27)%20or%20(BillingDocumentDateYear%20eq%20%272016%27)%20or%20(BillingDocumentDateYear%20eq%20%272017%27))%20and%20((BillingDocDateYearQuarter%20eq%20%271.2015%27)%20or%20(BillingDocDateYearQuarter%20eq%20%272.2015%27)%20or%20(BillingDocDateYearQuarter%20eq%20%273.2015%27)%20or%20(BillingDocDateYearQuarter%20eq%20%274.2015%27)%20or%20(BillingDocDateYearQuarter%20eq%20%271.2016%27)%20or%20(BillingDocDateYearQuarter%20eq%20%272.2016%27)%20or%20(BillingDocDateYearQuarter%20eq%20%273.2016%27)%20or%20(BillingDocDateYearQuarter%20eq%20%274.2016%27)%20or%20(BillingDocDateYearQuarter%20eq%20%273.2017%27)%20or%20(BillingDocDateYearQuarter%20eq%20%274.2017%27))%20and%20((BillingDocDateYearMonth%20eq%20%2702.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2705.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2706.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2707.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2708.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2709.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2710.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2711.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2712.2015%27)%20or%20(BillingDocDateYearMonth%20eq%20%2701.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2702.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2703.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2704.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2705.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2706.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2709.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2711.2016%27)%20or%20(BillingDocDateYearMonth%20eq%20%2708.2017%27)%20or%20(BillingDocDateYearMonth%20eq%20%2710.2017%27)))%20and%20((SalesOrganization%20eq%20%270001%27)%20or%20(SalesOrganization%20eq%20%270012%27)%20or%20(SalesOrganization%20eq%20%27ZBG1%27)%20or%20(SalesOrganization%20eq%20%27ZZZ1%27))%20and%20(BillingDocumentDateYear%20eq%20%272016%27))&filter=((((BillingDocumentDateYearformat=json HTTP/1.1在第二个step时,上面的方法解析select option出错了:因此最后没有select option传到后台框架去,所以引起了那个错误。

clipboard9
clipboard9
clipboard10
clipboard10

解析出错的原因 这个BILLINGDOCUMENTDATEYEAR出现在了一个内表里,expect的行为是不出现。还需要看。

clipboard11
clipboard11

比较两个step发送url有何差异,已经能看出原因了,蓝色的区域是第二个step新增加的url:

clipboard12
clipboard12

之前的研究概括起来就是:在第一个step的chart上选中2016年那个节点,然后创建第二个step,此时给后台发送的url如下:

clipboard13
clipboard13

这时选中的context 2016年就是上图紫色的内容,通过debug框架,发现其验证逻辑认为紫色的2016年是不合法的,因为and 左边的filter里已经包含了这个条件了,所以报错。这些url都是APF runtime 负责拼接再传给后台的,我们没办法控制,这个问题可能需要和APF的同事一起来看: 或者是我们filter的modelling有问题 或者是APF 处理filter这块的JS代码有问题

We got this “filter condition is too complex error” again, add sap-apf-filter-reduction=true in the URL doesn’t work this time. Go to:

https://jerry.wdf.sap.corp:1300/sap/bc/ui5_ui5/ui2/ushell/shells/abap/FioriLaunchpad.html?sap-client=928#BillingDocument-testSalesVolume?EvaluationId=.E.1464769533103&sap-xapp-state=ASMUJD92Q3C7JZ6BJ9G5AA8DNIVBC7IKQFPAM4WD&/ Don’t change filter, add a step, the error will occur.

clipboard14
clipboard14

I checked the error log and debugged the code like we did last time, I found that the cause is not the same as the last time: Filter check code on ER9:

clipboard15
clipboard15
clipboard16
clipboard16
clipboard17
clipboard17
clipboard18
clipboard18
clipboard19
clipboard19
clipboard20
clipboard20

It seems the code check if there’re more than one filters have more than one values in the condition, if so, it will raise error.

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019年04月01日,如有侵权请联系 cloudcommunity@tencent.com 删除

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

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

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

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