Skip to Content
author's profile photo Former Member
Former Member

Get complete url in BSP page

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 22, 2008 at 01:41 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • 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

  • author's profile photo Former Member
    Former Member
    Posted on May 22, 2008 at 01:27 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 23, 2008 at 01:50 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 28, 2008 at 12:49 PM

    not relevant to the question asked.

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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.