Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

Purpose: Accessing Component Controller or Custom Controller in a context node class

The COMP_CONTROLLER is a protected variable. Using reference to Window Controller will access the component controller.

1) In the View Controller’s Implementation class (ZL_XXXXX_IMPL) create a public instance method Get_Window ( ).


method GET_WINDOW.

    rr_window = me->view_manager->get_window_controller( ).

endmethod.

2) In the Context Node Class (CNXX), create a public instance variable gv_owner of type view controller’s implementation class (ZL_XXXXX_IMPL).

3) In the Context Node Class (CNXX) redefine the method IF_BSP_MODEL~INIT if needed with this code.

method IF_BSP_MODEL~INIT.   
   gv_owner ?= owner.

endmethod.



4) Accessing the component controller in the method ON_NEW_FOCUS of the Context Node Class (CNXX)

method ON_NEW_FOCUS.


DATA:lr_window TYPE REF TO cl_XXXXX_window_impl, " Window Impl Class

     lr_comp   TYPE REF TO zl_XXXXX_bspwdcomponen_impl, " Component Controller Impl class

     lr_access TYPE REF TO if_bol_bo_property_access,

     lr_vc     TYPE REF TO zl_XXXXX_impl. " View Controller Impl class

    lr_vc      ?= gv_owner.

    lr_window  ?= lv_vc->get_window( ).

    lr_comp    ?= lr_window->m_parent.

    lr_access  ?= lr_comp->ztyped_context->gvproduct->collection_wrapper->get_current( ).

endmethod.

Thanks

Ram Vellanki

3 Comments
Labels in this area