on 08-24-2007 9:53 AM
hello,
I got another problem too.
I make a single Component_Usage and create a component to this component_usage.
anzulegende_comp_usage = wd_this->wd_cpuse_usage_z_itf_cid_a( ).
IF anzulegende_comp_usage->has_active_component( ) IS INITIAL.
anzulegende_comp_usage->create_component( COMPONENT_NAME = 'component_xyz' ).
ENDIF.
but after this I can´t access the name of my created component 'component_xyz' via my component_usage.
If I use a component_usage_group I can access the component-names but this should be possible with a single component_usage too. or am I wrong?
the solution could be to use the structure-type "wdapi_component_usage" but I want to know if this is possible with a single component_usage too?
Thanks Nithya I have tried your proposal now.
DATA: my_comp_usage_info type ref to if_wd_rr_component_usage,
name_used_component type string.
my_comp_usage_info = WD_COMP_CONTROLLER->COMPONENT_USAGE_A->get_component_usage_info( ).
name_used_component = my_comp_usage_info->get_name( ).
but the method get_name is unfortunately only returning the name of the component_usage and not the name of the created component to this component_usage...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thorsten.
You can use the following trick.
l_ref_cmp_usage TYPE REF TO if_wd_component_usage,
lr_usage type ref to cl_wdr_component_usage,
lr_component type ref to if_wd_component.
when you have the reference to the usage in l_re_cmp_usage just cast it to cl_wdr_component_usage and call get_child_component.
l_ref_cmp_usage = wd_this->wd_cpuse_soptions( ).
IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
l_ref_cmp_usage->create_component( ).
ENDIF.
lr_usage ?= l_ref_cmp_usage.
lr_component = lr_usage->get_child_component( ).
Then you have the used component and can use the component info to get the name.
Cheers,
Sascha
Hi Thorsten,
Did you try the method get_component_usage_info( ) in if_wd_component_usage? It returns a reference of if_wd_rr_component_usage. You could call get_name on that object to get the component name. I havent tried it, but looks like that is the solution to your problem.
Hope this helps.
Regards
Nithya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.