Show TOC

Implementation of ActionsLocate this document in the navigation structure

Use

To create an action, the implementing class of the action must be implemented. This class corresponds to a common ABAP class (with the /BOBF/IF_FRW_ACTION interface implemented). If you create an action using Business Object Builder (BO Builder), the generated class already implements this interface.

The action interface consists of the following methods:

Method

Description

PREPARE

This method is processed before the validations of the action and the execute method of the action are processed. Using this optional method you can enlarge or reduce the set of keys for which the action is executed.

EXECUTE

This mandatory method contains the business logic of the action.

RETRIEVE_DEFAULT_PARAM

This optional method retrieves the default parameter if an importing parameter is defined for an action. If this is the case, It can be useful for the consumer to get a default parameter proposal.

Example

The following source code describes the INVOICE_PAID action that the consumer can use to mark invoices as being paid:

METHOD /bobf/if_frw_action~execute.
 DATA:
  lv_ltimestamp TYPE      timestampl,
  lt_root_data TYPE       bobf_t_customer_invoice,
  ls_root_data TYPE REF TO       bobf_s_customer_invoice.

" clear exporting parameter
CLEAR:
 eo_message
 et_failed_key.
" get all root instance data
io_read->retrieve(
 EXPORTING
  iv_node = if_ci_bopf_customer_invoi_c=>sc_node-root
  it_key = it_key
 IMPORTING
  et_data = lt_root_data.
" set the attributes PAYED and PAYMENT_RECEIVED
LOOP AT lt_root_data REFERENCE INTO ls_root_data.
 " update data
 ls_root_data->payed = if_sp_pay_exec_st_cd=>co_received.
 " set payment date time stamp
 GET TIME STAMP FIELD lv_ltimestamp.
 ls_root_data->payment_received = lv_ltimestamp.
 " update data
 io_modify->update(
  EXPORTING
   iv_node = if_ci_bopf_customer_invoi_c=>sc_node-root
   iv_key = ls_root_data->key
   is_data = ls_root_data ).
 ENDLOOP
ENDMETHOD