cancel
Showing results for 
Search instead for 
Did you mean: 

Pass values to parameters through URL in Webdynpro and read them

0 Kudos

Hi,

Request for help on ABAP WEBDYNPRO URL with Parameter values.

My requirement is:

An email would be sent to the recipients with an unique URL. This URL contains carries certain parameter values.

Clicking on this URL must open my webdynpro application. I need to read the parameter values from this URL and tweak my logic accordingly inside the code.

Could anybody please let me know, :

1. How to set up parameters in webdynpro applications to capture the parameters from the link. Say for example, the URL contains MATNR and MJAHR, in order to read these values, how should the set up be on the webdynpro application.

2. How to read these values and apply the logic in the method HANDLEDEFAULT.

3. Since the URL also has to be created how do i additionally add the parameter to the webdynpro application URL.

Thanks,

Deepak.

Accepted Solutions (1)

Accepted Solutions (1)

nishantbansal91
Active Contributor

Hi Deepak,

Q :- How to set up parameters in webdynpro applications to capture the parameters from the link. Say for example, the URL contains MATNR and MJAHR, in order to read these values, how should the set up be on the webdynpro application.

Ans:- For this you have to define two importing parameter's in the handle default method of the calling window.

If you can define system automatic transfer the both element value in the importing parameter. But ensure that parameter defined in the URL must have same name.

2. How to read these values and apply the logic in the method HANDLEDEFAULT.

I think read logic i have already told you, create two attributes in the Component container and pass the importing value to the Global Container,

3. Since the URL also has to be created how do i additionally add the parameter to the webdynpro application URL.

You don't need to bother about the how URL is generated. When user click the LINK system automatic transfer the parameter to the handle default method.

Thanks

Nishant

0 Kudos

Thank you Nishant. This method works.

Answers (2)

Answers (2)

AbhishekSharma
Active Contributor
0 Kudos

Hi Deepak,

You can add parameters to URL as follows :

*   Get Web Dynpro Appplication URL

      CALL METHOD cl_wd_utilities=>construct_wd_url

        EXPORTING

          application_name              = '<Your App name>' " Application Name

        IMPORTING

          out_absolute_url              =  lv_url.

*    Append parameters and values to Web Dynpro Application URL

      lv_value = ls_sflight-carrid.                    " Your Parameter

    

CALL METHOD cl_http_server=>append_field_url

        EXPORTING

          name  = 'CARRID'

          value = lv_value

        CHANGING

          url   = lv_url.

Finally call WD app with parameters

*   Call Web Dynpro Application with URL parameters

      CALL METHOD cl_gui_frontend_services=>execute

        EXPORTING

          document               =  lv_url .

Hope this will help.

Thanks-

Abhishek

former_member184578
Active Contributor
0 Kudos

Hi,

You need to create the parameters for the HANDLEDEFAULT method or you could use get_data( ) method of wdevent to read all the url parameters.

And you can use method construct_wd_url of cl_wd_utilities to create Url and append parameters to the WDA application.

check the below document for reference which addresses all your queries:

hope this helps,

Regards,

Kiran