无法在SAP GatewayClient中按多个字段进行过滤

时间:2017-06-07 11:27:05

标签: url filter odata sap

这是我试着打电话的网址:

/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&amp; or(两者都不起作用)。

1 个答案:

答案 0 :(得分:0)

我能够通过在我的网址中将值转换为datetime来解决问题。

/sap/opu/odata/sap/ZEITERFASSUNG_SRV/ArbeitszeitenSet?$filter=Pernr eq '00000141' and Datum eq datetime'2012-08-22T15:15:15'&$format=json

某种程度上,日期部分不会传输到后端,但这没关系,因为它不需要。

相关问题