cancel
Showing results for 
Search instead for 
Did you mean: 

Obtaining URL parameter values in view methods

Former Member
0 Kudos

Hello All,

I need to get the URL parameter values in the view methods . There is enough info on scn to get the URL parameters in the HANDLEDEFAULT of window but how to get that into the view.

I have to obtain the values , create and open a link using the obtained values.

Thanks in advance if someone could help.

Accepted Solutions (1)

Accepted Solutions (1)

amy_king
Active Contributor
0 Kudos

Hi Linda,

If you create a context node in your component controller, you can then map the node to the context of both the window and the view. Any attribute values you set in the node from the window's handledefault method will then be available in the context of the view (and the component controller).

Cheers,

Amy

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Linda Smith,

U can get the URL parameter in to any global attributes so that u can use them in any of the view.

Declare Varialbe gv_url_parameter in component controller under attributes tab.

gv_url_parameter     type String.

* Use this code.

  wd_comp_controller->gv_url_parameter =

    wdr_task=>client_window->if_wdr_client_info_object~get_parameter

( name = 'XXXXX' ).

where ever u want to use this variable u can call that by using wd_comp_controller->gv_url_parameter.

Thanks & Regards,

vasu Yadav

former_member217546
Participant
0 Kudos

Hi Smith,

Create an attribute in Component Controller check the public check box(visibility of the attribute) and populate it in handledefault method of the starting window of the application.

WD_COMP_CONTROLLER->attribute = parameter value.

You can access it in any view or window.

Thanks,

Sudheer

former_member206479
Participant
0 Kudos

Hi Smith,

For every URL parameter declare attributes in component controller which are similar to url parameter type and read every parameter from the url in WDDOINIT (hooker method) of component controller and assign it to corresponding attribute. For example you can write like below

wd_this->gv_wi_id (variable declared in attributes tab of component controller) =

    wdr_task=>client_window->if_wdr_client_info_object~get_parameter( name = 'WI_ID' ).(WI_ID is an url parameter).

You have to call this for other parameters too..... I hope this will help you.

Regards

Venkat

Former Member
0 Kudos

Thanks. That helped.

Now the current problem is i can not open the url string which is bigger than 325 characters. I dont know why, the string variable i am using within the view method is accepting only upto 325 characters .

i am firing the outbound plug of the window from the view to open the link in the same window and it only accepts string.

Any solution for this anyone. ?

Former Member
0 Kudos

Hi Smith,

Go through the below link to read the application parameters from the URL.

http://webdynproabap.wordpress.com/2012/07/10/application_parameter/

Best Regards,

Arun Krishnamoorthy

Former Member
0 Kudos

Hi Smith,

You can create attributes in component controller and pass from window to component controller. From there you can get into all views.

Please check this also.

http://scn.sap.com/thread/143112

http://wiki.sdn.sap.com/wiki/display/WDABAP/How+to+read+URL+parameters+in+Web+Dynpro+for+ABAP

Cheers,

Kris.