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'))

 

参考连接:

https://community.sap.com/t5/application-development-blog-posts/filtering-sap-api-data-based-on-date-or-time-fields/ba-p/13541242

 

 

版权声明:本文为YES开发框架网发布内容,转载请附上原文出处连接
张国生
上一篇:如何在进销存系统中进行账期管理和封账操作
下一篇:SAP公有云接口按照日期+时间增量查询数据
评论列表

发表评论

评论内容
昵称:

联系我们
联系电话:15090125178(微信同号)
电子邮箱:garson_zhang@163.com
站长微信二维码
微信二维码