Skip to Content

How to Access a Component Usage Context Node in Parent Component.

Hi Experts,

I have a requirement where i need to access context node used by component usage .

In particular i have Bt***h_srvo Component where customer_h is used by component usage.

how to access this context node of customer_h in SRVO Component ????

Is it Possible to add attribute dynamically as check-box to customer_h in Srvo Component

without inheriting Customer_h component ???

Thanks and Regards


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Mar 14, 2014 at 01:47 AM

    Hi, I managed to access the context node of a component usage in one of my projects with the code below.

    Unsure if this is the best way of doing it, but it seems to work.

    data lr_window type ref to cl_bsp_wd_controller.

    data lr_comp_controller type ref to <<COMPONENT CONTROLLER CLASS FROM YOUR COMPONENT USAGE>.

    "--- Get the interfaced window from your component usage...

    lr_window ?= me->get_subcontroller_by_viewname( iv_viewname = 'CU_YOUR_COMPONENT_USAGE.USED_COMPONENT/MainWindow' ).

    check lr_window is bound.

    "--- Get component controller from component usage

    lr_comp_controller ?= lr_window->m_parent.

    "--- Check component usage context node size...

    check lr_comp_controller->typed_context->parent->collection_wrapper->size( ) > 0.

    "--- Get something out of the context node...

    data(lv_id) = me->typed_context->your_context_node->collection_wrapper->get_current( )->get_property_as_string( iv_attr_name= 'ID' )

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.