Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

MESSAGE_HANDLER values?

Former Member
0 Likes
1,619

Hi All,

For my requirement I am using FM HR_ECM_GET_DATETYP_FROM_IT0041. In this MESSAGE_HANDLER (importing parameter) is obligatory.

What values does this parameter accept?

Thanks in advance.

Satish

2 REPLIES 2
Read only

Former Member
0 Likes
752

Did you get the answer?

I want to know the same thing

Read only

uwe_schieferstein
Active Contributor
0 Likes
752

Hello Satish

The interface IF_HRPA_MESSAGE_HANDLER is implemented by many classes yet I think the most appropriate one for you should be CL_HRPA_MESSAGE_LIST.

The sample report ZUS_SDN_ECM_GET_DATETYP_IT0041 shows you how to call the fm. It is not necessary to feed the IMPORTING parameter MESSAGE_HANDLER with an interface reference variable. Any implementing class will be accepted.

Within fm HR_ECM_GET_DATETYP_FROM_IT0041 -> HR_ECM_READ_INFOTYPE -> HR_ECM_ADD_MESSAGE the error messages are added to the message handler. I simulated this by setting

missing_auth = 'X'     " in debugging mode

within fm HR_ECM_READ_INFOTYPE.


*&---------------------------------------------------------------------*
*& Report  ZUS_SDN_ECM_GET_DATETYP_IT0041
*&
*&---------------------------------------------------------------------*
*& Thread: MESSAGE_HANDLER values?
*& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="596748"></a>
*&---------------------------------------------------------------------*

REPORT  zus_sdn_ecm_get_datetyp_it0041.


DATA: "gif_msg_handler   TYPE REF TO if_hrpa_message_handler,
      go_msg_list       type ref to cl_hrpa_message_list.

data: gt_messages   type HRPAD_MESSAGE_TAB.

PARAMETERS:
  p_pernr   TYPE pernr_d  DEFAULT '00001402',
  p_keydt   TYPE datum    DEFAULT syst-datum,
  p_datar   TYPE datar    DEFAULT '01'.



START-OF-SELECTION.

  BREAK-POINT.

  CREATE OBJECT go_msg_list.
  "gif_msg_handler = go_msg_list.

  CALL FUNCTION 'HR_ECM_GET_DATETYP_FROM_IT0041'
    EXPORTING
      pernr                 = p_pernr
      keydt                 = p_keydt
      datar                 = p_datar
      message_handler       = go_msg_list " gif_msg_handler
*   IMPORTING
*     DATE                  =
*     IS_OK                 =
            .
  BREAK-POINT.

  TRY.
  CALL METHOD go_msg_list->get_message_list
    IMPORTING
      messages = gt_messages.

     CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
       EXPORTING
         I_STRUCTURE_NAME                  = 'HRPAD_MESSAGE'
         I_GRID_TITLE                      = 'Message List'
*        IS_LAYOUT_LVC                     =
*        IT_FIELDCAT_LVC                   =
*        I_DEFAULT                         = 'X'
*        I_SAVE                            = ' '
*        IS_VARIANT                        =
       TABLES
         t_outtab                          = gt_messages
       EXCEPTIONS
         PROGRAM_ERROR                     = 1
         OTHERS                            = 2.
     IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
     ENDIF.

   CATCH cx_hrpa_violated_assertion .
  ENDTRY.



END-OF-SELECTION.

Regards

Uwe