cancel
Showing results for 
Search instead for 
Did you mean: 

How to use message navigation with message user data

Former Member
0 Kudos

Hi,

I'm trying to use message navigation in my WDA. For this, I use the enable_message_navigation parameter of method report_element_t100_message. The message is dispalyed as link and I can handle the onNavigate even of the MessageArea. My problem is use of msg_user_data for additional info for navigation. I tried it with get reference of lv_name into lv_msg_user_data but because of the use of the local variable lv_name the reference is free in my event handler.


What's the correct use for set and get of this parameter?

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member1151507
Participant
0 Kudos

Hi,

When you create message using REPORT_ATTRIBUTE_T100_MESSAGE method, by default the message navigation is applicable.

The parameter MSG_USER_DATA holds data of the caller for later message navigation. To fill this parameter, you can refer below code.

   DATA lo_nd_data TYPE REF TO if_wd_context_node.

   DATA lo_el_data TYPE REF TO if_wd_context_element.

   DATA ls_msg TYPE symsg.

   DATA lr_path TYPE REF TO data.

   FIELD-SYMBOLS: <lv_path> TYPE string.

  

   lo_nd_data = wd_context->get_child_node( name = wd_this->wdctx_data ).

   lo_el_data = lo_nd_data->get_element( 1 ).

   ls_msg-msgty = 'E'.

   ls_msg-msgid = 'ZF1U_ACTUAL_COSTING'.

   ls_msg-msgno = '001'.

   IF lo_el_data IS NOT INITIAL.

     CREATE DATA lr_path TYPE string.

     ASSIGN lr_path->* TO <lv_path>.

     <lv_path> = lo_el_data->get_path( ).

   ENDIF.

* report message

   CALL METHOD lo_message_manager->report_attribute_t100_message

     EXPORTING

       msg            = ls_msg

       element        = lo_el_data

       attribute_name = 'KUNNR'

       msg_user_data  = lr_path .

Hope this helps.

Regards,

Manogna