cancel
Showing results for 
Search instead for 
Did you mean: 

view navigation

Former Member
0 Kudos

Hi,

I have 7 views embedded in a view container and use plugs to perform navigation. How can I get the view which is currently displayed?

Best regards,

ts

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

Try the below code:


DATA:lr_view_controller    type ref to        IF_WD_VIEW_CONTROLLER,

       lr_main_view_usage  type ref to        IF_WD_RR_VIEW_USAGE.

       lr_vc_assignment    type ref to        IF_WD_RR_VIEW_CNT_ASSIGNMENT.

       lr_view_usage       type ref to        IF_WD_RR_VIEW_USAGE.

       lr_t_views          type                WDRR_VCA_OBJECTS.

       lr_s_view           like line of        lr_t_views.

       lr_view             type ref to        if_wd_rr_view.

       lv_name             type              string.     

   

   lr_view_controller = wd_this->wd_get_api( ).

   lr_main_view_usage = lr_view_controller->GET_VIEW_USAGE( ).

   lr_t_views  = lr_main_view_usage->GET_VIEW_CNT_ASSIGNMENTS( ). "This will return all the View Container assignments.

* Now loop over all the View containers and get the reference of embedding view.

   loop at lr_t_views  into lr_s_view .

      lr_vc_assignment = lr_s_view-VIEW_CNT_ASSIGNMENT.

      lr_view_usage  = lr_vc_assignment->GET_DEFAULT_VIEW_USAGE( ). " This will return view usage reference

      lr_view = lr_view_usage->get_view( ). " This will have the meta info of view

*You can get the name of View as below

      lv_name = lr_view->get_name( ).  " Lv_name wil have the name of Embegging View

   endloop.

Hope this helps u,

Regards,

Kiran

Answers (1)

Answers (1)

Former Member
0 Kudos

try this.. 

Data lv_view_name TYPE string.
   DATA lo_controller TYPE REF TO if_wd_view_controller.
   DATA lo_view_info TYPE REF TO if_wd_rr_view.


   lo_controller = wd_this->wd_get_api( ).
   lo_view_info = lo_controller->get_view_info( ).


   IF lo_view_info IS BOUND.
    lv_view_name = lo_view_info->get_name( ).
   ENDIF.