End users usually prefer to have a reference of an error message to the corresponding input field. In addition they want to navigate into the field when clicking on the message, no matter if the corresponding panel or tab is currently collapsed or closed.

Since our customers frequently asked for that feature, we now provide this (out of the box for OVP, OIF, GAF and  Tabbed UIBB) with SAP NetWeaver 750 SAP_UI SP2. The features is available (of course) for the old and new design of the Message Area.

All messages that are reported with a field reference (importing parameters IO_ELEMENT, IV_ATTRIBUTE_NAME or IT_ATTRIBUTES)  using interface IF_FPM_MESSAGE_MANAGER, are now rendered with a link that leads you into the corresponding input field.

You can see how this works in OVP application FPM_TEST_MESSAGE_NAVIGATE, see the Figure below. Mind that Web Dynpro application parameter WDSETFOCUSONMESSAGEAREA should be disabled, see also SAP Note 2317280.

This test application consists of a panel stack with several UIBBs (Form, Form Repeater, Tree, List, Composite UIBB, Freestyle). By clicking on the different messages you can navigate into the corresponding field, even though the assigned Panel is currently collapsed.

Figure1.png

Figure 1: Message with reference to an input field in a Form UIBB

Technically the navigation to the input field is indicated with FPM event FPM_MESSAGE_NAVIGATE, So for Freestyle UIBBs you can still fine tune the focus handling based on the available event parameters.


This improvement may replace application related coding on basis of the importing parameters IS_ENABLE_MESSAGE_NAVIGATION, IR_MESSAGE_USER_DATA and FPM event ON_NAVIGATE, see the SAP Help Documentation. This feature was introduced with SAP NetWeaver 7.31. For SAP NetWeaver 7.02 you have to implement SAP Note 2314215.


For the above OVP application FPM_TEST_MESSAGE_NAVIGATE the previous behavior can be simulated with URL Parameter IS_DONE_BY_APPCC=X. An application development controlled switch to the OVP Panel then may look like this. Of course, this will be still supported also in SAP NetWeaver 7.50 😉



METHOD override_event_ovp .
   DATA lv_msg_id TYPE string.
   DATA lo_message_manager TYPE REF TO if_wd_message_manager.
   DATA ls_message TYPE if_wd_message_manager=>ty_s_message.
   DATA ls_uibb TYPE if_fpm_ovp=>ty_s_uibb.
   DATA lt_uibb TYPE if_fpm_ovp=>ty_t_uibb.
   CASE io_ovp->get_event( )->mv_event_id.
     WHEN 'ON_NAVIGATE'.
       io_ovp->get_event( )->mo_event_data->get_value( EXPORTING iv_key   = 'MESSAGE_ID' IMPORTING ev_value = lv_msg_id ).
       lo_message_manager = wd_this->wd_get_api( )->get_message_manager( ).
       ls_message = lo_message_manager->get_message_for_id( lv_msg_id ).
       CHECK ls_message-element IS BOUND.
       DATA(ls_config_key) = ls_message-element->get_node( )->get_node_info( )->get_controller( )->get_component( )->get_configuration_key( ).
       TRY.
           io_ovp->get_uibbs( IMPORTING et_uibb = lt_uibb ).
           READ TABLE lt_uibb INTO ls_uibb WITH KEY config_id = ls_config_key-config_id.
           IF sy-subrc NE 0.
             DATA(lv_comp_name) = ls_message-element->get_node( )->get_node_info( )->get_controller( )->get_component( )->get_component_info( )->get_name( ).
             READ TABLE lt_uibb INTO ls_uibb WITH KEY component = lv_comp_name.
             CHECK sy-subrc EQ 0.
           ENDIF.
           ls_uibb-collapsed = abap_false.
           ls_uibb-default_in_stack = abap_true.
           io_ovp->change_uibb( is_uibb = ls_uibb ).
           lo_message_manager->remove_message( lv_msg_id ).
         CATCH cx_fpm_floorplan.
           ASSERT 1 EQ 0.
       ENDTRY.
   ENDCASE.
ENDMETHOD.


To report this post you need to login first.

6 Comments

