on 02-20-2014 12:11 PM
Hello everyone!
I am currently developing an application in WebDynpro, which has a menu and it communicates with various components by fire plugs,
Nowadays to get the pointer which the user selects,
I read the value from the context, then call each component using a "Case" to determine which fireplug use.
Exp:
wda_comp case.
When Comp1
* Wd_this-> fire_to_comp1 ().
When Comp2
* Wd_this-> fire_to_comp2 ().
When COMP3
* Wd_this-> fire_to_comp3 ().
endcase.
My question is, if it is possible, having loaded the name of the fireplug (fire_to_comp1) in a DB table, get it and pass it as reference to wd_this-> and in this way make dynamic the call and not using the sentence "CASE".
Is there any other alternative?
Best regards
Nicolas.
Hi,
Yes, you can it dynamically .
Please refer the sample code
DATA lv_plug TYPE string.
DATA lv_dyn_method TYPE string.
lv_plug = 'TO_COMP1'. " this is the plug name stored in DB table
CONCATENATE 'FIRE_' lv_plug '_PLG' INTO lv_dyn_method.
CALL METHOD wd_this->(lv_dyn_method).
Note: Make sure that, the outbound plugs maintained in table exists in view
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
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.