3

I have an OData Service Created with SEGW. In my DPC_EXT class I want to modify the response headers.

in other words, before the entityset is returned I want to add my custom header to the response, so that the front-end can handle those custom headers.

I found only the lo_facade->get_request_header( ) method, but that didn't help me because those are the request headers.

How can I add a custom header to the HTTP response of my entityset?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Kevin Mueller
  • 628
  • 3
  • 10
  • 23

1 Answers1

2

I figured it out. One should add following code in the redefinition of entityset:

DATA: ls_header TYPE ihttpnvp.
ls_header-name = 'ZISM_WARN_MSG'.
ls_header-value = iv_message.
set_header( is_header = ls_header ).
Suncatcher
  • 10,355
  • 10
  • 52
  • 90
Kevin Mueller
  • 628
  • 3
  • 10
  • 23