You must be Logged on to comment or reply to a post.

  1. Sagar Sontakke

    Hello Simon Hoeg ,

    Thanks for the information.

    We have created FPM OIF application where almost 20 different components are added. All these component shares data using WD SHARED component. Messages link (navigation) was working fine till we have upgraded ABAP to EHP8. Now message link do not navigate to view element. is there any way to deactivate event “FPM_TEST_MESSAGE_NAVIGATE” ?

    Regards

    Sagar Sontakke

    (0) 
    1. Simon Hoeg Post author

      Hello Sagar,

      FPM_TEST_MESSAGE_NAVIGATE is not an event, it is just a FPM test application.

      Can you please check, if  SAP Note  2317280 apply in your case? Otherwise you should create an OSS ticket on BC-WD-CMP-FPM, the problem could be caused by something else ….


      Regards,

      Simon

      (0) 
  2. Robin Wennemuth

    Hi Simon,

    thanks for the informative Blog.

    Will this also work for Composite UIBBs?

    For a customer we had implemented this feature on our own based on ABAP 7.40 with the structures IS_ENABLE_MESSAGE_NAVIGATION, IR_MESSAGE_USER_DATA and FPM event ON_NAVIGATE.

    We override the event in order to set the desired UIBB visible and collapse all other UIBBs in the stacked OVP Config. But unfortunately this does not work for Composite UIBBs.

    Thanks and best regards,

    Robin

    (0) 
    1. Simon Hoeg Post author

      Hi Robin,

      you should implement an own APPCC for the Composite UIBB, see the marker interface IF_FPM_COMPOSITE_CONF_EXIT. Did you already try this?

      Then you get an instance on IF_FPM_COMPOSITE in method OVERRIDE_CONFIG_COMPOSITE. Here you find appropriate methods and the curent FPM Event via attribute IF_FPM_COMPOSITE~MO_EVENT.

      Best regards,

      Simon

      (0) 
      1. Robin Wennemuth

        Hi Simon,

        thanks for sharing your input. I am not sure how to bring things together.

        In our OVP Configuaration a lot of UIBBs are embedded – either directly or indirectly using a composite UIBB. So in the Interface method IF_FPM_OVP_CONF_EXIT~OVERRIDE_EVENT_OVP we override the ‘FPM_VIEW_SWITCH’, which is fired when desired programmatically, such as the message navigation.

        In there, we collapse all tabs and set the desired one as default. IO_OVP is able to change the UIBBs afterwards – I could not do that with the interface IF_FPM_COMPOSITE.

        Or did just misunderstand anything?

        Thanks for your help!

        Kind regards,

        Robin

          data:

            lo_fpm_event type ref to cl_fpm_event,

            lv_target    type string,

            lt_uibbs     type if_fpm_ovp=>ty_t_uibb.

          field-symbols <ls_uibb> type if_fpm_ovp=>ty_s_uibb.

          lo_fpm_event = io_ovp->get_event( ).

          if lo_fpm_event->mv_event_id = if_fpm_constants=>gc_event-view_switch.

            try.

                lo_fpm_event->mo_event_data->get_value( exporting iv_key   =                          if_fpm_constants=>gc_event_param-view_id

                                                        importing ev_value = lv_target ).

                io_ovp->get_uibbs( importing et_uibb = lt_uibbs ).

                loop at lt_uibbs assigning <ls_uibb>.

                  if <ls_uibb>-config_id eq lv_target. 

                    <ls_uibb>-collapsed = abap_false.

                    <ls_uibb>-default_in_stack = abap_true.

                  else.

                    <ls_uibb>-collapsed = abap_true.

                    <ls_uibb>-default_in_stack = abap_false.

                  endif.

                  io_ovp->change_uibb( <ls_uibb> ).

                endloop.

              catch cx_fpm_floorplan.

            endtry.

          endif.

        (0) 
        1. Simon Hoeg Post author

          Hi Robin,

          might be that we have a problem with the granularity.

          In contrast to IF_FPM_OVP you cannot expand and collapse panels with IF_FPM_COMPOSITE, instead you might add and remove UIBBs.

          OVP does not “know” anyhting about the result of IF_FPM_COMPOSITE, so you have to use a combination of both APIs.

          Regards,

          Simon

          (0) 

Leave a Reply