Message and Change Handling 
Business Object Processing Framework (BOPF) supports the use of T100 messages that can be created by business object entities to be forwarded to the consumer. For example, a consistency validation returns an error message if there is an inconsistent node instance. From an implementation viewpoint, a message is an instance of a class that inherits the exception class /BOBF/CM_FRW. A message contains additional context information in which the following attributes must be handed over to the CONSTRUCTOR method:
Attribute |
Description |
|---|---|
TEXTID |
This component is written as SYMSG. To fill MSGID and MSGNO with the message number and message ID, use a constant of the corresponding CM class. |
SEVERITY |
There are different severities that classify a message as an error, a warning, or an information message. To specify the message severity, use the constants of the /BOBF/CM_FRW class. |
LIFETIME |
The validity period of this message depends on its lifetime and can be automatically set. Use the constant |
MS_ORIGIN_LOCATION |
Fill this attribute with the key of the node instance that is affected by the message. |
You implement message handling as follows:
Clear the exporting parameter EO_MESSAGE.
Create an instance of the suitable message class and hand over the information described above.
Get the current message container from the BOPF factory (/BOBF/CL_FRW_FACTORY=>GET_MESSAGE).
Add the message to the message container.
Syntax
" clear message object at the beginning DATA: ls_location TYPE /bobf/s_frw_location, lo_cm TYPE REF TO cm_bopf_training. CLEAR eo_message. … " create message instance ls_location-node_key = is_ctx-node_key. ls_location-key = ls_key-key. CREATE OBJECT lo_cm EXPORTING textid = cm_bopf_training =>missing_bill_to_party severity = /bobf/cm_frw=>co_severity_error lifetime = /bobf/if_frw_c=>sc_lifetime_set_by_bopf symptom = /bobf/if_frw_message_symptoms=>co_bo_inconsistency ms_origin_location = ls_location. … " get message container IF eo_message IS NOT BOUND. CALL METHOD /bopf/cl_frw_factory=>get_message RECEIVING eo_message = eo_message. ENDIF. … " add message to the message container eo_message->add_cm( lo_cm ).