Consumer Implementation 
The consumer (for example, the user interface or a foreign business object) can access a business object using a set of core services. These core services are described in detail in the interface documentation of the service manager /BOBF/IF_TRA_SERVICE_MGR. The following table gives an overview of the core services.
Method |
Description |
|---|---|
CHECK_ACTION |
This method checks if a certain action can be executed. You have the option of using a given action parameter on a given set of node instances. The execution of an action can be prohibited depending on the state of the node instances, the properties of the action, or failed action validations. |
CHECK_AND_DETERMINE |
This method checks whether or not a certain set of node instances of a node is currently in a consistent state. The validations configured to corresponding nodes and the relevant determinations are executed to set node instances into a consistent state. Additionally, the consistency statuses covered by the check scope are updated. |
CHECK_CONSISTENCY |
This method checks if a certain set of node instances of a node is in a consistent state. The validations configured to the corresponding node or to the complete substructure are executed to check the consistency. |
CONVERT_ALTERN_KEY |
This method retrieves alternative key values. |
DO_ACTION |
This method executes a certain action with a given parameter on a given set of node instances. |
MODIFY |
This method creates, updates, and deletes node instances in a mass enabled manner. |
RETRIEVE |
This method reads data of certain instances of a certain node. |
RETRIEVE_BY_ASSOCIATION |
This method retrieves node instances that can be identified with the help of a certain associate. |
GET_NEW_KEY |
This method returns a new globally unique key, which has not been used to identify any other entities. For example, it can be used to identify new node instances. |
QUERY |
This method executes a query and returns the query result. |
The following core services are only relevant for user interfaces accessing business objects:
Method |
Description |
|---|---|
RETRIEVE_CODE_VALUE_SET |
This method to retrieves the values of a certain code list. A value set represents a dynamic value help (F4 help) of an entity. |
RETRIEVE_DEFAULT_ACTION_PARAM |
This method retrieves the dynamic default parameter values of a certain action. The selection of the default parameter of an action can depend on the instances on which the action shall operate as well as on a pre-filled action parameter. The method returns a reference to a parameter structure of that action, which is enriched by the default values. |
RETRIEVE_DEFAULT_NODE_VALUES |
This method retrieves dynamic, context dependent default values of node instances without actually creating these node instances. |
RETRIEVE_DEFAULT_QUERY_PARAM |
This method can be called to receive the default parameter values of a certain query. Since the default parameter of a query can depend on a pre-filled parameter, the CT_SELECTION_PARAMETER parameter is imported. |
RETRIEVE_PROPERTY |
This method retrieves the properties of certain entities. |
Caution
For cross-business-object communication, use the core services offered by the service manager. For intra-business-object communication, use the READ object provided by Business Object Processing Framework (BOPF).
The transaction model is divided into an interaction phase and a save phase. For more information, see Transaction Model. After finishing the core service calls, a consumer can either cleanup or save the changes made in the current transaction. In both cases, the transaction manager instance must be received from the factory class /BOBF/CL_TRA_TRANS_MGR_FACTORY=>GET_TRANSACTION_MANAGER. Afterwards, the corresponding instance methods CLEANUP or SAVE can be called.
Caution
Only the consumer is allowed to control the transaction. Do not call transaction services offered by the transaction manager in entity implementations!
The following example shows how to save a transaction after the interaction phase took place.
Syntax
DATA lo_transaction_manager TYPE REF TO /bobf/if_tra_transaction_mgr. " start interaction phase … " start save phase lo_transaction_manager = /bobf/cl_tra_trans_mgr_factory=>get_transaction_manager(). lo_transaction_manager->save( ).
Most of the core services return a message object (EO_MESSAGE) to the consumer that contains messages created by the executed entities. To make use of these messages, the following attributes must apply:
Depending on the lifetime, the validity period of the message is either restricted to the current service call (lifetime transaction) or it continues until the inconsistency is corrected (lifetime state).
The severity of the message is expressed by the message severity. It is distinguished into error, warning, and information.
The origin location defines which instance the message is referred to.