cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass parameters through URL

Former Member
0 Kudos

Hi All,

Can any one tell me " How to Pass parameters through Web dynpro application URL ?"

Thanks In Advance

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sreelakshmi,

I think u can easily get value by reading WDWVENT PARAMETRS.

Also you can get value table by using following the same get_data method as follows

wdevent->get_data(

EXPORTING

name = '_ALL_URL_PARAMETERS'

IMPORTING

value = lt_url ).

Hope now u will get all ur parameters.

Nawal

Answers (7)

Answers (7)

anand_nidamanuru
Active Participant
0 Kudos

Hi Sreelakshmi,

The easiest way to do this is, first give the parameters to the application.

In the application goto Parameters tab and give the parameter and data type details

once provided, go to the window and plug handler mentioned in the application.

Give the same parameters as mentioned in the application as importing parameters.

Eg: Give user_id as parameter in application.

In the window handler also give the same parameter with the same data type.

Now you can access this in your code.

This will avoid reading the WDEVENT importing variable of the handler.

Thanks,

Anand

Former Member
0 Kudos

Hi Sreelakshmi,

If thats the case then may be you rum some other version of Netweaver.

Now you can try to get the value by using PARAMETERS attribute in

class CL_WD_CUSTOM_EVENT assigned to WDEVENT.

here also list of attributes are there.

Nawal

Former Member
0 Kudos

Hi Sreelakshmi,

please check the method which i have specified.

Here the WDEVENT is of type CL_WD_CUSTOM_EVENT.

Tell me if still problem occurs.

There must be a constant parameter ALL_URL_PARAMETERS type STRING in interface IF_WD_APPLICATION under attributes.

Nawal

Edited by: Nawal Kishor Mittal on Nov 26, 2009 6:08 PM

Former Member
0 Kudos

Hi Kishor,

I have given same name as u specified...."if_wd_application"...in that method, nothing is there in attribute tab.

In methods tab, it has 4 methods.

1) GET_APPLICATION_INFO

2) GET_IS_RTL

3) GET_IS_ACCESSIBLE

4) OPEN_HELP_CENTER

What i have to do?

Former Member
0 Kudos

Hi Sreelakshmi,

ALL_URL_PARAMETERS is not a method its attribute.

It returns a parametrs list in table.

Use it as it is it will work.

Nawal Kishor Mittal

Former Member
0 Kudos

Hi Kishor,

For me it is showing syntax error.

" Field "ALL_URL_PARAMETERS " is unknown.

Hi Priya,

I already checked in "IF_WD_APPLICATION" interface...in attributes tab, nothing is there...

Edited by: sreelakshmi.B on Nov 26, 2009 5:52 PM

Former Member
0 Kudos

Hi Sreelakshmi,

Kindly go through these steps:

1. Double click on your application name.

2. Read the Interface view name and Plug name.

3. Then Goto the window specified in Interface View.

4. In this window you will find 'HANDLE<plugname> method under methods tab.

There only you can read these parameters and use them as you want.

Regards,

Nawal Mittal

Former Member
0 Kudos

Hi Kishor,

But there is no "all_url_parameters" method in if_wd_application interface?

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

If you want to check it.

Go to se24 class/interface name:IF_WD_APPLICATION

Attributes tab you can find ALL_URL_PARAMETERS

Priya

Former Member
0 Kudos

Hi Sreelakshmi,

Construct the URL for WDA as belows:

DATA lt_param TYPE tihttpnvp.

DATA ls_param TYPE LINE OF tihttpnvp.

DATA lv_url TYPE string.

*Construct parameter List

ls_param-name = 'sap-client'.

ls_param-value = sy-mandt.

APPEND ls_param TO lt_param.

CLEAR ls_param.

ls_param-name = 'sap-language'.

ls_param-value = sy-langu.

APPEND ls_param TO lt_param.

CLEAR ls_param.

  • End of Parameter List

  • Construct URL for WDA_NAME and parameter list

CALL METHOD cl_wd_utilities=>construct_wd_url

EXPORTING

application_name = 'WDA_NAME' -


> Web Dynpro aaplication name

in_parameters = lt_param -


> Parameter List

IMPORTING

out_absolute_url = lv_url.

To read these parameters:

DATA lt_url TYPE tihttpnvp.

wdevent->get_data(

EXPORTING

name = if_wd_application=>all_url_parameters

IMPORTING

value = lt_url ).

here lt_url contains all the parameter list along with there value.

Hope this will solve all ur queries.

Former Member
0 Kudos

Hi Kishor,

I didn't fine any "wdevent" in my component contriller....?

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

If the method which you have created in the comp controller is of the method type event handler then you automatically get WDEVENT as the importing parameter.

Priya

anand_nidamanuru
Active Participant
0 Kudos

Hi Sreelakshmi,

Please check the below help

http://help.sap.com/saphelp_erp2005/helpdata/EN/7b/fb57412df8091de10000000a155106/content.htm

They have to be mentioned while creating the application and they will be available in Default handle parameters of the window the application calls.

It is also possible to use WD standard methods to retrieve the application parameters.

Thanks,

Anand

Former Member
0 Kudos

Hi Anand,

Actually, my requirement is to passing my own parameters .

For example , I have to pass userid as a parameter in URL and based on that user id the screen should be displayed in that

application.

Can you please help me...

Edited by: sreelakshmi.B on Nov 26, 2009 4:30 PM