IBAN validation within a SAPUI5 Wizard is causing some issues for me. I am utilizing a functionImport on a V2 ODataModel (sap.ui.model.odata.v2.ODataModel) to perform this validation.
Despite receiving a 202 status code, the request actually failed.
Here is the response from the Firefox Network tab:
--1D57E7CB0DD73AB15048B36CC96993D60
Content-Type: multipart/mixed; boundary=1D57E7CB0DD73AB15048B36CC96993D61
Content-Length: 1303
--1D57E7CB0DD73AB15048B36CC96993D61
Content-Type: application/http
Content-Length: 1134
content-transfer-encoding: binary
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 950
dataserviceversion: 1.0
cache-control: no-cache, no-store
pragma: no-cache
content-id: id-1687346500037-256
{"d":{"CheckIBAN":{"__metadata":{"type":"XXXX"},"AccountID":"XXXXXX","IBAN":"DEXXXX","BankID":"","WithInOutPayment":true,"SepaNotifText":"XXX"}}}
--1D57E7CB0DD73AB15048B36CC96993D61--
--1D57E7CB0DD73AB15048B36CC96993D60
Content-Type: application/http
Content-Length: 1111
content-transfer-encoding: binary
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=utf-8
Content-Length: 991
dataserviceversion: 1.0
{"error":{"code":"XXX/076","message":{"lang":"de","value":"XXX"},"innererror":{"application":{"component_id":"XXX","service_namespace":"XXX","service_id":"XXXX","service_version":"0001"},"transactionid":"XXX","timestamp":"XXX","Error_Resolution":{"SAP_Transaction":"XXX","SAP_Note":"XXXX"},"errordetails":[{"code":"XXX/076","message":"XXX","propertyref":"","severity":"error","target":""}]}}}
--1D57E7CB0DD73AB15048B36CC96993D60--
(Confidential information has been hidden)
The browser console displays the following result:
https://i.stack.imgur.com/Hko0l.png
It seems like registration of some sort is required.
Below is the code where the callback was registered:
this.SERVICE.functionImport("CheckIBAN", XXX.Constants.HTTP_POST, XXX, true, {
fnSuccess: jQuery.proxy(function (oData) {
fnCallback(oData);
}, this),
fnError: fnError
});
Keep in mind that the functionImport function acts as a wrapper for sap.ui.model.odata.v2.ODataModel.callFunction and performs the same task.
Irrespective of input (correct or incorrect), the fnSuccess is always triggered.
On the other hand, when using the read function of the ODataModel (simple GET request), everything works smoothly and triggers fnError upon encountering an error.