on 09-10-2014 6:03 PM
Im trying to store some data to my created GW service which is bind to a RFC FM.
But i get a 500 internal error.
GET http://<host>:<port>/sap/opu/odata/sap/ZMOBILE_SRV_01/Protokolle?IvPspnrS=P-4433&IvPosidS=P-4433&IvTcode=SE13&IvBeschr=test&_=1410368050273 500 (Internal Server Error)
var oParameters= {
"IvPspnrJ" : "P-4433",
"IvPspidJ": "P-4433",
"IvPspnrS": "P-4433",
"IvPosidS": "P-4433",
"IvTcode": "SE13",
"IvBeschr": "test"
};
$.ajax({
url : "/sap/opu/odata/sap/ZMOBILE_SRV_01/Protokolle",
contentType : "application/json",
dataType : 'json',
data: oParameters,
success : function(data, textStatus, jqXHR) {
alert("success");
}
});
In the SAP Netweaver Gateway Client i can create these values so the service is running correctly. Is the call to the service wrong ?
My proceed was wrong i tried to use Ajax but im working with an OData service.
i have to use the OData model and its create function.
below is the new and working code:
var oModel = new sap.ui.model.odata.ODataModel("/sap/opu/odata/sap/ZMOBILE_SRV_01", false);
//sap.ui.getCore().setModel(oModel);
var oEntry = {};
oEntry.IvPspnrJ = "P-4433";
oEntry.IvPspidJ = "P-4433";
oEntry.IvPspnrS = "P-4433";
oEntry.IvPosidS = "P-4433";
oEntry.IvTcode = "SE19";
oEntry.IvBeschr = "Test";
//sap.ui.getCore().getModel().create('/Protokolle', oEntry, null, function(){
oModel.create('/Protokolle', oEntry, null, function(){
//sap.ui.getCore().getModel().refresh();
alert("Create ok");
},function(){
alert("Create failed");
}
);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.