cancel
Showing results for 
Search instead for 
Did you mean: 

Used HANA XS to create a HANA DB and expose it via OData - unable to POST using Postman

scurry888
Participant
0 Kudos

I used HANA XS on SAP Cloud Platform Neo to create a HANA DB and expose it via OData - unable to POST using Postman. I get a 400 - Bad Request - "Syntax error at position 0."  (Using GET to retrieve records works fine.)

Here is the .xsodata file contents:

service{
    "com.******.jereclass::JeReclassHistory";
}

Here is the .xsaccess file contents:

{
    "exposed": true,
    "authentication": [{
        "method": "Form"
    }],

    "mime_mapping": [{
        "extension": "jpg",
        "mimetype": "image/jpeg"
    }],
    "force_ssl": false,
    "enable_etags": true,
    "prevent_xsrf": false,
    "anonymous_connection": null,
    "cors": [{
        "enabled": true,
        "allowMethods":["GET","POST"]
    }],
    "cache_control": "no-cache, no-store",
    "default_file": "index.html"
}

Here is the .hdbschema file contents:

schema_name = "JE_Reclass";

Here is the .hdbtable file contents:

table.schemaName = "JE_Reclass";
table.tableType  = COLUMNSTORE;
table.columns    = [
                    { name = "Department";  sqlType = VARCHAR; nullable = false; length = 20; },
                    { name = "MapName";     sqlType = VARCHAR; nullable = false; length = 30; },
                    { name = "FiscalYear";  sqlType = VARCHAR; nullable = false; length = 4;  },
                    { name = "Period";      sqlType = VARCHAR; nullable = false; length = 3;  },
                    { name = "RunID";       sqlType = VARCHAR; nullable = false; length = 30; },
                    { name = "PostingDate"; sqlType = DATE;    nullable = false; },
                    { name = "FromDate";    sqlType = DATE;    nullable = false; },
                    { name = "FromTime";    sqlType = TIME;    nullable = false; },
                    { name = "ToDate";      sqlType = DATE;    nullable = false; },
                    { name = "ToTime";      sqlType = TIME;    nullable = false; },    
                    { name = "CreateBy";    sqlType = VARCHAR; nullable = false; length = 12; },
                    { name = "CreateDate";  sqlType = DATE;    nullable = false; },
                    { name = "CreateTime";  sqlType = TIME;    nullable = false; }
                   ];
table.primaryKey.pkcolumns = ["Department", "MapName", "FiscalYear", "Period", "RunID"];

****Postman:****

POST /com/*******/jereclass/JeReclassHistorySvc.xsodata/JeReclassHistory HTTP/1.1
Host: jereclass******.us3.hana.ondemand.com
Content-Type: application/json
Authorization: Basic **************
User-Agent: PostmanRuntime/7.18.0
Accept: */*
Cache-Control: no-cache
Postman-Token: ***********************
Host: jereclass******.us3.hana.ondemand.com
Accept-Encoding: gzip, deflate
Content-Length: 456
Cookie: *****************************
Connection: keep-alive
cache-control: no-cache

{
    "Department": "Payroll",
    "MapName": "TEST JE RECLASS",
    "FiscalYear": "2013",
    "Period": "01",
    "RunID": "20130112134231-SCURRY",
    "PostingDate": "2013-01-12T00:00:00.0000000",
    "FromDate": "2013-01-01T00:00:00.0000000",
    "FromTime": "PT1H10M54S",
    "ToDate": "2013-01-12T00:00:00.0000000",
    "ToTime": "PT13H42M30S",
    "CreateBy": "SCURRY",
    "CreateDate": "2013-01-12T00:00:00.0000000",
    "CreateTime": "PT14H5M7S"
}

Accepted Solutions (1)

Accepted Solutions (1)

scurry888
Participant
0 Kudos

Using (for example) "PostingDate": "/Date(1405699200)/", where "1405699200" is the epoch date worked.

Answers (1)

Answers (1)

former_member132363
Active Contributor
0 Kudos

Here are some SAP resources you may review based on your topic "create | post | odata | postman | error | method | hana | cloud platform"

USING POSTMAN to test your i-Flow ? read data from a tab ...

Jan 15, 2019 ... The scenario You are required to develop an integration scenario (I-Flow) wherein dat. ... read this file and post the data in S/4 HANA Cloud, through the POST method ... To create the XML Schema for this input, you can use any free .... However, the tool does seem to present a problem while working with?...

https://blogs.sap.com/?p=531

2318897 - LMS ODATA Webservices Knowledge Support and Tips

LMS WEB Services : ODATA ?1.3 ODATA for SAP SuccessFactors Learning ... Common Errors. 3.1. Known Issues: KBA created for webservices LMS ... There is a lot more to it, as some of the other posts go into, but the upshot is .... Method is POST .... The planned Hana Cloud Interface Integration with SAP FICO will also be?...

https://apps.support.sap.com/sap/support/knowledge/public/en/2318897