Skip to Content
author's profile photo Former Member
Former Member

Access previous context after component usage creation


I have two WD components. One component's view is embedding a view from the other. In the main component I set some attributes in the component controller context. From the embedded view I try to call a method belonging to the component controller of the main component. If I want to be able to call this method I have to instantiate the component usage (otherwise I get a short dumb), something like the following code:

DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.

    lo_cmp_usage =   wd_this->wd_cpuse_usage_cockpit( ).
    IF lo_cmp_usage->has_active_component( ) IS INITIAL.
      lo_cmp_usage->create_component( ).

    DATA lo_ic_co TYPE REF TO ziwci_srm_wdc_ks_co .
    lo_ic_co =   wd_this->wd_cpifc_usage_cockpit( ).
    lo_ic_co->copy_proc( ).

But this code always creates a new component. The problem is that afterwards, when I am in the copy_proc() method, the context is empty!

I want to be able to access the context I set before. How can I achieve this, or what am I doing wrong?

Any help would be much appreciated!

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 Dec 13, 2011 at 02:58 PM

    Hi Torsten,

    I'm not very sure about your requirements, but it seems you have to call the method in the WDDOINIT of your view.



    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.