cancel
Showing results for 
Search instead for 
Did you mean: 

Get URL Only from WD Component Application

Former Member
0 Kudos

Hallo,

is there any method or FM to get the URL of a WD Application only from WD Component Aplication or WD Component Configuration?

Thank you all

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

Use cl_wd_utilities=>construct_wd_url method and pass the WD component name which returns the WDA Application URL.

Regards,

Kiran

Former Member
0 Kudos

Hi Kiran,

i know this methode, but i dont have an Application name, i have only Application configuration,

i have create 2 application/Component configuration for 2  Standart WDA applications,

and now i want generate thise 2 appl configuration with my own configuration, i need a methode that gives the URL only from Application configuration and not application name.

i can give more explanation if needed

regars

Aga

former_member184578
Active Contributor
0 Kudos

Hi,

Try this code:


DATA : lr_api      TYPE REF TO if_wd_component,

          lr_app      TYPE REF TO if_wd_application,

          lr_app_info TYPE REF TO if_wd_rr_application,

          lv_app_name TYPE string,

          lv_url      TYPE string.

   lr_api = wd_comp_controller->wd_get_api( ).

   CALL METHOD lr_api->get_application

     RECEIVING

       result = lr_app.

   CALL METHOD lr_app->get_application_info

     RECEIVING

       result = lr_app_info.

   CALL METHOD lr_app_info->get_name

     RECEIVING

       result = lv_app_name.

   CALL METHOD cl_wd_utilities=>construct_wd_url

     EXPORTING

       application_name = lv_app_name

       in_protocol      = 'HTTPS'

     IMPORTING

       out_absolute_url = lv_url.

Hope this helps u,

Regards,

Kiran

Former Member
0 Kudos

Hi,

i will make it now easy to get a better answer.

i need a methode, that i can give an APPLICATION NAME    AND  THE APPLICATION CONFIGURATION and gives back the URL.

its very important, i have to give Application name and the application configuration.

Regars

Agadir

former_member184578
Active Contributor
0 Kudos

Hi,

You can concatenate the WDCONFIGURATIONID and the Configuration name to the URL. I don't think there is a public API method available for the same.

Jus write the above code, then concatenate URL 'WDCONFIGURATIONID=' configuration name to the URL.

Regards,

Kiran

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Agadir,

Parameters names can be passed based on our requirement. We can simply check that by creating an Application Configuration for the component and look out the URL which browser displays. Based on URL we can proceed to pass the Parameters to the Construct_wd_url method. I have given the code based on the url provided by the system and you can also check that.

Hope this could help you.

Regards,

Ravikiran.K

ramakrishnappa
Active Contributor
0 Kudos

Hi Agadir,

You can follow the code suggested by Ravi Kiran K but you need to some corrections as below


data : lt_parameters type TIHTTPNVP,

        ls_parametes  like LINE OF lt_parameters,

        lv_url type string.

       clear ls_parameters.

      clear lt_parameters.

  ls_parametes-name = 'WDCONFIGURATIONID'.

  ls_parametes-value = 'Zconfig_id'. " pass your configuration id here

  APPEND ls_parametes to lt_parameters.

cl_wd_utilities=>construct_wd_url(

   EXPORTING

     application_name              = 'ZWDA_TEST'  " Pass your application name

     in_parameters                 lt_parameters

     out_absolute_url              = lv_url

            ).

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

Hi Agadir,

Check out this code.

data : lt_parameters type TIHTTPNVP,

        ls_parametes  like LINE OF lt_parameters,

        lv_url type string.

  ls_parametes-name = 'configure_component'.

* ls_parametes-value = 'EN'.

  APPEND ls_parametes to lt_parameters.

  ls_parametes-name = 'COMP_NAME'.

  ls_parametes-value = 'MYTEST'.

  APPEND ls_parametes to lt_parameters.

  ls_parametes-name = 'CONFIG_ID'.

  ls_parametes-value = 'zApp_id'.

  APPEND ls_parametes to lt_parameters.

  ls_parametes-name = 'CONFIG_TYPE'.

  ls_parametes-value = '00'.

  APPEND ls_parametes to lt_parameters.

cl_wd_utilities=>construct_wd_url(

   EXPORTING

     application_name              = 'Test'

*    in_host                       =

*    in_port                       =

*    in_protocol                   =

     in_parameters                 lt_parameters

*    in_client                     =

*    in_forward_accessibility_flag =

*    namespace                     = 'sap'

*    in_server                     =

   IMPORTING

*    out_host                      =

*    out_port                      =

*    out_protocol                  =

*    out_local_url                 =

     out_absolute_url              = lv_url

            ).

WRITE lv_url.



output :

https://appserver:servernumber/sap/bc/webdynpro/sap/test?configure_component=&COMP_NAME=MYTEST&CONFI...

Former Member
0 Kudos

Hi AGADHIR,

you can use this method.....

cl_wd_utilities=>construct_wd_url(

EXPORTING

application_name =                                   ""WD APPLICATION NAME

*  in_parameters =

IMPORTING

out_absolute_url =       LV_URL                          ''''GET URL

).

regards

happy chourasia

Former Member
0 Kudos

Hi Happy,

i know this methode, but i dont have an Application name, i have only Application configuration,

i have create 2 application/Component configuration for 2  Standart WDA applications,

and now i want generate thise 2 appl configuration with my own configuration, i need a methode that gives the URL only from Application configuration and not application name.

i can give more explanation if needed

regars

Aga

Former Member
0 Kudos

i will make it now easy to get a better answer.

i need a methode, that i can give an APPLICATION NAME    AND  THE APPLICATION CONFIGURATION and gives back the URL.

its very important, i have to give Application name and the application configuration.

Regars

Agadir

Former Member
0 Kudos

hi Aga,

I dont know any other method but you can pass application name and application configuration id in

this method only,bcoz url 'll always be same and the application config. id is appended by this method..

you dont need to write append statement...

CL_WD_UTILITIES=>CONSTRUCT_WD_URL( EXPORTING

APPLICATION_NAME = APPL_NAME

  IN_PARAMETERS = T_PARAMETERS

iMPORTING

OUT_ABSOLUTE_URL = ABS_URL ).

Hope,this 'll help u ....

regards

happy chourasia