CL_CRM_MASS_LOG_MANAGER - Log Handler for Mass Changes
TXBHW - Original Tax Base Amount in Local Currency General Material DataThis documentation is copyright by SAP AG.
Functionality
This class is responsible for creating messages in the application log. It is designed for the Mass Change functionality, meaning that it contains some project-specific logic.
The class differentiates between two types of messages:
- Procedure messages
These messsages come from the procedure (template). Message categories include:
- error messages (for example errors of individual BOL entities)
- information messages (such as: "4 Contract Headers Found")
- Generated messages
These are special messages that are generated by the engine.They are very basic messages and they summarize whether the changes have been applied successfully or not.
Specifically, they are messages 540 and 541 of the CRM_MASS message class.
Users of this class can make use of the following methods:
- ADD_PROCEDURE_MESSAGE
Adds a new procedure message to the log.
- ADD_GENERATED_MESSAGE:
Adds a new generated message to the log.
- READ_ALL_MESSAGES
Read all the messages that you have entered. This is necessary in the templateoverview page where the user must see all the messages of the template. This method will only returnthe procedure messages that you have logged. This filtering is necessary because the UI only displays procedure messages, not generated messages.
- READ_MESSAGES_FOR_STEP
Read the messages of a step. It is necessary to filter out the messagesfor a step in the UI. This method will only return the procedure messages that you have logged. This filtering is necessary because the UI only displays procedure messages, not generated messages.
- DELETE_ALL_MESSAGES
In case the user cancels the operation, it is necessary to delete all the messages.
- DELETE_MESSAGES_FOR_STEP
In case a step is deleted, it is necessary to delete the messages for this step.
- SAVE_MESSAGES_TO_THE_DATABASE
If you want to save your messages to the database for persistence,you have to call this method. This will write all of your messages to the database. It could later be read using the CL_CRM_MASS_LOG_READER class.
Relationships
The class CL_CRM_MASS_LOG_READER can be used to read the messages from the application log database.
Example
DATA lr_log_manager TYPE REF TO CL_CRM_MASS_LOG_MANAGER.
DATA ls_message_1 TYPE CRMT_MAS_PROCEDURE_MESSAGE.
DATA ls_message_2 TYPE CRMT_MAS_GENERATED_MESSAGE.
lr_log_manager = CL_CRM_MASS_LOG_MANAGER=>CREATE(
IV_BUSINESS_OBJECT_TYPE = 'BUS2000231'
IV_RUN_NUMBER = '66612'
IV_JOB_NAME = 'Cilekes').
ls_message_1-OBJ_DESC = 'Super Contract'.
ls_message_1-OBJ_ID = '2750000213'.
ls_message_1-STEP_NUMB = '1'.
ls_message_1-NODE = 'Rights and Royalties Scope'.
ls_message_1-msgid = 'CRM_ORDER'.
ls_message_1-msgno = '013'.
ls_message_1-msgty = 'E'.
ls_message_1-msgv1 = '2750000213'.
ls_message_1-msgv2 = 'MILLER'.
lr_log_manager->add_procedure_message( ls_message_1 ).
ls_message_2-OBJ_DESC = 'Falling Away'.
ls_message_2-OBJ_ID = '2750000212'.
ls_message_2-msgid = 'CRM_MASS'.
ls_message_2-msgno = '540'.
ls_message_2-msgty = 'I'.
ls_message_2-msgv1 = 'Contract'.
lr_log_manager->add_generated_message( ls_message_2 ).
lr_log_manager->save_messages_to_the_database( ).
Notes
Important design decision
The messages are not sent to the BAL layer until the Saveoperationis issued. This means, that the messages are stored in the internal tables of this class until the save. Upon save, the internal messages are flushed into the BAL layer message classes.
Further information
SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up General Material Data
This documentation is copyright by SAP AG.
Length: 6505 Date: 20120526 Time: 110531 triton ( 143 ms )






