2

I have Custom message header code which is written in SAP ABAP where I was able to get the Custom message header in Gateway Client

enter image description here

I can see the Highlighted part of SAP Gateway Client but when I am calling the service from SAP UI5 application I do not find the Response Headers with my custom message.

enter image description here

Please help me, Thanks in Advance.

Srinivas Gadilli
  • 342
  • 6
  • 25

2 Answers2

1

I had a similar problem while performing an update using a JSONModel. If you add a custom header to your response, you may have to indicate this with the "Access-Control-Expose-Headers" header. Please see jQuery and AJAX response header for a more detailled explanation.

Something like the following should do :

response->set_header_field( name = 'Access-Control-Expose-Headers' value ='message' ).
PATRY Guillaume
  • 4,287
  • 1
  • 32
  • 41
0

Please create an OData model in the Manifest.JSON file and access the OData model in the controller and Call your service. Doing this you can find the Header message in the Response Headers. In the Controller, you can code this.getOwnerComponent().getModel("yourODataModelName used in Manifest").