Skip to Content
0
Former Member
Feb 03, 2010 at 07:06 PM

BAdI PT_BLP_USER, error messages e_messages and the portal

220 Views

I have implemented the BAdI PT_BLP_USER, in order to restrict the request for approval for certain kind of absences, to certain start and end times.

The idea is to have a message appear in the portal when the user enters different hours than the fixed ones.

The PROCESS_DATA method returns a table, E_MESSAGES, which is a table with BAPIRET2 lines. When I try to fill that table, I get the following error in the portal:

Exception condition "MSGCATEGORY_INVALID" raised., error key: RFC_ERROR_SYSTEM_FAILURE

The code I'm trying to use is this:

method IF_EX_PT_BLP_USER~PROCESS_DATA.

 method IF_EX_PT_BLP_USER~PROCESS_DATA.

CHECK i_record->data->category = cl_pt_tmw_tdm_const=>cat_infty.
CHECK i_record->data->type = '2001'.

data: lo_infotype_2001 type ref to if_pt_td_it2001.
data: lw_infotype_2001 type p2001.

lo_infotype_2001 ?= i_record->data.
lw_infotype_2001 = lo_infotype_2001->p2001.

DATA: mess TYPE bapiret2.

IF lw_infotype_2001-begda >= '20100101'.
  CASE lw_infotype_2001-subty.
    WHEN 'P30'.
      IF lw_infotype_2001-beguz <> '143000' AND lw_infotype_2001-beguz <> '150000'.
*        MESSAGE text-e01 TYPE 'I'.
*        SET SCREEN sy-dynnr. LEAVE SCREEN.
*        mess-type = 'E'.
*        mess-id = '00'.
        mess-type = 'I'.
        mess-number = '245'.
        mess-message = text-e01.
        APPEND mess TO e_messages.
      ENDIF.
    WHEN 'PAU'.
      IF lw_infotype_2001-beguz <> '140000' AND lw_infotype_2001-beguz <> '150000'.
*        MESSAGE text-e01 TYPE 'I'.
*        SET SCREEN sy-dynnr. LEAVE SCREEN.
        mess-type = 'A'.
        mess-id = '00'.
        mess-number = '999'.
        mess-message = text-e01.
        APPEND mess TO e_messages.
      ENDIF.
  ENDCASE.
ENDIF.

endmethod.

The id and number fields have no effect, I just tried filling them also. For the type, I tried all options (E, W, I, A) with the same effect. If I donu2019t fill the type value, I get a different error (no return data, or something like that) so it is needed.

Any advice would be highly appreciated. Thank you.