Skip to Content
avatar image
Former Member

Getting client IP-address (working with Web Dispatcher !)

Hi all,

hopefully someone can help me here. Getting the client's IP-address from the http-request has been discussed here, however I have one specialty:

We are working with the SAP Web Dispatcher.!

Doing this the "request->get_header_field( '~remote_addr' )." returns always the IP-address of the Web-Dispatcher!

Anyone knows if there is a way to get the ip-address of the real "client" ??

Thanks in advance

Stefan Hester

Question was accidentally posted twice. Has been solved!

Message was edited by: Stefan Hester

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    May 14, 2008 at 01:38 PM


    I have exactly tghe same issue and i bvere found the soltion.

    Any tips forme ?

    Thanks a have a ncie day.


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member


      if anyone else is looking for a solution: Please add

       AppendHeader xforwardedfor %{REMOTE_ADDR} 

      to your webdisp action file.

      On the ABAP side you can access this field with


      On the java side you can access the client address with

      IPortalComponentRequest request;
      String clientAddress = request.getServletRequest().getHeader("xforwardedfor");
      if (clientAddress == null || clientAddress.equals("")) 
          //direct connection
          clientAddress = request.getServletRequest().getRemoteAddr();

      Older version of webdisp where using a profile parameter: wdisp/add_xforwardedfor_header


      Best Regards,

      Inga Andreasson