APF filter到底支持多复杂的条件-阿里云开发者社区

开发者社区> -开发者助手-> 正文

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

简介: APF filter到底支持多复杂的条件
+关注继续查看

When I added 6 individual filters in the configuration:

image.pngAnd run it:

image.pngimage.pngThe error is “Filter condition is too complex”


The batch request URL is as below:


https://jerry:1300/sap/opu/odata/sap/Z_SALESVOLUMEANALYSISQUERY_CDS/Z_SALESVOLUMEANALYSISQUERY(P_ExchangeRateType=%27M%27,P_DisplayCurrency=%27EUR%27)/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:

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

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

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

image.png还需要继续看。第一个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)))&f o r m a t = j s o n H T T P / 1.1 第 二 个 s t e p 的 u r l : G E T Z S A L E S V O L U M E A N A L Y S I S Q U E R Y ( P E x c h a n g e R a t e T y p e = 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:GETZ

S


ALESVOLUMEANALYSISQUERY(P

E


xchangeRateType=select=BillingDocDateYearQuarter,DisplayCurrency,NetAmountInDisplayCurrency&f i l t e r = ( ( ( ( B i l l i n g D o c u m e n t D a t e Y e a r 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%272016%27))&filter=((((BillingDocumentDateYearformat=json HTTP/1.1在第二个step时,上面的方法解析select option出错了:因此最后没有select option传到后台框架去,所以引起了那个错误。

image.pngimage.png解析出错的原因

这个BILLINGDOCUMENTDATEYEAR出现在了一个内表里,expect的行为是不出现。还需要看。image.png比较两个step发送url有何差异,已经能看出原因了,蓝色的区域是第二个step新增加的url:

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

image.png这时选中的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: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.image.pngI 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:

image.pngimage.pngimage.pngimage.pngIt 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.



版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
阿里云服务器怎么设置密码?怎么停机?怎么重启服务器?
如果在创建实例时没有设置密码,或者密码丢失,您可以在控制台上重新设置实例的登录密码。本文仅描述如何在 ECS 管理控制台上修改实例登录密码。
10077 0
阿里云服务器如何登录?阿里云服务器的三种登录方法
购买阿里云ECS云服务器后如何登录?场景不同,大概有三种登录方式:
2962 0
阿里云服务器ECS远程登录用户名密码查询方法
阿里云服务器ECS远程连接登录输入用户名和密码,阿里云没有默认密码,如果购买时没设置需要先重置实例密码,Windows用户名是administrator,Linux账号是root,阿小云来详细说下阿里云服务器远程登录连接用户名和密码查询方法
11612 0
阿里云服务器安全组设置内网互通的方法
虽然0.0.0.0/0使用非常方便,但是发现很多同学使用它来做内网互通,这是有安全风险的,实例有可能会在经典网络被内网IP访问到。下面介绍一下四种安全的内网互联设置方法。 购买前请先:领取阿里云幸运券,有很多优惠,可到下文中领取。
11818 0
阿里云服务器如何登录?阿里云服务器的三种登录方法
购买阿里云ECS云服务器后如何登录?场景不同,阿里云优惠总结大概有三种登录方式: 登录到ECS云服务器控制台 在ECS云服务器控制台用户可以更改密码、更换系.
13884 0
阿里云ECS云服务器初始化设置教程方法
阿里云ECS云服务器初始化是指将云服务器系统恢复到最初状态的过程,阿里云的服务器初始化是通过更换系统盘来实现的,是免费的,阿里云百科网分享服务器初始化教程: 服务器初始化教程方法 本文的服务器初始化是指将ECS云服务器系统恢复到最初状态,服务器中的数据也会被清空,所以初始化之前一定要先备份好。
11889 0
阿里云ECS云服务器初始化设置教程方法
阿里云ECS云服务器初始化是指将云服务器系统恢复到最初状态的过程,阿里云的服务器初始化是通过更换系统盘来实现的,是免费的,阿里云百科网分享服务器初始化教程: 服务器初始化教程方法 本文的服务器初始化是指将ECS云服务器系统恢复到最初状态,服务器中的数据也会被清空,所以初始化之前一定要先备份好。
7365 0
阿里云服务器ECS登录用户名是什么?系统不同默认账号也不同
阿里云服务器Windows系统默认用户名administrator,Linux镜像服务器用户名root
4503 0
2450
文章
0
问答
来源圈子
更多
+ 订阅
文章排行榜
最热
最新
相关电子书
更多
《2021云上架构与运维峰会演讲合集》
立即下载
《零基础CSS入门教程》
立即下载
《零基础HTML入门教程》
立即下载