Skip to Content

Displaying Error message in message log while saving PO in ME21N Screen

Hi All,

I have added one message ME(024) in the BADI Method Process_header. It is for vendor flag deletion validation. The error message is displaying Properly if the vendor deletion flag is set. But however while saving PO, other error messages are showing and the error that I wrote in the method is not appearing.

I don't know what might be the issue?  Can anyone tell me what is the issue? Do i need to write the message anywhere?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Jan 07, 2015 at 11:42 PM

    Refer to the sample implementation.

    Class: CL_EXM_IM_ME_PROCESS_PO_CUST

    Method: IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM

    Don't forget to include

    INCLUDE mm_messages_mac. "useful macros for message handling

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 08, 2015 at 01:05 AM

    Should try using like this

    MMPUR_BUSINESS_OBJ_ID WL_MEPOHEADER-ID.

             MMPUR_MESSAGE_FORCED 'E' 'Zxxxxxx '999'VG_MESSAGE

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 08, 2015 at 04:32 AM

    Please check IF_EX_ME_PROCESS_PO_CUST~CHECK

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 13, 2015 at 03:52 PM

    How did you raise the errioir, did you use standard macros ?

    Sample :

    method if_ex_me_process_po_cust~process_header .
    * standard include for messages
      include mm_messages_mac.
    * Local data
      data: ls_header type mepoheader,
            etc.
    * Get current values
      ls_header = im_header->get_data( ).
    * Well should not be required, but...
      check me->trtyp ne 'A'. " instance attribute saved in if_ex_me_process_po_cust_open
    * Clear own messages of previous call
      mmpur_context mmcnt_context_badi.
      if not ls_header-id is initial and im_header->is_valid( ) eq mmpur_yes.
        mmpur_remove_msg_by_context ls_header-id mmcnt_context_badi.
      endif.
    * A single check
      if ls_header-flag = 'X'.
        mmpur_metafield mmmfd_vendor.
        mmpur_metafield_add mmmfd_doc_typ.
        mmpur_message_forced 'E' 'ZFSM' '413' ls_header-lifnr ls_header-bsart ' ' ' '.
        im_header->invalidate( ).
        exit.
      endif.
    * to be continued.
    endmethod.
    
    

    Regards,

    Raymond

    Add comment
    10|10000 characters needed characters exceeded