Skip to Content
author's profile photo Former Member
Former Member

Error Message not getting clear while creation of purchase order

Hi All,

I am facing one problem while creating purchasing order.

I have written one user-exit for purchase order. User has to enter purchase requisition number for certain purchase order type. If he doesn’t enter PR number, we have to throw an error message.

I have used the MM06E005 for the same. User exit is working fine, but the problem is, all error messages are collected in log and it will be displayed in a dialog screen when you check the document (Transaction ME21N).

When I enter PR number and check the document, the error message is still there, system is not clearing the error log. I have created “Z” message class and have used in User exit.

Do you guys have any solution for this? Am I using the right user exit? What should I do to clear the error message?

If you don’t have answer, please pass it to your friends also….

Thanks a lot in advance…

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Jun 04, 2005 at 12:06 PM

    Hi Sunil,

    I had exactly the same problem. I contacted SAP but didn't really get a solution and left it that provided the exit criteria was finally correct you could save the PO.

    I disagree with previous comment. There is an OSS/SAPNet note that details how to issue a message for the "Enjoy" PO transaction and are assuming you are using that in your exit. This note makes clear not to issue a message through the normal means but to use the macro's for the PO message routine.

    If someone could give a solution answer I would be appreciative as well.

    Michael

    Message was edited by: Michael Bennett

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Michael,

      You are right. There is an OSS which tells how to write error message in 'Enjoy' transaction. The oss number is 310154. I got the solution and my problem is solved now.

      Thanks a lot to all who responded to my query.

      FYI : The other useful OSS are 763605 822087.

  • author's profile photo Former Member
    Former Member
    Posted on Jun 04, 2005 at 03:09 PM

    Hi Sunil,

    I believe you need to do the following:

    TYPES:
      BEGIN OF type_my,
        subrc TYPE sysubrc,
        msgid TYPE symsgid,
        msgty TYPE symsgty,
        msgno TYPE symsgno,
        msgv1 TYPE symsgv,
        msgv2 TYPE symsgv,
        msgv3 TYPE symsgv,
        msgv4 TYPE symsgv,
      END   OF type_my.
    DATA:
      my TYPE type_my.
    ...
      IF sy-subrc NE 0.
    * Transfer
        my-subrc = sy-subrc.
        my-msgid = sy-msgid.
        my-msgty = sy-msgty.
        my-msgno = sy-msgno.
        my-msgv1 = sy-msgv1.
        my-msgv2 = sy-msgv2.
        my-msgv3 = sy-msgv3.
        my-msgv4 = sy-msgv4.
    *   Cleaning
        CLEAR:
          sy-subrc,
          sy-msgid,
          sy-msgty,
          sy-msgno,
          sy-msgv1,
          sy-msgv2,
          sy-msgv3,
          sy-msgv4.
    *   Generate message
        mmpur_message my-msgty my-msgid my-msgno
                      my-msgv1 my-msgv2 my-msgv3 my-msgv4.
    *   Remove message from message list
        mmpur_remove_messages_by_id [<Purchase Order Number>]
      ENDIF.

    Replace the mentioned [<Purchase Order Number>] with your PO number (EBELN value field).

    Now because it is unclear where errors come from (even your own) you always must use mmpur_message to generate your message. Anytime you do not want messages to be stored, use mmpur_remove_messages_by_id.

    Regards,

    Rob.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Rob,

      Your inforamtion was good enough to start. thanks a lot for that. I tried to implement the same but no luck this time also.

      FYI..

      The FM exit name is EXIT_SAPMM06E_012 and see the following code, i used.

      TYPES: BEGIN OF type_my,

      subrc TYPE sysubrc,

      msgid TYPE symsgid,

      msgty TYPE symsgty,

      msgno TYPE symsgno,

      msgv1 TYPE symsgv,

      msgv2 TYPE symsgv,

      msgv3 TYPE symsgv,

      msgv4 TYPE symsgv,

      END OF type_my.

      DATA: my TYPE type_my.

      DATA : GV_PO(10) TYPE I.

      if I_EKKO-BSART = 'Z005'.

      GV_PO = I_EKKO-EBELN.

      loop at TEKPO.

      if TEKPO-BANFN is initial.

      • message E000(ZBC_MESSAGES) with TEKPO-EBELP.

      my-subrc = sy-subrc.

      • my-msgid = sy-msgid.

      • my-msgty = sy-msgty.

      • my-msgno = sy-msgno.

      my-msgid = 'ZBC_MESSAGES'.

      my-msgty = 'E'.

      my-msgno = '000'..

      my-msgv1 = sy-msgv1.

      my-msgv2 = sy-msgv2.

      my-msgv3 = sy-msgv3.

      my-msgv4 = sy-msgv4.

      • Cleaning

      CLEAR:

      sy-subrc,

      sy-msgid,

      sy-msgty,

      sy-msgno,

      sy-msgv1,

      sy-msgv2,

      sy-msgv3,

      sy-msgv4.

      • Generate message

      mmpur_message my-msgty my-msgid my-msgno

      my-msgv1 my-msgv2 my-msgv3 my-msgv4.

      • Remove message from message list

      mmpur_remove_messages_by_id GV_PO.

      endif.

      endloop.

      It is still not working. Moreover i don't have PO number at run time.

      I hope this clarify the problem in more detail.

      Meanwhile i am searching for OSS as suggested by Michael Bennett.

  • author's profile photo Former Member
    Former Member
    Posted on Jun 04, 2005 at 08:26 AM

    I think if you will just raise the error message directly, in the exit it will not be collected in application log.

    You are probably populating the error message variables in your user exit and then allowing SAP to handle it.

    Also, you can direclty throw the error message in your user exit without using raising exception clause.

    somthing like

    messageE001(zz) .

    and not

    messageE001(zz) raising others.

    Thanks,

    Ram

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.