cancel
Showing results for 
Search instead for 
Did you mean: 

How to get URL parameters?

former_member194142
Participant
0 Kudos

Hello,

I am trying to read the Portla URL link's parameters into my WDA's MAIN views WDDOINIT method. As we knew, we wil easily can read in DEFAULT plug of the WINDOW, but for some reason, i want to get them in the very 1st place it self i.e. MAIN view's WDDOINIT method. I found the below links, but they are not much useful for my requirements, pls. let me know is there any better/straight forward solution for it?

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

http://scn.sap.com/docs/DOC-2377

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

amy_king
Active Contributor
0 Kudos

If you know the name of the parameter you want to read, you could use...

  DATA lv_value TYPE string.
  lv_value = wdr_task=>client_window->get_parameter( 'parameter' ).

Can you explain in more detail why reading the parameters in the window's handledefault method won't work for your requirement?

  wdevent->get_data(
    exporting
      name =  if_wd_application=>all_url_parameters
    importing
      value = lt_parameters  ).

Cheers,

Amy

former_member194142
Participant
0 Kudos

DATA lv_value TYPE string.

  lv_value = wdr_task=>client_window->get_parameter( 'parameter' ).

Thank you, below your suggestion worked fo rme fine

I have 2 types of users for my WDA, they are

1st: Just they wil get into WDA by using lportal link_1, where in we dont hv any parameters, except sy-langu as English

2nd: They get into WDA by using link_2 of portal, in which link we have parameter as IV_MANAGER = X

Reason: As we know the MAIN views WDDOINIT method triggers upfront (if specified it as defalut view), here in this method i have block of code, that need to be triggered only if user access the WDA from by using link_1

Thank you

Answers (3)

Answers (3)

Former Member
0 Kudos

hi,,

If you are using FPM than try the code below, it will retrieve you the parameter values.You can use this wherever you want to retrieve.

Here 'PRODID' is the parameter name

data: lo_fpm type ref to if_fpm.

data lv_prodid type string.

lo_fpm = cl_fpm_factory=>get_instance( ).

lo_fpm->mo_app_parameter->get_value( exporting

   iv_key  = 'PRODID'

    importing ev_value = lv_prodid  ).

Regards,

Nishant

ashutosh_singh2
Explorer
0 Kudos

Hi,

  Try this method

CL_HTTP_SERVER=>IF_HTTP_SERVER~GET_LOCATION

in its importing parameter you will get HOST,PORT And PROTOCOL.

Thanks,

Ashutosh

former_member194142
Participant
0 Kudos

Any help pls

Thank you