cancel
Showing results for 
Search instead for 
Did you mean: 

Call a Fire plug dynamically

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi Rama thank you  for your reply, i ' didn't know that was so simple making the reference.

thank you very much.

Best regards

Nicolas.

ramakrishnappa
Active Contributor
0 Kudos

You are welcome

Answers (0)