cancel
Showing results for 
Search instead for 
Did you mean: 

Any way to check if a component exists?

Former Member
0 Kudos

I am dynamically inserting components into my main component.

The name of the component will be fetched from a config table.

Can we check if the component exists before we try to create it?

I mean something like : check_exists( name = <component_name> ) ?

I am not talking about the has_active_component( ) here. I just want to know if any component by that name exists in the workbench at all or not.

Thanks in adv.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

There are methods to get the name, meta info of components etc. But they can be called only from within the component. You can check out the methods of if_wd_rr_component, if_wd_component. All these can be called only from within components.

What exactly do you want to do? If you want to include components dynamically, you can create a component usage group, and add new usages of components dynamically. That will solve your problem I think.

Regards

Nithya

Former Member
0 Kudos

Thanks Nithya.

Actually as I said before, I'd get my component name from a config table.

So before i create the usage of the component dynamically, i want to check if any component by that name has been created at all or not.

Something like FM : FUNCTION_EXISTS.

Thanks again.

Former Member
0 Kudos

See table WDY_COMPONENT

CL_WDY_MD_COMPONENT=>check_existence

Cheers

Phil

Former Member
0 Kudos

Bingo! That's what I was looking for. Thanks Phil!

Answers (0)