Skip to Content
Author's profile photo Christian Buckowitz

Simple FPM message / confirmation box

For a simple message or confirmation box in an FPM application (akin to e.g. MessageBox in UI5), the needs confirmation mechanism of the framework provides a simple option. Next best I know of, would be to implement a full blown Dialog Box, there are nice community blogs for that.

This FPM mechanism is described in the docs: FPM Basics > FPM Event Loop > Triggering a Data-Loss Dialog Box in the FPM Event Loop. Beware that the doc sample is about a predifined data loss dialog or overriding that with a custom dialog.

In summary, the FPM event loop provides an option to pause the event processing, display a dialog and then abort or resume the event processing based on the user dialog input. This is exposed by additional interfaces for the GUIBB feeder classes. They are located in package APB_FPM_GUIBB, same as the feeder class interfaces, named like the corresponding feeder class interfaces + …_EXT:

  • IF_FPM_GUIBB_ATTR_FILTER_EXT
  • IF_FPM_GUIBB_CAROUSEL_EXT
  • IF_FPM_GUIBB_CHART_EXT
  • IF_FPM_GUIBB_FORM_EXT
  • IF_FPM_GUIBB_FORM_REPEATER_EXT
  • IF_FPM_GUIBB_LIST_EXT
  • IF_FPM_GUIBB_SEARCH_EXT
  • IF_FPM_GUIBB_TREE_EXT
  • IF_FPM_GUIBB_VISBIZ_EXT

The matching interface must be added to the corresponding feeder class e.g. IF_FPM_GUIBB_FORM_EXT to the form feeder class. The NEEDS_CONFIRMATION method is called in the event loop and you can intercept any event flying around in the loop. The method has an exporting parameter EO_CONFIRMATION_REQUEST. Just create an instance for it and pass the constructor the title, details and button texts. The framework pops up a message box and depending on the user input stops or continues the event processing.

HowTo “MessageBox”

  1. Choose a logically suitable GUIBB of your FPM application. This needs to be in the FPM event loop when you want to show the message box.
  2. Pick or choose an event to trigger the message box, e.g. an event on a button.
  3. Add and implement the …_EXT interface in the GUIBB’s feeder class, e.g. IF_FPM_GUIBB_FORM_EXT
  4. In the NEEDS_CONFIRMATION method, filter for your event and create the EO_CONFIRMATION_REQUEST parameter object and pass in your desired message, title and button texts. The approve button will proceed the event processing, the reject button will stop it.

The event loop pauses while the “message box” dialog is shown. Very nice to use for Are you really sure and know what you are doing? kind of confirmations…

  METHOD if_fpm_guibb_form_ext~needs_confirmation.

    CASE io_event->mv_event_id.

      WHEN io_event->gc_event_send. "filter the FPM event to show the message box for

        CREATE OBJECT eo_confirmation_request "the framework will render this as message box
          EXPORTING
            iv_window_title        = |Title for the message box window|
            it_confirmation_text   = VALUE #(
              ( |A string table with detail text to show in the window| )
              ( |Multiple lines supported in the message box window| )
            )
            iv_button_text_approve = |e.g. Save, will proceed the event processing|
            iv_button_text_reject  = |e.g. Cancel, will stop the event processing|.

    ENDCASE.

  ENDMETHOD.

Assigned Tags

      2 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Andrius Vinca
      Andrius Vinca

      You saved my day!

      Author's profile photo Bernhard Stockinger
      Bernhard Stockinger

      Hi Christian,

      I tried to resume the event when the "cancel" button is used describe in here but I get a short dump because the event loop is already running and therefore cannot be resumed. How it should be possible to not trigger a simple popup within the event loop?

      I just want a simple popup where I can react on the users choice and I don't want to abort the event. How do I even then can see the users choice - I know that PROCESS_EVENT is called for OK/Yes-Button and FAILED_EVENT for Cancel/No-Button - if e.g. I have to show multiple popups at the same time and/or they are dependent from each other?

      Someone has a good advise how to do this in a simple way without creating an own dialog box UIBB?

      Basically my root cause problem is that within an Dynpro-UI there are several popups displayed (like  with function module POPUP_TO_CONFIRM) which cannot be called within the web-UI because it is triggering a short dump. Therefore I have to re-build them at best in an easy way.

      Regards,

      Bernhard