Adding Actions
This option allows you to create an action.
Context
To define the behavior of a business object at runtime you need to add the Actions entity. For example, at runtime you can define an Action entity to change the status of the invoice business object to "Paid", after a buyer pays for a service provided by a seller.
Actions are business logic entities assigned to a business object node. An Action can modify a node instance of the assigned business object or node instance of other business objects. Any of the following triggers can initiate an action:
- User interface
- Business Object
- Other Action or Determination
The results of an Action include only messages and failed keys (keys of node instances for which it was unable to execute an action). In addition, an Action entity also returns the type of functional changes implemented on a certain node instance such as create, delete, or update.
PrerequisiteYou have already created a business object.
Procedure- In the Project Explorer view, choose a business object.
- In the context menu, choose Open.
The Overview page appears.
- Choose the Nodes page.
- Select a node.
- Press Ctrl + click to open the node Overview page.
- Choose the Actions page.
- Choose New.
- In the New Action wizard, enter the following details:
- Name: Enter an action name.
- Description: This is an optional field. Enter a short description of the purpose of the action.
- Annotation: This field displays special actions of the generated business objects..
- Implementation Class: This class contains the action implementation. You can either choose an existing class or create a new one.
- Instance Multiplicity: There are three options available. These are:
- Multiple Node Instances: This is the default option. This option allows the action to operate on multiple node instances.
- Single Node Instance: This option allows the action to operate with a single node instance.
- Static Action (No Node Instances): This option allows the action to operate without any node instance.
- Parameter Structure: The action implementation class uses the parameter structure to capture inputs provided by triggers, if there are any, and pass them to the Action entity. You can perform any of the following tasks to define a parameter structure:
- Create a new parameter structure by entering a name.
- Browse to an existing parameter structure
- Use Suggest Name to system generate a parameter name
- Exporting Type: There are three options available. They are:
- None: This is the default option. This option indicates that the action does not return any data to the consumer.
- Type: This option allows the action to return a data table defined by the row type maintained in the field Exporting Parameter Structure and the corresponding table type maintained in the field Exporting Parameter Table Type.
- Node: This option allows the action to return instances of a foreign node that is defined by the field Exporting Parameter Node and Exporting Parameter BO.
- Choose Finish.
- To check for correctness of business object, choose
(Check ABAP Development Object) from the toolbar.
- To activate the business object, choose Edit > Activate ABAP Development Object.
TIP
You can also use
(Activate ABAP Development Object) in the toolbar.