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!
Showing results for 
Search instead for 
Did you mean: 
Former Member

There are two ways to access Component Controller or Custom Controller in a context node class.


1) In the View Controller’s Implementation class (ZL_XXXXX_IMPL) create a public instance attribute of type Component Controller’s IMPL class (ZL_XXXX_BSPWDCOMPONEN_IMPL).

2) Redefine the method WD_CREATE_CONTEXT of View Controller’s Implementation class 

   (ZL_XXXXX_IMPL) and add the below line of code.


   GV_COMP_CNTRL ?= me->comp_controller.

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

4) Redefine the method IF_BSP_MODEL~INIT of the Context Node Class (CNXX)

        method IF_BSP_MODEL~INIT.



      ID = id

      OWNER = owner.

  gv_owner ?= owner.


5) I will access the component controller in the method ON_NEW_FOCUS of the Context Node Class (CNXX)


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( ).

Approach-2: In my previous blog i explained this.

Labels in this area