Skip to Content
1
Nov 28, 2019 at 07:40 AM

OData V2 SubmitChanges error call back not working

1541 Views

Hello,

I have implemented OData batch processing and have the following problem.

Even though a business exception is raised in the back end, error call back never gets triggered.

(I found it triggerred only when there's a connection error)

My back-end code for raising exception

if sy-subrc <> 0.
  io_message_container->add_message_from_bapi(
    exporting
      it_bapi_messages = lt_return
      iv_add_to_response_header = abap_true
  )
  raise exception type /iwbep/cx_mgw_busi_excetion
    exporting
      message_container = io_message_container.
endif.

Front-end code for calling submitChanges

oModel.submitChanges({
	success: function(oRes) {
		//some code;
	},
	error : function (oErr){
		//some code;
	},
	groupId: sBatchGroup
});

When a exception is raised, I can see error message in console, but error call back is not triggered.

error.png

I've read below threads regarding this issue, but haven't got the solution yet.

https://answers.sap.com/questions/12184545/submitchanges-error-callback-not-working-in-versio.html

https://answers.sap.com/questions/12269639/odata-submitchanges-error-handling.html#

What I need to do is to show a message popover with messages returned from server.

It seems that messages are not coming to message popover unless OData request failes...

Regards,

Mio

Attachments

error.png (47.4 kB)