cancel
Showing results for 
Search instead for 
Did you mean: 

FPM OIF set active (UIBB) tab

0 Kudos

Hi,

I have one FPM OIF application which is consuming several generic UIBBs (Form, List. etc). I have created two configuration variants. DISPLAY and CHANGE and setting desired VARIANT in the "SHARED_DATA" component which implements IF_FPM_OIF_CONF_EXIT like this:

METHOD override_event_oif .
  CASE io_oif->mo_event->mv_event_id.
    WHEN if_fpm_constants=>gc_event-start.
      io_oif->set_variant( 'DISPLAY' ).
    WHEN if_fpm_constants=>gc_event-save.
      io_oif->set_variant( 'DISPLAY' ).
    WHEN if_fpm_constants=>gc_event-edit.
      io_oif->set_variant( 'CHANGE' ).
  ENDCASE.
ENDMETHOD.

Scenario:

In DISPLAY mode user selects TAB "B" . After switch to CHANGE mode becomes TAB "A" active.

PROBLEM DESCRIPTION:

After each VARIANT switch always the last selected TAB of every single Variant becomes active which is confusing for user, which is in DISPLAY mode in TAB "B" and wants to continue changing data on the same TAB switching to CHANGE mode.

I can read current VARIANT, MAINVIEW, SUBVIEW within override_event_oif like this:

DATA l_state TYPE if_fpm_oif=>ty_s_state.
  io_oif->get_current_state( IMPORTING es_current_state = l_state ).

BUT I CAN NOT FIND OUT, how to set those values back to the FPM framework.

Thank you in advance for your proposals.

Kamil

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Yes... this works. Thank you!

Edited by: Kamil Hasek on Nov 2, 2009 11:17 AM

Former Member
0 Kudos

Hi kamil,

Whr we have to paste the code

Mézi
Associate
Associate
0 Kudos

Hi Kamil,

Before you set the variant, you have to save the actual tab to a global variable. After it the other variant will be used, then you have to raise an FPM event (cl_fpm_event=>gc_event_view_switch = "FPM_VIEW_SWITCH"), where you can set again the saved tab.


      DATA:
          lo_event_params   TYPE REF TO if_fpm_parameter,
          lr_event          TYPE REF TO cl_fpm_event,
          lo_fpm            TYPE REF TO if_fpm.

      CREATE OBJECT lo_event_params TYPE cl_fpm_parameter.
      lo_event_params->set_value(
        EXPORTING
          iv_key = if_fpm_constants=>gc_event_param-view_id
          iv_value = 'YOUR_SAVED_MAINVIEW_ID' ).
      lo_event_params->set_value(
        EXPORTING
          iv_key = if_fpm_constants=>gc_event_param-subview_id
          iv_value = 'YOUR_SAVED_SUBVIEW_ID' ).

      CREATE OBJECT lr_event
        EXPORTING
          iv_event_id   = cl_fpm_event=>gc_event_view_switch
          io_event_data = lo_event_params.

      lo_fpm = cl_fpm_factory=>get_instance( ).
      lo_fpm->raise_event( lr_event ).

This is the trick! I hope it will help you.

Best regards,

Andrá

Former Member
0 Kudos

Thank you Andra .