Hi experts,
I tried to test post data. But i got 400 (bad Request error)
| finish: function(oEvent) { |
| | |
| | |
| | |
| | |
| | |
| | //oData list | |
| | var oEntry = {}; |
| | oEntry.BUKRS = "5100"; |
| | oEntry.GJAHR = ""; |
| | oEntry.BNUMB = ""; |
| | oEntry.BELNR = ""; |
| | oEntry.TRNGB = ""; |
| | oEntry.UTYPE = "33"; | | |
| | oEntry.XBLNR = "TST15"; |
| | oEntry.LIFNR = "141706"; |
| | oEntry.NAME1 = "[141706 ]." ; |
| | oEntry.AKONT = "2150000"; // reconciliation account |
| | oEntry.AKONT_TXT = "[2150000 ]Other Account Payable"; |
| | oEntry.TEXTL = "Free for payment"; |
| | oEntry.ZTERM = "PF30"; // payment term |
| | oEntry.TEXT1_ZTERM = "[PF30]Pay on Friday in 30 Days after Invoice" ; |
| | oEntry.ZLSCH = "C"; // payment method |
| | oEntry.TEXT1_ZLSCH = "[C]Check - Payment" ; |
| | oEntry.ZFBDT = "11062015"; // payment blind date |
| | oEntry.NETDT = "11062015"; // payment date |
| | oEntry.BANKN = ""; // bank account |
| | oEntry.MWSKZ = ""; // tax code |
| | oEntry.BUDAT = "10012015"; |
| | oEntry.BLDAT = "10012015"; |
| | oEntry.WAERS = "USD"; // currency |
| | oEntry.REQID = "03101188"; |
| | oEntry.REQDT = "02052016"; |
| | oEntry.REQTM = "000000"; |
| | oEntry.SAKNR = "2150000"; // Account |
| | oEntry.SAKNR_T = "Other Account Payable"; |
| | oEntry.KOSTL = ""; // cost center |
| | oEntry.MWSKZ = ""; // tax code |
| | oEntry.DTAMT = ""; // debit amount |
| | oEntry.CRTAMT = "10.00"; // credit amount |
| | oEntry.KOSTL = "A0200"; |
| | oEntry.KOSTL_T = "IT" |
| | |
| | |
| | |
| | |
console.log(oEntry);
OData.request({
requestUri : "proxy/http/______________/sap/opu/odata/SAP/YPLAS_TEST_SRV/DOC_DET_HEADSet(BUKRS='5100',BNUMB='0000000018',GJAHR='2015')/?$expand=DOC_DET_ITEM1Set",
method : "GET",
headers : {
"X-Requested-With" : "XMLHttpRequest",
"Content-Type" : "application/atom+xml",
"DataServiceVersion" : "2.0",
"X-CSRF-Token" : "Fetch"
}
},
function(data, response) {
header_xcsrf_token = response.headers['x-csrf-token'];
var oHeaders = {
"x-csrf-token" : header_xcsrf_token,
'Accept' : 'application/json',
};
OData.request({
requestUri : "proxy/http/___________/sap/opu/odata/SAP/YPLAS_TEST_SRV/DOC_DET_HEADSet",
method : "POST",
headers : oHeaders,
data:oEntry
},
function(data,request) {
alert("Save data successfully");
location.reload(true);
}, function(err) {
alert("Save data failed");
});
}, function(err) {
var request = err.request;
var response = err.response;
alert("Error in Get -- Request " + request + " Response " + response);
});
errror
POST http://localhost:61672/helloworld/proxy/http/__________/sap/opu/odata/SAP/YPLAS_TEST_SRV/DOC_DET_HEADSet 400 (Bad Request)
help me..