无法按 SAP GatewayClient 中的多个字段进行过滤
Cannot filter by more than one field in SAP GatewayClient
这是 url 我试着打电话给:
/sap/opu/odata/sap/ZEITERFASSUNG_SRV/ArbeitszeitenSet?$filter=Pernr eq '00000141' and Datum='20120822'
字段存在,可过滤且写入正确。如果我从 URL 中删除日期部分,它就会工作。我得到的响应:
<?xml version="1.0" encoding="utf-8"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>005056A509B11EE1B9A8FEC11C21178E</code>
<message xml:lang="de">An Position 24 wurde ein ungültiger Token festgestellt</message>
<innererror xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<transactionid>7D84538F491C0080E00591BF48EADF30</transactionid>
<timestamp>20170607112124.9987340</timestamp>
<Error_Resolution>
<SAP_Transaction>Run transaction /IWFND/ERROR_LOG on SAP Gateway hub system (Sys
<SAP_Note>See SAP Note 1797736 for error analysis (https://service.sap.com/sap/s
</Error_Resolution>
</innererror>
</error>
我好像不能用 and
和 or
链接过滤器(两者都不起作用)。
我能够通过将值转换为 url 中的日期时间来解决问题。
/sap/opu/odata/sap/ZEITERFASSUNG_SRV/ArbeitszeitenSet?$filter=Pernr eq '00000141' and Datum eq datetime'2012-08-22T15:15:15'&$format=json
不知何故日期部分没有传输到后端,但没关系,因为不需要它。
这是 url 我试着打电话给:
/sap/opu/odata/sap/ZEITERFASSUNG_SRV/ArbeitszeitenSet?$filter=Pernr eq '00000141' and Datum='20120822'
字段存在,可过滤且写入正确。如果我从 URL 中删除日期部分,它就会工作。我得到的响应:
<?xml version="1.0" encoding="utf-8"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>005056A509B11EE1B9A8FEC11C21178E</code>
<message xml:lang="de">An Position 24 wurde ein ungültiger Token festgestellt</message>
<innererror xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<transactionid>7D84538F491C0080E00591BF48EADF30</transactionid>
<timestamp>20170607112124.9987340</timestamp>
<Error_Resolution>
<SAP_Transaction>Run transaction /IWFND/ERROR_LOG on SAP Gateway hub system (Sys
<SAP_Note>See SAP Note 1797736 for error analysis (https://service.sap.com/sap/s
</Error_Resolution>
</innererror>
</error>
我好像不能用 and
和 or
链接过滤器(两者都不起作用)。
我能够通过将值转换为 url 中的日期时间来解决问题。
/sap/opu/odata/sap/ZEITERFASSUNG_SRV/ArbeitszeitenSet?$filter=Pernr eq '00000141' and Datum eq datetime'2012-08-22T15:15:15'&$format=json
不知何故日期部分没有传输到后端,但没关系,因为不需要它。