Badhusha
Badhusha

Reputation: 128

Filtering based on abap timestamp fails

I have an Odata Service where there is a field for ABAP Timestamp in Edm.Decimal format. Now when I try to filter the data between a given time frame, it is failing with error ( 400 ).

Example: I tried to filter the data from 01-03-2022 to 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

[{"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.

Upvotes: 0

Views: 1061

Answers (2)

wanderlandderek
wanderlandderek

Reputation: 396

Why do you decide to use EDM.Decimal for a timestamp, the error simply states gateway can't handle the time using EDM.Decimal. Please change to use Edm.DateTime in your service definition and test again.

Regards, Derek

Upvotes: 1

alezhu
alezhu

Reputation: 484

In ABAP timestamp has 14 numbers: YYYYMMDDHHmmss

Or may be not enough 00 in first value:

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

2nd: 202203162359m => 2022.03.16 23:59m

Upvotes: 0

Related Questions