cancel
Showing results for 
Search instead for 
Did you mean: 

get name of current WD component and view

daniel_humberg
Contributor
0 Kudos

How can I get the name of the webdynpro-application and the name of the view that is currently shown?

(for example inside an event handler or inside WDINIT of the view)

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Daniel,

the following code inside WDDOINIT of the view will do it:

  • get application name

DATA lo_componentcontroller TYPE REF TO ig_componentcontroller .

DATA lo_api_componentcontroller TYPE REF TO if_wd_component.

DATA lo_application TYPE REF TO if_wd_application.

DATA lo_application_info TYPE REF TO if_wd_rr_application.

DATA lv_app_name TYPE string.

lo_componentcontroller = wd_this->get_componentcontroller_ctr( ).

lo_api_componentcontroller = lo_componentcontroller->wd_get_api( ).

lo_application = lo_api_componentcontroller->get_application( ).

lo_application_info = lo_application->get_application_info( ).

lv_app_name = lo_application_info->get_name( ).

  • get view name

DATA lo_api_main_view TYPE REF TO if_wd_view_controller.

DATA lo_view_info TYPE REF TO if_wd_rr_view.

DATA lv_view_name TYPE string.

lo_api_main_view = wd_this->wd_get_api( ).

lo_view_info = lo_api_main_view->get_view_info( ).

lv_view_name = lo_view_info->get_name( ).

Best Regards,

Anika

Answers (0)