Using the SAP Business Accelerator Hub ‘Try Out’ section I have failed to filter accountingdocuments using the ‘LastChangeDate’ property value. While filtering by text property values like ‘AccountingDocument’ works as expected.
Link to SAP to try out the API: https://api.sap.com/api/API_OPLACCTGDOCITEMCUBE_SRV/tryout
https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_OPLACCTGDOCITEMCUBE_SRV/A_OperationalAcctgDocItemCube?$top=50&$filter=AccountingDocument%20eq%20'100000032'&$inlinecount=allpages
The request above will return the response below. (The original response is a lot bigger, I have shortened it with only the important fields.)
{
"__metadata": {
"id": "https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_OPLACCTGDOCITEMCUBE_SRV/A_OperationalAcctgDocItemCube(CompanyCode='1010',FiscalYear='2015',AccountingDocument='100000032',AccountingDocumentItem='1')",
"uri": "https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_OPLACCTGDOCITEMCUBE_SRV/A_OperationalAcctgDocItemCube(CompanyCode='1010',FiscalYear='2015',AccountingDocument='100000032',AccountingDocumentItem='1')",
"type": "API_OPLACCTGDOCITEMCUBE_SRV.A_OperationalAcctgDocItemCubeType"
},
"CompanyCode": "1010",
"FiscalYear": "2015",
"AccountingDocument": "100000032",
"LastChangeDate": "/Date(1502841600000)/",
}```
As you can see the LastChangeDate of this AccountingDocument is '/Date(1502841600000)/'.
Using this data I assumed the following request would give me the response I am looking for.
https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_OPLACCTGDOCITEMCUBE_SRV/A_OperationalAcctgDocItemCube?$top=50&$filter=LastChangeDate%20eq%20’%2FDate(1502841600000)%2F’&$inlinecount=allpages
[This is the response I get, which is basically a 400 bad request.](https://i.sstatic.net/LRvSVpkd.png)
Is it possible to do what I am trying?
AFlow is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.