cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger event/pass data from freestyle UIBB to GUIBB feeder class- Problem

Former Member
0 Kudos

Hi Experts,

I have an application which has 3 UIBBs. Out of them one is a freestyle UIBB or in other words a web dynpro component window embedded, the rest 2 are GUIBBs ( list UIBBs ).

Now, in that web dynpro component( Lets say component A ) I have a button called "Search". The expectation is that , on click of that button I will have to search for materials and show them in one of the other UIBBs( a list UIBB).

Now,I need to trigger the FPM event loop to reach the feeder class of the list UIBB.  When I click on that Search button, it triggers a local event inside compoennt A, so the control does not go outside to other UIBBs.

How can I make this work? Call process_event from the local event handler method in component A? If yes, how?

Any better ideas will be very much appreciated.

Many thanks,

Saikat

Accepted Solutions (1)

Accepted Solutions (1)

jens_boeckenhauer
Active Participant
0 Kudos

Hi Saikat,

in the WD action handler, call the following:

CL_FPM_FACTORY=>GET_INSTANCE( )->RAISE_EVENT_BY_ID( 'SAIKAT_SEARCH' ).

This triggers the FPM event loop.

Regards, Jens

Answers (2)

Answers (2)

AbhishekSharma
Active Contributor
0 Kudos

Hi Saikat,

You just need to raise an event and most Important you need to Handle that event back in one of the Method ex GET_DATA, PROCESS_EVENT.

You can do this as follows:

Say on click of Search Button you raised one event:

DATA: lo_fpm          TYPE REF TO if_fpm,

         lo_event_param  TYPE REF TO cl_fpm_parameter.


FIELD-SYMBOLS: <fs_par> TYPE s_parameter,

                  <fs>     TYPE any.

   lo_fpm = cl_fpm_factory=>get_instance( ).


*--> Set parameter values if you want to pass


lo_event_param->if_fpm_parameter~set_value(

         iv_key   = <your key>

         iv_value = <your value>

       ).


*--> If you want to pass multiple parameters then add all parameters in an Internal table

     LOOP AT <your param table> ASSIGNING <fs_par>.

       ASSIGN <fs_par>-value->* TO <fs>.

       lo_event_param->if_fpm_parameter~set_value(

         iv_key   = <fs_par>-key

         iv_value = <fs>

       ).

     ENDLOOP.


*--> Finally raise event

    lo_fpm->raise_event_by_id(

        iv_event_id = <your event ID>

        io_event_data = lo_event_param

      ).


After Raising the event you need to Handle that event in any of the method feasible to you (PROCESS_EVENT) with the same name <your event ID>.



This can be done as below :

CASE io_event->mv_event_id.

        WHEN <your event ID>.

        <your all code will go here>

ENDCASE.




Hope this will help.


Thanks-

Abhishek




ulrich_miller
Active Participant
0 Kudos

Hi Saikat,
in the freestyle UIBB once the search button is pressed, just raise an FPM event.

data: lo_event type ref to cl_fpm_event.

lo_event = CL_FPM_EVENT=>CREATE_BY_ID( iv_event_id = 'MY_SEARCH_EVENT' ).
" optional: add some event parameters if required
lo_event->IO_EVENT_DATA~IF_FPM_PARAMETER->SET_VALUE( ... ).

" now raise the event
CL_FPM_FACTORY=>GET_INSTANCE( )->RAISE_EVENT( lo_event ).

Kind regards,
Ulrich