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

Enhancement to raise error for some gl accounts while saving purchase order creation

Hi All,

Need List of Enhancement to raise error for some GL accounts, while saving purchase order document creation or change.

Or else need enhancement once the GL account is entered in the screen.

I have found the Exits

EXIT_SAPMM06E_012

EXIT_SAPMM06E_013

I am not sure how can this be used to raise message.

Thanks in advance.

Regards,

Kishan Raj

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Sep 07, 2016 at 01:02 PM

    Use BAdI ME_PROCESS_PO_CUST, you can use either methods

    • PROCESS_ACCOUNT (so at PAI of screen)
    • CHECK (executed at request or before save) there loop on items and inner loop on their accounting data

    Small sample for PROCESS_ACCOUNT, but use search tool, already many samples available

    * macro for messages

    include mm_messages_mac.

    * Load accounting and item values

    ls_accounting = im_account->get_data( ).

    im_item = im_account->get_item( ).

    ls_item = im_item->get_data( ).

    * Be clean, remove message raised previous execution

    mmpur_context mmcnt_context_badi.

    if not ls_accounting-id is initial.

    mmpur_remove_msg_by_context ls_accounting-id mmcnt_context_badi.

    endif.

    * Raise some error message

    if 1 = 2.

    mmpur_metafield mmmfd_g_l_acct.

    mmpur_message_forced 'E' 'ZCLASS' '123' ls_accounting-sakto ' ' ' ' ' '.

    im_account->invalidate( ).

    exit.

    endif.

    Regards,

    Raymond

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2016 at 12:43 PM

    Dear Kishan,

    You can use BADI ME_PROCESS_PO_CUST for validating Purchase Order.

    Regards,

    Yance

    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.