Хм..
бади ME_PROCESS_PO_CUST метод CHECK специально для этого предназначен, да и вдругих методах этой бадишки можно сообщения создавать.
Как это сделать - написано в документации к методам бади
Цитата:
Metafield and error handling
Metafields also have an important function in error handling. They establish the connection between a message and the business content.
Example
You can control the positioning of the cursor during the processing of messages.
If you wish to do this when implementing your own checks, use the following macros:
mmpur_metafield
This macro links the metafield with the message generated with the subsequent macro mmpur_message_forced (see below). A list of the known metafields can be found in the type group MMMFD. This also contains some definitions for customer enhancements (MMMFD_CUST_01 to MMMFD_CUST_10).
mmpur_message_forced
You use this macro to generate the actual message. The message is linked to the known business object (e.g. document header, document item) and the previously specified metafield. The macro requires exactly sevem parameters: message category (I,W,E), message class, message number and the four message parameters. (See also the ABAP message statement).
Further notes
The above-mentioned macros are defined in the program MM_MESSAGES_MAC. Please include this program in your own application.
Never issue messages in BAdI ME_GUI_PO_CUST! This is the task of the business logic and must therefore be done via the BAdI ME_PROCESS_PO_CUST.
Never use the ABAP statement MESSAGE in the BAdI ME_PROCESS_PO_CUST. Please use the macro mmpur_message_forced only. This macro only writes a message in the message collector.
If you wish to mark the business object as invalid in order to prevent posting, you must additionally use the INVALIDATE ( ) method of the relevant interface. In this connection, see also the code example in the PROCESS_ITEM method of the BAdI ME_PROCESS_PO_CUST.
То есть примерно так
Code:
INCLUDE mm_messages_mac.
mmpur_message_forced 'W' 'класс сообщения' 'номер сообщения' '' '' '' ''.