Skip to Content
avatar image
Former Member

ME59N - write custom error message to the spool?

Dear SAP People,

The change is for ME59N and ME59 transactions.

Problem is with ME59N transaction.

The requirement is to check whether the doc.type at header level and item category of the line item in the purchase requisition go hand in hand or not? If not then the requirement is to stop creating the POs and raise a custom error message. So I found this enhancement: M06E0004, user exit EXIT_SAPLEBND_002 to write the code.

In foreground: When I try to raise a custom error message then, it is being displayed for the ME59 no problem there, but for ME59N the custom error message is going inside the detailed log. The message is there, not problem in foreground.

In background: only the header message " PO could not be created" is being written to the spool, even though I wrote explicitly using the FM GET_PRINT_PARAMS.

is there a way to overwrite the standard PO error mentioned above with the custom ones??

Please let me know.

--

With Regards,

Anirudh Vishwamithra.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Dec 08, 2016 at 10:00 AM

    Can it be that you missed to include the detailed log in the variant of your background job:

    That is my spool file for example:

    and finally the log which has the Z-messages

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 06, 2016 at 07:06 PM

    Messages are shown in the job log, not in spool. And I'd imagine that a GET... function does not write anything. I'm quite confused what you're doing and expecting exactly... Might want to clarify and post the code as well.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Jelena,

      please correct me if I am wrong. Job log displays in the foreground right? But when we execute the transaction ME59N in the background then the output ( error messages ) should be written in the spool. I am getting the print parameters by using the GET.. FM and then using write statement to write it to the spool.

      But the custom message is being overwritten with the standard SAP message "PO NOT CREATED".

      Please let me know how should I achieve this? What is the approach which needs to be followed? Thanks in advance.

      --

      With Regards,

      Anirudh Vishwamithra.

  • avatar image
    Former Member
    Dec 08, 2016 at 11:13 AM

    Thank you Jürgen L. This is what I am in need of. Thank you very much. I might have overlooked it. I will let my user base know about this. Thanks again :)

    Add comment
    10|10000 characters needed characters exceeded