Skip to Content
avatar image
Former Member

How to get HTTP headers from Data Provider Class?

Hi,

I'm the beginner in SAP NetWeaver Gateway. Using Service Builder I created CRUD OData web service and implemented CRUD operations in Data Provider Class. Data Provider Class has methods like MYENTITY_GET_ENTITYSET, MYENTITY_GET_ENTITY, MYENTITY_CREATE_ENTITY, MYENTITY_UPDATE_ENTITY. How can I get HTTP headers from the methods of this Data Provider Class?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    May 15, 2014 at 10:45 AM

    You can do so by using the following code in DPC

    Data :  Lo_facade type ref to /IWBEP/IF_MGW_DP_INT_FACADE.

    lo_facade     ?= /iwbep/if_mgw_conv_srv_runtime~get_dp_facade( ).

    lt_client_headers = lo_facade->get_request_header( ).



    Regards,

    Atanu

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Till NetWeaver Gateway 2.0 SP05 it is possible to retrieve the request headers in DPC with the mentioned code in SP06 its not.

      Do you know a different way?

      Regards

      Silvio


  • avatar image
    Former Member
    May 15, 2014 at 08:28 AM

    Hello Yauhen,

    Could you please explain your question more in detail ? Do you want information regarding what headers you need to pass for Create , Update , Delete & Get operations ? is this what you are expecting ?

    Regards,

    Ashwin

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Yauhen,

      do you have your users stored in SAP, or in some external system?

      If they are in SAP, after login to netweaver gateway, you can access sy-uname in the backend and make your filter logic of products there.

      Regards,

      Peter