Skip to Content
0

webdynpro no active component error while using interface as used component

Mar 08, 2017 at 02:19 PM

15

avatar image

Hi experts,

  • WDC ZRDWD_COMP_MAIN

I have a WDC 'ZRDWD_COMP_MAIN' using a WDC 'ZRDWD_COMP_REUSE' as used component and an WDC-interface 'ZRDWD_IF_COMP' as interface. see Pictures blow.


  • WDC ZRDWD_COMP_REUSE

In WD-Component 'ZRDWD_COMP_REUSE' I use the WDC-Interface 'ZRDWD_IF_COMP' as reused component. See Pic below.

Method Z_TEST( )

  • WDC-Interface ZRDWD_IF_COMP

In WDC-Interface 'ZRDWD_IF_COMP' is an Interface-Method defined.

This Interface-Methode GET_COMMENT( )

is implemented in WDC 'ZRDWD_COMP_MAIN'.

  • The Coding logic is like following:

The main WDC call the method z_test( ) from its used WDC, this used WDC call the interface-Method get_comment( ) from the WDC-Interface.

ZRDWD_COMP_MAIN, ComponentController

ETHOD wddoinit .
  DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
  lo_cmp_usage =   wd_this->wd_cpuse_reuse( ).
  IF lo_cmp_usage->has_active_component( ) IS INITIAL.
    lo_cmp_usage->create_component( ).
  ENDIF.

  DATA lo_interfacecontroller TYPE REF TO ziwci_rdwd_comp_reuse .
  lo_interfacecontroller =   wd_this->wd_cpifc_reuse( ).
  lo_interfacecontroller->z_test(
  ).
ENDMETHOD.

ZRDWD_COMP_REUSE ComponentController

DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
    lo_cmp_usage->create_component( ). " Fehler interface kann nicht instanziiert werden
ENDIF.

DATA lo_interfacecontroller TYPE REF TO ziwci_rdwd_if_comp .
lo_interfacecontroller =   wd_this->wd_cpifc_dynamic_comp( ).
  lo_interfacecontroller->get_comment(
).
  • Problem

After running of WD-Application oth ZRDWD_COMP_Main it shows error that object is not active or interface cannot be instantiated.

  • Question

How can I access the WDC-Interface-Method which is used as reuse component of another reuse component?

Thanks,

Rujing

1.png (4.0 kB)
2.png (41.8 kB)
3.png (41.2 kB)
4.png (3.9 kB)
5.png (40.1 kB)
6.png (52.2 kB)
7.png (72.0 kB)
8.png (5.5 kB)
9.png (69.7 kB)
10.png (42.0 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Rujing Dai Mar 09, 2017 at 07:15 AM
0

Issue solved.

Share
10 |10000 characters needed characters left characters exceeded