Application Development 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: 

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

0 Kudos

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?

4 REPLIES 4

Former Member
0 Kudos

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

former_member156446
Active Contributor
0 Kudos

Should try using like this

MMPUR_BUSINESS_OBJ_ID WL_MEPOHEADER-ID.

         MMPUR_MESSAGE_FORCED 'E' 'Zxxxxxx '999'VG_MESSAGE

jimmy_chan2
Explorer
0 Kudos

Please check IF_EX_ME_PROCESS_PO_CUST~CHECK

raymond_giuseppi
Active Contributor
0 Kudos

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