Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
simon_hoeg
Advisor
Advisor
0 Kudos

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.

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 :wink:



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.


6 Comments