Skip to Content
avatar image
Former Member

how to put the error message in ME51N logs

Hi all,

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

Pr_Error.jpg (160.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    May 17, 2013 at 08:01 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 17, 2013 at 08:34 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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 "
        • May 21, 2013 at 07:24 AM

          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

          Add comment
          10|10000 characters needed characters exceeded

        • Mar 28, 2014 at 03:46 PM

          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!

          Add comment
          10|10000 characters needed characters exceeded