cancel
Showing results for 
Search instead for 
Did you mean: 

Checking that a Component implements a specific interface?

Former Member
0 Kudos

Dear Developers,

Is there a programmatic way to determine whether a component implements a specific interface?

How can I retreive the list of interfaces a component implements ?

Any idea?

Sincerely,

Olivier MATT

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Olivier,

After some debugging, found that you can get the implemented interfaces by using this code in the component controller. It should work from a view as well.

data: lr_comp type ref to if_wd_component,

lr_del_comp type ref to cl_wdr_delegating_component,

lr_comp_info type ref to if_wd_rr_component,

lt_interfaces type table of string.

lr_comp = wd_this->wd_get_api( ).

lr_del_comp ?= lr_comp->get_component( ).

CALL METHOD LR_DEL_COMP->IF_WD_COMPONENT~GET_COMPONENT_INFO

RECEIVING

COMPONENT_INFO = lr_comp_info.

CALL METHOD LR_COMP_INFO->GET_IMPLEMENTED_INTERFACES

RECEIVING

RESULT = lt_interfaces.

lt_interfaces is a string table that has the list of interfaces.

There seems to be a much simpler way with the method IF_WD_RR_COMPONENT=>GET_IMPL_INTERFACES_FOR_CMP by just passing the component name as a string. But I could not find an implementation for this.

Regards,

Nithya