cancel
Showing results for 
Search instead for 
Did you mean: 

Read URL Parameters programmatically

IanStubbings
Active Participant
0 Kudos

Hi

I wish to read the URL parameters in the WDDOINIT method of the component controller before the default plug is hit on the entry window and therefore the parameters are passed into the method automatically.

Is there a way this can be done programatically?

Basically I wish to replicate this WDJ method calll in WDA:

WDWebContextAdapter.getWebContextAdapter().getRequestParameter().

Cheers

Ian

Accepted Solutions (1)

Accepted Solutions (1)

IanStubbings
Active Participant
0 Kudos

Hi Gents

I've reopened the question as now I wish to use the code you kindly posted.

What type of variable is the lt_all_url_paramaters though? I am using 'ref to data' but I get a dumpm using this.

Cheers

Ian

mohammed_anzys
Contributor
0 Kudos

Hi

its of type , lt_all_url_param TYPE tihttpnvp,

it may be dumping since the WDEVENT is null...

Thanks

Anzy

IanStubbings
Active Participant
0 Kudos

Perfect!

Thanks Mohammed.

Answers (4)

Answers (4)

Former Member
0 Kudos

*Thanks for your replies gents, but the WDDOINIT method does not have WDEVENT parameter for me to read.*

*I got around it by moving the code to the entry window and calling the method on the comp controller with the parameters that were passed in automatically.*

BY

*Ian*

Hi Can any body tell me how to call Default startup method of window in component controller .

As I am having the same problem . I want to set url pyrometer in the context and then read the same context in

WDDoinit method of component controller . But sequence is like bellow

WDdoint component -> Wddoinit View -> Default startup method.

Hence I am not able to read the context variable in wddoinit which I set up in the satartup method of view.

Kindly let me know any wayout for this.

Thanks in advance

Abhay

Former Member
0 Kudos

I needed to read the parameters in the WDDOINIT of the view.

I found this code works

It also works in the WDDOINIT of the component controller

data lv_param type string.

lv_param = wdr_task=>client_window->get_parameter( 'i_parameter' ).

where i_parameter is the parameter on your URL

alejandro_bindi
Active Contributor
0 Kudos

Sorry to bring up this thread again but I have this exact same need (take HTTP parameters from Component controller's WDDOINIT instead of Window's default plug handler). Since Phil mentioned it was already requested to SAP and it can be done in WDJ I wonder if there are any plans to implement this in WDA?

Anyone knows?

Thanks!

Edited by: Alejandro Bindi on Oct 7, 2008 12:31 PM

Sorry Phil i've misreaded your post, you never mentioned this was requested to SAP...however this seems to be a common request right?

mohammed_anzys
Contributor
0 Kudos

hi,

If your problem is related to changing the number of parameters , then i think you can use the method in your inbound plug of your window.

wdevent->get_data( EXPORTING name = '_ALL_URL_PARAMETERS'

IMPORTING value = lt_all_url_param ).

the wdevent is a default parameter for the DEFAULT inbound plug....

Thanks

Anzy

Former Member
0 Kudos

wdevent->get_data( EXPORTING name = '_ALL_URL_PARAMETERS'

IMPORTING value = lt_all_url_param ).

Works in SP11

Do you know when "_all_URL_PARAMETERS" was added.

IanStubbings
Active Participant
0 Kudos

Thanks for your replies gents, but the WDDOINIT method does not have WDEVENT parameter for me to read.

I got around it by moving the code to the entry window and calling the method on the comp controller with the parameters that were passed in automatically.

Thanks anyway.

Ian

Former Member
0 Kudos

Hi Ian,

I am also looking for the same code of how to access url parameters in our WDA application. Can you please provide me details of your findings.

Thanks in advance.

Regards

Mukesh

Former Member
0 Kudos

Hi Ian,

I dont think this has been implemented yet.

A similar request was tabled last year.

You could use a BSP, save the URL in shared memory or persist it , then redirect to WDA.

Or

if you like a bit of fun...

Create sub class to CL_WDR_MAIN_TASK.

Stick this as the handler on the service in SICF. (this service only)

In the handle_request method, fish the URL out before it is processed by WDR framework.

Even better Why not try:

If you know what the parameters will be/could be, just add them to the INBOUND plug

as parameters. The WDR will set the variables for you.

Is the URL name value pair really contain dynamic, first known and runtime Names ?

Cheers

Phil.