-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathBatchErrorParsing
More file actions
17 lines (15 loc) · 1003 Bytes
/
BatchErrorParsing
File metadata and controls
17 lines (15 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
parse: function (oResponse) {
this._oMessagesModel = new JSONModel({});
if (typeof oResponse.__batchResponses !== undefined && oResponse.__batchResponses.length > 0) {
if (typeof oResponse.__batchResponses[0].__changeResponses !== undefined &&
oResponse.__batchResponses[0].__changeResponses.length > 0) {
if (typeof oResponse.__batchResponses[0].__changeResponses[0].headers !== undefined &&
oResponse.__batchResponses[0].__changeResponses[0].headers["sap-message"] !== undefined) {
this._oMessagesModel.setData(
JSON.parse(oResponse.__batchResponses[0].__changeResponses[0].headers["sap-message"]));
}
}
}
return this._oMessagesModel;
}
//Add messages to /iwbep/if_message_container in the gateway service (and setting one to be ' iv_is_leading_message')