Skip to Content
0

The request should be a valid top-level resource object

Feb 06 at 01:30 PM

56

avatar image
Former Member

Hi,

I`m trying to create a record using th ODataModel Create mathod but I'm getting the following error:

"Error processing request stream. The request should be a valid top-level resource object"

Here's my code.

var oModel = new sap.ui.model.odata.v2.ODataModel("/OdataExposed/SP_THRESHOLDS_SPORTS.xsodata/", {
			user : "SYSTEM",
			password : "########",
			withCredentials : true
		});

model.create("/SP_THRESHOLDS_SPORTS",obj);
/*
here is the content of obj
{ID : 10
DATA_TYPE:"DATE",
DESCRIPTION:""NOTES:"",
SLIDE_SIELD:"",
SMARTABASE_FIELD_NAME:"",
SMARTABASE_FORM:"",
THRESHOLD_LOWER_LIMIT:"",
THRESHOLD_UPPER_LIMIT:""
}
*/

//Heres is my table definition in hana

CREATE COLUMN TABLE "SPORTS"."SP_THRESHOLDS_SPORTS" (ID bigint not null primary key generated by default as IDENTITY,
	 "SLIDE_SIELD" NVARCHAR(81),
	 "SMARTABASE_FORM" NVARCHAR(23),
	 "SMARTABASE_FIELD_NAME" NVARCHAR(44),
	 "DESCRIPTION" NVARCHAR(20),
	 "NOTES" NVARCHAR(318),
	 "DATA_TYPE" NVARCHAR(10),
	 "THRESHOLD_LOWER_LIMIT" NVARCHAR(11),
	 "THRESHOLD_UPPER_LIMIT" NVARCHAR(11),
	 "ADDITIONAL_POSSIBILITIES" NVARCHAR(28)) UNLOAD PRIORITY 5 AUTO MERGE 

//Heres is my xodata definition in hana

service {
"SPORTS"."SP_THRESHOLDS_SPORTS" as "SP_THRESHOLDS_SPORTS"; 
}
Can you please help me?
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers