0

I am trying to validate an IBAN inside of a Wizard in SAPUI5. To do this, I use a functionImport on an V2 ODataModel (sap.ui.model.odata.v2.ODataModel).
The request comes back with a 202 status code but it actually failed. This 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--

(X'ed everything that is confidential) This is the result in the browser console: error message in console
So it has to be registered somewhere. The code where I registered the callback are the following:

this.SERVICE.functionImport("CheckIBAN", XXX.Constants.HTTP_POST, XXX, true, {
            fnSuccess: jQuery.proxy(function (oData) {
                fnCallback(oData);
            }, this),
            fnError: fnError
        });

Note that the functionImport function is just a wrapper for the sap.ui.model.odata.v2.ODataModel.callFunction and does the same.
No matter what I enter (a right or wrong input), it always calls the fnSuccess.
When I use the read function of the ODataModel (so just a simple GET-request) everything works just fine and it fires the fnError when an error occurs.

1 Answer 1

0

Your question dosen't contain a question "?"

I assume you ask why "error" is not called?

"error" is called if the http request fails. As you use batch, any error within a changesSet is not handled by this API... UI5 v2 is not a very elegant implementation....

see also: https://github.com/SAP/openui5/issues/1382#issuecomment-288723906

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.