cancel
Showing results for 
Search instead for 
Did you mean: 

Access previous context after component usage creation

Former Member
0 Kudos

Hi,

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

    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!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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.

Regards,

Christian