Skip to Content
0
Oct 16, 2019 at 06:35 AM

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

1790 Views

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"
}