cancel
Showing results for 
Search instead for 
Did you mean: 

IN ODATA, How to pass Timestamp data using POST method

Former Member
0 Kudos

Dear all

I am trying to insert a record into a HANA column store table using ODATA service.

POST URL

http://hanadrp.sial.com:8000/sial/sapnext/generic/odata/uidatetime.xsodata/UIDateTime

Message one

{

  "IDTXT" : "1",

  "IDDATETIME" : "2014-09-19 10:20:10"

}

Message Two

{

  "IDTXT" : "1",

  "IDDATETIME" : "/TO_TIMESTAMP(CURRENT_TIMESTAMP)/"

}

Both give me this message

<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<error

    xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">

    <code/>

    <message xml:lang="en-US">Syntax error at position 0.</message>

</error>

The table here has only two columns and the IDDATETIME is a column of time TIMESTAMP

Please advice

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Arvind,

Are you passing proper Authirization, content type and X-CSRF-Token during POST.

regards,

Shreyansh

Former Member
0 Kudos

Thanks Shreyansh to take time to reply

Here below is the preview of the message from the POSTMAN preview button

I really am not sure what is the X-CSRF token?

POST /sial/sapnext/generic/odata/uidatetime.xsodata/UIDateTime HTTP/1.1

Host: hanadrp.sial.com:8000

Authorization: Basic YXJhbWFjaGE6U3JpcmFtNjY=

Content-Type: application/json;charset=utf-8

Cache-Control: no-cache

{ "IDTXT" : "1", "IDDATETIME" : "2014-09-01T00:00:00" }