09-07-2016 12:59 PM
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
09-07-2016 2:02 PM
Use BAdI ME_PROCESS_PO_CUST, you can use either methods
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
09-07-2016 1:43 PM
Dear Kishan,
You can use BADI ME_PROCESS_PO_CUST for validating Purchase Order.
Regards,
Yance
09-07-2016 2:02 PM
Use BAdI ME_PROCESS_PO_CUST, you can use either methods
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