Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

get name of current WD component and view

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)

Former Member
replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question