cancel
Showing results for 
Search instead for 
Did you mean: 

Get complete url in BSP page

Former Member
0 Kudos

Hi all,

I need to extract the entire url of my application, I mean the external link of my bsp application.

For instance my url is

http://extranet.pippo.it:8010/sap(bD1pdCZjPTIwMA==)/bc/bsp/sap/zappl/page.htm

I have tried using RUNTIME attributes and methods such as

call method runtime->get_url

receiving url = url.

this allow me only to get the second part of the url =

sap(bD1pdCZjPTIwMA==)/bc/bsp/sap/zappl/page.htm

but I need also the first one

http://extranet.pippo.it:8010/

Is there a method, a function or something that can allow me to extract the enitre url?

Thanks in advance

Alessandro

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Alessandro,

Inside your IT00 BSP application you have an example, misc_echo.htm where you can find all HTTP headers. Maybe some of theses will be the one you need.

Regards.

GrahamRobbo
Active Contributor
0 Kudos

Hi Al,

this information is stored in the HTTP headers.

Create a BSP page with this layout.

<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:content design="design2003" >
  <htmlb:page title=" " >
    <htmlb:form>
    <%
  data: lt_fields type TIHTTPNVP.
  request->get_header_fields( changing fields = lt_fields ).
    %>
    <htmlb:tableView id    = "fields"
                     table = "<%= lt_fields %>" />
    </htmlb:form>
  </htmlb:page>
</htmlb:content>

You will see the parameters ~server_name_expanded and ~server_port_expanded contain the extra information you need to determine the URL entered by the client.

Cheers

Graham Robbo

Answers (3)

Answers (3)

Former Member
0 Kudos

not relevant to the question asked.

Edited by: Durairaj Athavan Raja (Moderator) on May 28, 2008 3:51 PM

Former Member
0 Kudos

Hi,

You can also try the following:

data: l_url type string,
      cl_runtime type ref to cl_bsp_runtime.
            
cl_runtime ?= runtime.
      
CALL METHOD cl_runtime->if_bsp_runtime~construct_bsp_url
  EXPORTING
    in_application = cl_runtime->if_bsp_runtime~application_name
    in_page        = cl_runtime->if_bsp_runtime~page_name
  IMPORTING
    out_abs_url    = l_url.

Regards,

Tanguy

Former Member
0 Kudos

Hi,

I don't know if there's a method or FM that gets the entire URL, but there are FMs HTTP_GET_URL2 and TH_GET_VIRT_HIST_DATA that may help you.

With those FM, you can get the protocol, host and port; that is the beginning of your BSP URL.

I hope this will help you.

Thomas.

Edited by: Thomas Villarubias on May 22, 2008 3:28 PM : orth.