cancel
Showing results for 
Search instead for 
Did you mean: 

How to modify OData payload date from this //\/Date(1708041600000)\/ to "20240217" in sap SEGW.

rakesh_mb
Explorer
0 Kudos

Hi masters , 

i have created a OData v2 project from SEGW (1809 ), which has only two fields Kunnr and TransDate.

Kunnr data type is kunnr & TransDare data type DATUM in structure/Table.

Kunnr data type is EDmString & TransDare data type Edm.DateTime in segw with ref to structure.

now i want to craete new record from the OData service using postman.

when i try to pass my preload along with csrf key.

it throughs an error like Conversion error for property 'TransDate' at offset '57' 

{
    "Kunnr" : "1900097",
    "TransDate" : "20240217"
}
But when i pass below payload  data get created but requriment is to pass date like "20240217" its mandatory formate without any compromise.
{
    "Kunnr" : "1900097",
    "TransDate" : "\/Date(1708041600000)\/"
}
How do i acheive this please help me out.
 
Sandra_Rossi
Active Contributor
0 Kudos
You don't pass "20240217", you pass the encoded value corresponding to 20240217. https://www.odata.org/documentation/odata-version-2-0/json-format/ Edm.DateTime: "/Date(<ticks>["+" | "-" <offset>)/"<ticks> = number of milliseconds since midnight Jan 1, 1970<offset> = number of minutes to add or subtract"

Accepted Solutions (0)

Answers (1)

Answers (1)

rakesh_mb
Explorer
0 Kudos

@Sandra_Rossi but the client requirement date format is "20240217"  and I have to accept the same from the payload and save it in the Date format in the table.