cancel
Showing results for 
Search instead for 
Did you mean: 

HOW to find the application name of webdynpro like SY-TCODE in ABAP???

0 Kudos

Like sy-tcode gives the transaction name in ABAP ...i want to know the application name in webdynpro or the transaction name in webdynpro.

Pleae help.

Thanks

Syed

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

You can get the WDA application name at runtime as follows.

Data lv_wd_app type string.

lv_wd_app = cl_wdr_task=>application->name

Hope this helps,

Regards,

Kiran

0 Kudos

Hi Kiran ,

Thanks for your reply, Actually my requirement is to find out wheather user is running application  through T-CODE or thrpough webdynpro application.

can u plz help me in this.

Thanks

Syed

former_member184578
Active Contributor
0 Kudos

Hi,

In both the cases, the Web Dynpro application is running in browser?

If not, you can get find if the application is running in SAP GUI by using the below code in DOINIT method of component controller:

DATA lr_api                       TYPE REF TO if_wd_component.

   DATA lr_application               TYPE REF TO if_wd_application.

* Get component API.

   lr_api = wd_this->wd_get_api( ).

* Get the application.

   lr_application = lr_api->get_application( ).

* Determine if called from SAP GUI.

   IF lr_application->get_client_environment( ) EQ

            if_wd_application=>co_client_environment-sapgui.

*   Web Dynpro was called from SAP GUI.

   ENDIF.




Regards,

Kiran


former_member197475
Active Contributor
0 Kudos

Hi Shehzad,

If you trying to see if the Application is running in WDA or T-Code, you can check it directly in portal.

For eg: If the application is running by T-Code, then you can find the server details at the right most corner in the portal.

BR,

RAM.

0 Kudos

Hi Kiran,

The above code is not working for me ....can you please help me by letting me know ...can i pass some data as parameters in T-CODE to identify the application is getting called from transaction....if yes than please give me steps here.

Thanks

Syed

0 Kudos


Thanks RAM for your reply, But i need to identify it inside code and not on portal.

former_member184578
Active Contributor
0 Kudos

Hi,

You can create a custom report and then construct the WDA application url using cl_wd_utilities=>construct_wd_url and then call the application.  Now create a T-CODE for this custom report instead of using WDYID.

Write the below code in your custom report.

*   Get Web Dynpro Appplication URL

      CALL METHOD cl_wd_utilities=>construct_wd_url

        EXPORTING

          application_name              = 'ZWD_COMP_NAME' " Application Name

        IMPORTING

          out_absolute_url              =  lv_url.

      CALL METHOD cl_http_server=>append_field_url

        EXPORTING

          name  = 'ISGUI'

          value =  'X'

        CHANGING

          url   = lv_url.

CALL METHOD cl_gui_frontend_services=>execute

        EXPORTING

          document               =  lv_url .

hope this helps,

Regards,

Kiran

0 Kudos


Hi Kiran,

Its not working for FPM OVP application but only for normal WD Application....can you please help me to understand how i can get the parameter in FPM OVP application.??? as the HAndle default method of window does not get the parameters as we are assigning FPM_WINDOW.

former_member184578
Active Contributor
0 Kudos

Hi,

For FPM, you can use if_fpm_parameter to read the url parameter.

Check the code in this thread: 

hope this helps,

Regards,

Kiran

Answers (2)

Answers (2)

martinborda
Explorer
0 Kudos

Instead of using:

lv_wd_app = cl_wdr_task=>application->name.

I believe it is better to use:

lv_wd_app = cl_wdr_task=>application_name.

As the former can lead to a short dump with runtime error OBJECTS_OBJREF_NOT_ASSIGNED, in case no webdynpro app is being run. In the second option, the class attribute is just blank.

Best regards,

Martín Borda

former_member186077
Active Participant
0 Kudos

Hi ,

Please use GET_CONFIGURATION_ID method instead of get_application.

lr_api->get_configuration_id.

Thanks and Regards,

Sriranjani Chimakurthy.