简体   繁体   English

基于 abap 时间戳的过滤失败

[英]Filtering based on abap timestamp fails

I have an Odata Service where there is a field for ABAP Timestamp in Edm.Decimal format.我有一个 Odata 服务,其中有一个Edm.Decimal格式的 ABAP 时间戳字段。 Now when I try to filter the data between a given time frame, it is failing with error ( 400 ).现在,当我尝试过滤给定时间范围内的数据时,它失败并出现错误 ( 400 )。

Example: I tried to filter the data from 01-03-2022 to 16-03-2022.示例:我尝试过滤从 01-03-2022 到 16-03-2022 的数据。 Error: /odata/app/ZROOT_C?$skip=0&$top=20&$orderby=pickup_tstmp%20desc&$filter=pickup_tstmp%20ge%202022030100m%20and%20pickup_tstmp%20le%20202203162359m错误: /odata/app/ZROOT_C?$skip=0&$top=20&$orderby=pickup_tstmp%20desc&$filter=pickup_tstmp%20ge%202022030100m%20and%20pickup_tstmp%20le%20202203162359m

[{"code":"/IWBEP/CM_MGW_RT/010","message":"'Change the format for the date (2022030100) in the time specification'.","persistent":false,"targets":["/ZTMSCCROOT_C"],"type":"Error"},

Is there any format change need to be done, before filtering?在过滤之前是否需要更改格式?

Thanks in advance.提前致谢。

Why do you decide to use EDM.Decimal for a timestamp, the error simply states gateway can't handle the time using EDM.Decimal.你为什么决定使用 EDM.Decimal 作为时间戳,错误只是说明网关无法使用 EDM.Decimal 处理时间。 Please change to use Edm.DateTime in your service definition and test again.请更改为在您的服务定义中使用 Edm.DateTime 并再次测试。

Regards, Derek问候,德里克

In ABAP timestamp has 14 numbers: YYYYMMDDHHmmss在 ABAP 时间戳中有 14 个数字:YYYYMMDDHHmmss

Or may be not enough 00 in first value:或者第一个值可能不够 00:

1st: 2022030100m => 2022.03.01 00m <-???第一个:2022030100m => 2022.03.01 00m <-???

2nd: 202203162359m => 2022.03.16 23:59m第二名:202203162359m => 2022.03.16 23:59m

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM