Procedure documentationEnabling Links in Messages

 

Note Note

For this function, you must carry out additional development activities on a project basis.

End of the note.

Procedure

Proceed as follows:

  1. Provide the mapping between the message and a field.

    Syntax Syntax

    1. lr_msg_service = view_manager->get_message_service( ).
    2. lr_msg_service->add_message_mapping(iv_message_class = 'CRM_BRC_MESSAGES'
    3. iv_message_number = '013'
    4. iv_binding_string = '//BRCBUSINESSROLE/STRUCT.CRMUI_NAVBAR'
    5. iv_page_id = component_id ).
    End of the code.
  2. You can modify the mapping using the following methods:

    • REMOVE_MESSAGE_MAPPING

      This removes the mapping for a specified message (message class, message ID) and for a specified view.

    • REVOVE_ALL_MESSAGE_MAPPING

      This removes all mappings for a specified view.

The mapping is kept and reused for the entire session.

If a message is mapped to several fields and you click the link in the message, you navigate to the first field on the screen.

If a field is not found on the page, the navigation does not happen. However, you can specify that a server event is to be triggered. Provide the optional parameter IV_SERVER_FALLBACK if you add the mapping using method ADD_MESSAGE_MAPPING with value ABAP_TRUE. This triggers the server event focusField. You need to define an event handler.

For the binding string that is provided to method ADD_MESSAGE_MAPPING, you can use a single attribute or table attribute.

Example Example

Type

Example

Single attribute

//BRCBUSINESSROLE/STRUCT.CRMUI_NAVBAR

Table attribute

//BRCKEYBOARDSHORTCUTS[x]/LINK_ID

X corresponds to the position of the corresponding object in the collection wrapper. For a binding string that uses a table attribute, make sure that the index (specified in angular brackets) is the index of the targeted entity in the collection wrapper. That is, if sorting happens, the binding string of the message attribute mapping needs to be updated with the index.

End of the example.