on 01-22-2013 8:41 AM
Hi All,
I have a requirement where I need to invoke a method of one of the components from another method in another component dynamically at runtime. the challenge in this requirement is that the name of the component of whose method is to be called will also be known at runtime itself, so it makes me unable to create a component usage during development and need to find an alternative for the same to be taken care at runtime.
Please suggest and help, kind of in a desperate situation.
Thanks and Regards,
Abhishek.
Hi Abhishek,
Would something like the following work for your scenario? You would need first to declare all possible component usages in the properties tab.
CASE condition.
WHEN use_component_one.
lo_cmp_usage_componentone = wd_this->wd_cpuse_componentone( ).
IF lo_cmp_usage_componentone->has_active_component( ) IS INITIAL.
lo_cmp_usage_componentone->create_component( ).
ENDIF.
lo_componentone = wd_this->wd_cpifc_componentone( ).
lo_componentone->some_method( ).
WHEN use_component_two.
lo_cmp_usage_componenttwo = wd_this->wd_cpuse_componenttwo( ).
IF lo_cmp_usage_componenttwo->has_active_component( ) IS INITIAL.
lo_cmp_usage_componenttwo->create_component( ).
ENDIF.
lo_componenttwo = wd_this->wd_cpifc_componenttwo( ).
lo_componenttwo->some_other_method( ).
ENDCASE.
Cheers,
Amy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.