cancel
Showing results for 
Search instead for 
Did you mean: 

how to put the error message in ME51N logs

Former Member
0 Kudos

Hi all,

Pls help me anyone. how to put the custom validation error message in me51n tcode logs.

Accepted Solutions (0)

Answers (4)

Answers (4)

dave_playfair2
Explorer
0 Kudos

There is an enhancement (CMOD) for PR's here:

MEREQ001

The exit FM EXIT_SAPLMEREQ_005 is where you can add to the message log.

Create the custom include and append any messages to the EX_MESSAGES FM parameter.

You can validate your messages here, either deleting or adding to the log as you see fit. The messages table uses a standard bapi return structure, so should be easy enough to figure out.


I'd copy some code, but SCN isn't allowing me to copy and paste code into this window!

raymond_giuseppi
Active Contributor
0 Kudos

Look better at the sample class provided by SAP, look at a method like IF_EX_ME_PROCESS_REQ_CUST~OPEN of CL_EXM_IM_ME_PROCESS_REQ_CUST to get sample on how to raise error message with this BAdI. And read, again, BAdI and Interface documentations.

Regards,

Raymond

Former Member
0 Kudos

HI ,

you need to search in SCN before you post your queries.

Anyhow , if you wanna put validation then activate badi 'ME_PROCESS_REQ_CUST'  to raise error messages based on your validations.

check that badi's sample codes.

"

   method if_ex_me_process_req_cust~open .
  include mm_messages_mac.
  data l_null type ref to if_message_obj_mm.

* IF ...

*- handling for error messages -> see oss note 938007
    mmpur_business_obj l_null.
    mmpur_message_forced sy-msgty sy-msgid sy-msgno sy-msgv1 sy-msgv2
                         sy-msgv3 sy-msgv4.

    ch_valid = mmpur_no.
* ENDIF ...
endmethod.

"

Prabhu

Former Member
0 Kudos

Hi prabu,

ME_PROCESS_REQ_CUST badi is not calling for ME51N tcode....

below badi only calling for after save. After save i need to validate a item field and through error message in log. pls help me....any other userexit or enchancement.

   

ME_COMMITMNT_PARKING

ME_COMMTMNT_PO_RELEV

ME_COMMTMNT_PO_REL_C

ME_COMMITMENT_STO_CH

ME_REQ_POSTED

Thanks,

Nivas.M

Former Member
0 Kudos

Hi Nivas ,

this badi ME_PROCESS_REQ_CUST will do validation before you saving PReq , if any errors duing the validation then you can stop user from saving the document.

please check documention and sample codes of this badi.

With its methods, the BAdI covers the complete transaction cycle for the purchase requisition. As a result, you can intervene at each step in the processing with an implementation of your own.

    1. Transaction start
    BAdI method INITIALIZE
    2. Opening of a purchase requisition
    BAdI method OPEN
    3. Checking of data
    • Header data of purchase requisition
      BAdI method PROCESS_HEADER
    • Item data of purchase requisition
      BAdI method PROCESS_ITEM
    • Account assignments in der purchase requisition
      BAdI method PROCESS_ACCOUNT "
Former Member
0 Kudos

Hi Nivas,

I have done a similar scenario but in WARRANTY module. You need to add your custom message to the Applilcation Message Log. The below set of FM will be required to accomplish your task:

  • BAL_DB_LOAD
  • BAL_DB_SAVE
  • BAL_LOG_MSG_ADD

You will have to understand the Application Message Logging concept first. The messages are linked through Message Log and Message Handle. You need to first LOAD the corresponding Message Handle, then ADD your custom message to the Log opened by LOAD FM. Then you save the Log using SAVE FM.

Below links will be of help:

http://wiki.sdn.sap.com/wiki/display/ABAP/Application+Log+Methodology+in+SAP

http://scn.sap.com/docs/DOC-34346

Please let me know if you need more help.

Regards,

DN.