cancel
Showing results for 
Search instead for 
Did you mean: 

problem while redirecting to url

Former Member
0 Kudos

Hi,

I have created Outbound Plug(named exit_plug) in Window of plug type - Exit.

also i've written code while firing this plug like below:

wd_this->fire_exit_plug(

url = 'http://www.sap.com'

).

But while running this WDA and firing this code, system is redirecting to the url as below:

http://www.google.com/?URL=http%3a%2f%2fwww%2egoogle%2ecom

the same url is being added as paramater.

I want to redirect it to simple http://www.google.com only.

How to achieve this?

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Create a UI Element "LinktoURL", which will be available in your webdynpro view elements.

It will be a hyperlink. In the text property of this element, give whatever text you want to display, say "Search". In the 'reference' property, set the actual URL, in your case http://www.google.com.

On clicking the link from your UI, the google webpage will open in a new window.

Regards,

Nithya

Former Member
0 Kudos

Thanks Nithya for your reply.

I have created one WDA will give tabular list of output. from this output I am selecting one entry for which I want to have further processing in another WDA.

So I have to pass several parameters with it, which should be available in subsequent WDA.

And that's why I have used exit plug of window in first WDA and passing the data of selected entry to another WDA. in this second WDA I am analysing the parameters through following code:

DATA:

wa_url TYPE LINE OF tihttpnvp,

int_url TYPE tihttpnvp.

wdevent->get_data(

EXPORTING

name = if_wd_application=>all_url_parameters

IMPORTING

value = int_url ).

by using this code I am getting my required data as well as the original url value also.

But i don't want to have the same url as parameter.

So please help me in this scenerio.

mohammed_anzys
Contributor
0 Kudos

Hi Haresh,

You cannot directly put URL like that , it will append only to the existing URL only.

Follow the code.

Data:lv_url TYPE string.

CALL METHOD cl_wd_utilities=>construct_wd_url

EXPORTING

application_name = 'Z_MYAPP'

IMPORTING

out_absolute_url = lv_url.

CONCATENATE lv_url

'?myparam=1&myparam=3'

INTO lv_url.

wd_this->fire_out_plg( url = lv_url ).

Hope this will solve your problem.

Thanks

Anzy

Award points if this solves your problem

mohammed_anzys
Contributor
0 Kudos

Hi Haresh,

I was able to reproduce the problem that you faced and the previous code snippet i had provided solves the issue.

Thanks

Anzy

Former Member
0 Kudos

Hi Anzy,

For me the problem is still as it was earlier.


  DATA:
    str_url TYPE string.

  CALL METHOD cl_wd_utilities=>construct_wd_url
    EXPORTING
      application_name = 'ZMATTER_ALL'
    IMPORTING
      out_absolute_url = str_url.

  CONCATENATE str_url '?sap-client=' sy-mandt '&sap-language=' sy-langu '&MODE=' item_mode_ind '&MATTER_DEF=' item_pspid
  INTO        str_url.

  wd_this->fire_call_matter_plg(
    url = str_url
  ).

while executing this the browser shows this url.

http://iwdf1149.wdf.sap.corp:8000/sap/bc/webdynpro/sap/zmatter_all?sap-client=220&sap-language=E&MOD...

So still it is appending the ur as parameters.

Is there any way?

mohammed_anzys
Contributor
0 Kudos

Hi haresh,

The problem is with your concatenate statement.You are appending the URL again to your base URL.

CONCATENATE ******str_url ***********'?sap-client=' sy-mandt '&sap-language=' sy-langu '&MODE=' item_mode_ind '&MATTER_DEF=' item_pspid

INTO str_url.

Correct it , it will work

Anzy

Award points if it solves your problem

Former Member
0 Kudos

Hi Anzy,

in concatenate statement first str_url is required as it builds the url for new WDA and for additional parameters only i have used concatenate statement.

Or you just simply use http://www.google.com string as url.

Message was edited by:

Khandal Haresh

mohammed_anzys
Contributor
0 Kudos

Hi Haresh,

Actually the code is working for me, i think the problem may be because of the URL parameters.The only problem with the exit plug is that , whatever URL you wanted to go will be appebnded as to the Server URL as a parameter.

The URL which you gave was

LINK = http://iwdf1149.wdf.sap.corp:8000/sap/bc/webdynpro/sap/zmatter_all?sap-client=220&sap-language=E&MOD...

I would like you to do the following steps.

So let us analyse your URL.The only thing that matters in your URL is the first part.

that is

Part 1.

http://iwdf1149.wdf.sap.corp:8000/sap/bc/webdynpro/sap/zmatter_all?sap-client=220&sap-language=E&MOD...

Please check this part is working alone.If it doesnt then its problem with your code and you need to analyse how you accept the URL parameters.

Part 2.

This is the second part of the URL,

&URL=http%3a%2f%2fiwdf1149%2ewdf%2esap%2ecorp%3a8000%2fsap%2fbc%2fwebdynpro%2fsap%2fzmatter_all%3fsap-client%3d220%26sap-language%3dE%26MODE%3dDISPLAY%26MATTER_DEF%3dC0000148000000

And from the URL , it is obvious that , the URL is going as a parameter to your application.In normal case it doesnt create a problem as your application will not recognise this part and will ignore this .But if it is creating any problems ,what you can do is , add one more parameter in your application name URL. and everything will fine.

Thanks

Anzy

1.

Former Member
0 Kudos

Hi Anzy,

Thanks again.

for me I am also getting the required result even if system appends the same url as parameter also..

But I just wanted to know why the same url where I am directing is appended as URL parameter. I 'll be thankful if you have any idea about it.

Thanks

mohammed_anzys
Contributor
0 Kudos

Hi Haresh,

In most of the cases , when we use the portal , we will getting the exit URL through the URL params and will be processing that further.I think thats the reason why , system sends the exit URL as a parameter so that the other application can close it.

Thanks and Regards

Anzy

Please award points and close the thread if this answers your question

Answers (2)

Answers (2)

mohammed_anzys
Contributor
0 Kudos

Hi haresh,

you could mention your URL in the SICF also...see the blog

/people/mohammed.anzys/blog/2007/06/05/how-to-close-parent-window-in-webdynpro-applications

Thanks

Anzy

Give points if this solves your problem.

Former Member
0 Kudos

Use a link to URL element to get this.

Former Member
0 Kudos

it will be helpful if you can elaborate more for URL element, as I have not used that ever.