cancel
Showing results for 
Search instead for 
Did you mean: 

Opening a uRL

sid-desh
Advisor
Advisor
0 Kudos

Hi,

I have a BSP application which has some page attributes. Now when my BSP application gets loaded i want to call another URL in the same window. The URL will have some dynamic parameters built from these page attributes.

Please do let me how i can build the URL dynamically and also open that URL in the same window.

I am new to this technology so please guide me with this.

Regards

Sidharth

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

You can build the URL using

data lv_url type string.

call method runtime->get_url_same_session

exporting

application_url = '/sap/bc/bsp/sap/<BSP>/main.do'

receiving

url = lv_url.

Concatenate the parameters to the url using the format

any_url?attribute1=value1&attribute2=value2

Navigate from the Server side using

navigation->goto_page( url = lv_url ).

Retrieve the parameters from the request object in the target page.

Hope this helps

-Suresh

Message was edited by: Suresh Babu

sid-desh
Advisor
Advisor
0 Kudos

Hi Suresh,

Can you please tell me the class to which the navigate object belongs.

Regards

Sidharth

sid-desh
Advisor
Advisor
0 Kudos

Hi Suresh,

I found out the classes are i believe CL_BSP_RUNTIME and CL_BSP_NAVIGATION.

I have written this piece of code in the layout of page with flow logic. Please do let me know where i am going wrong.

This is my first application so please help me out here.

Regards

Sidharth

<i><%@page language="abap"%>

<%

data: navigation type ref to cl_bsp_navigation.

data: runt type ref to cl_bsp_runtime.

call method cl_bsp_runtime=>get_runtime_instance

receiving runtime = runt.

create object navigation

exporting runtime = runt.

call method navigation->goto_page( url = 'http://www.google.com' ).

%></i>

Former Member
0 Kudos

Are the page attributes dynamic ? I hope not. To build a dynamic URL, you can just use concatenate and build up a URL. You can get the URL from CL_BSP_NAVIGATION(the current url):

a) Change the page name

b) Put a ?fieldname=value

You can also check CL_BSP_UTILITY and there is a method serialize, which might be helpful.

In fact, if page attributes are not dynamic, you can set the page attributes using <b>navigation->set_parameter</b> and to <b>get the URL</b> of the current page , you can use the method <b>page->get_page_url</b>

You might also want to refer to the many weblogs written in BSP

https://www.sdn.sap.com/sdn/weblogs.sdn?blog=/weblogs/topic/24

Hope this helps.

Regards,

Subramanian V.

Message was edited by: Subramanian Venkateswaran

sid-desh
Advisor
Advisor
0 Kudos

Hi Subramanian,

As you can see from the code written above i dont want to navigate to another page in the same BSP application. i want to navigate to another site when the BSP applications loads itself.

So in the when the default.htm page is loaded i just want that in the same window instead of the page google homepage should appear

Regards

Sidharth

Former Member
0 Kudos

Then you can use the On Intialization event, and write navigation->goto('www.google.com').

Regards,

Subramanian V.

athavanraja
Active Contributor
0 Kudos

Or simply you can put the following in your layout.

for external site.

<meta http-equiv="Refresh" content="0;url=http://www.yahoo.com">

for some other page within the application.

<meta http-equiv="Refresh" content="0;url=somepage.htm">

Regards

Raja