且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2022-09-12 21:45:44

When I added 6 individual filters in the configuration:

APF filter到底支持多复杂的条件And run it:

APF filter到底支持多复杂的条件APF filter到底支持多复杂的条件The 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:

APF filter到底支持多复杂的条件我找到了具体引起这个错误的ABAP code,一会给你说怎么定位:

APF filter到底支持多复杂的条件现在在看怎么避免这个error。你第一次添加step时能够正常工作,因为it_filter_select_options和iv_filter_string都是有值的:

APF filter到底支持多复杂的条件而添加第二个step时,it_filter_select_options不知为何为空了,所以框架检查出错:

APF filter到底支持多复杂的条件还需要继续看。第一个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传到后台框架去,所以引起了那个错误。

APF filter到底支持多复杂的条件APF filter到底支持多复杂的条件解析出错的原因

这个BILLINGDOCUMENTDATEYEAR出现在了一个内表里,expect的行为是不出现。还需要看。APF filter到底支持多复杂的条件比较两个step发送url有何差异,已经能看出原因了,蓝色的区域是第二个step新增加的url:

APF filter到底支持多复杂的条件之前的研究概括起来就是:在第一个step的chart上选中2016年那个节点,然后创建第二个step,此时给后台发送的url如下:

APF filter到底支持多复杂的条件这时选中的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.APF filter到底支持多复杂的条件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:

APF filter到底支持多复杂的条件APF filter到底支持多复杂的条件APF filter到底支持多复杂的条件APF filter到底支持多复杂的条件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.