SAP公有云接口按照日期+时间增量查询数据
客户同步接口:
https://****.s4hana.sapcloud.cn/sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartner?$filter=(LastChangeDate gt datetime'2024-07-30T00:00:00' or (LastChangeDate eq datetime'2024-07-30T00:00:00' and LastChangeTime ge time'PT14H00M00S'))&$select=BusinessPartner,BusinessPartnerFullName,CreationDate,CreationTime,LastChangeDate,LastChangeTime&$format=json
返回数据:
JavaScript 全选
{
"d": {
"results": [
{
"BusinessPartner": "6000000",
"BusinessPartnerFullName": "测试用客户(勿改)",
"CreationDate": "/Date(1720656000000)/",
"CreationTime": "PT19H15M10S",
"LastChangeDate": "/Date(1722297600000)/",
"LastChangeTime": "PT16H07M01S"
},
"BusinessPartner": "1310",
"BusinessPartnerFullName": "测试用户tset2",
"CreationDate": "/Date(1721260800000)/",
"CreationTime": "PT03H05M56S",
"LastChangeDate": "/Date(1722297600000)/",
"LastChangeTime": "PT17H37M56S"
}
]
}
}
说明,SAP接口返回数据中日期和时间分为两个字段展示了,因此$filter中 查询在 2024-07-30 14:00:00后修改的数据
(LastChangeDate gt datetime'2024-07-30T00:00:00' or (LastChangeDate eq datetime'2024-07-30T00:00:00' and LastChangeTime ge time'PT14H00M00S'))
参考连接:
版权声明:本文为YES开发框架网发布内容,转载请附上原文出处连接
post 张国生