Skip to Content
avatar image
Former Member

How to get value from one context node to another context node in different views

Hi gurus

I have the following problem.

I have 2 context nodes (context node1 and context node2) in views different. the context node1 is bound to the component controller.

I need get a data from context node1 in the getter_method of an attribute from context node2.

I know how to get a reference to the component controller,you can do it as follows.

lr_controller TYPE REF TO CL_BUD_BSPWDCOMPONEN_IMPL "Implementation class of the component controller

lr_controller ?= me->comp_controller.

but the Access to protected attribute "COMP_CONTROLLER" is not possible.

Can you help me telling me how do I read the data of the context node 1 from the method of the attribute in the context node 2

Regards,

Felipe Grajales

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 30, 2012 at 04:56 AM

    Dear Felipe,

      One of the step to access component controller form CNXX class is

               Create reference attribute of type component controller in CNXX class

               say GR_COCO type ref to (component controller )

               Then assign it in DO_PREPARE_OUTPUT.

                   me->typed_context->(NODE)->GR_COCO ?= me->comp_controller.

     

    Now you can read your Component controller form your getter or setter method.

    Thanks and Regards

    Rajarama U

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 30, 2012 at 01:08 AM

    Hi Felipe,

    is the value of context node that you want to get is from a model context node or value context node?

    if it is from a model context node, it may be able to be accessed from root and using bol relation

    you can go the root by using method get_root(). after that you can get access to its child using method get_related_entity( ).

    hopes it helps

    cheers

    eddhie kurnianto

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 30, 2012 at 05:09 AM

    HI Felipe ,

    Have a look at this thread http://scn.sap.com/thread/3194920.

    Regards,

    Nithish

    Add comment
    10|10000 characters needed characters exceeded