!--a11y-->
Actions 
An action is an (atomic) operation that is performed in response to an event. IOITF enables you to define actions that can be performed as part of event handling by IOITF. An action is not mandatory as the IOITF allows you to either change the state of an individual object or perform an action.
The following sections explain how to define and register actions.
An action is represented by an ABAP class that implements the action interface IF_COM_IOITF_AC as specified by the IOITF.
To define an action, name your action, for example, MY_ACTION. Using transaction SE24 create a Usual ABAP Class with the name CL_MY_ACTION. On; the Interfaces tab, specify IF_COM_IOITF_AC. On the Methods tab choose the method IF_COM_IOITF_AC~EXECUTE. Enter the necessary code here; save, and activate your entry. Use the following template.
METHOD if_com_ioitf_ac~execute.
* Before you can access the Application Context you must convert it
* into the format that you specified for the corresponding Event.
DATA: lo_my_appl_ctx TYPE REF TO cl_my_appl_ctx VALUE IS INITIAL.
lo_my_appl_ctx ?= io_appl_context.
* If your event expects something in return then create the
* Individual Object Context that you specified for the corresponding
* Event.
* DATA: lo_my_iobj_ctx TYPE REF TO cl_my_iobj_ctx VALUE IS INITIAL.
* CREATE OBJECT lo_my_iobj_ctx.
* --> Begin: Put your code
* You can access the information in Application Context or
* Individual Object Context as follows -
* lv_iobj_guid = lo_my_appl_ctx->iobj_guid.
* lo_my_iobj_ctx->rc = lv_rc.
* ...and so on!
* --> End: Put your code
* Return Individual Object context
* co_iobj_context ?= lo_my_iobj_context.
ENDMETHOD.
For example, action ISHT_AC_SET_MAINT of High Tech’s Software Entitlement Demo application has been implemented as follows:
*&---------------------------------------------------------------------*
*& METHOD if_com_ioitf_ac~execute *
*& *
*& This method is executed when additional maintenance is purchased *
*& for the Perpetual Entitlement. *
*& *
*& The attributes set by this Action are - *
*& 1. ISHT_LEVEL - Support Level *
*& 2. ISHT_EXP_DATE_MAIN - Maintenance Expiration Date *
*& 3. ISHT_MAINT_EXPIRED - Maintenance Expired Flag *
*&---------------------------------------------------------------------*
METHOD if_com_ioitf_ac~execute.
* -------------------------------------------------------------------- *
* Cast ApplicationContext container into your ApplicationContext
* container.
DATA: lo_appl_ctx TYPE REF TO cl_isht_refmod_edc_a VALUE IS INITIAL.
CALL METHOD cl_com_ioitf_casting_manager=>cast
EXPORTING
io = io_appl_context
CHANGING
co = lo_appl_ctx.
* -------------------------------------------------------------------- *
* Reset Maintenance Expired flag
DATA: lv_maint_expired TYPE isht_maint_expired VALUE IS INITIAL.
* -------------------------------------------------------------------- *
* Supply Support Level, Maintenance Expiration Date and Maintenance
* Expiration Flag.
* TRY.
CALL METHOD me->exe
EXPORTING
io_appl_context = io_appl_context
iv_level = lo_appl_ctx->isht_level
iv_exp_date_main = lo_appl_ctx->isht_exp_date_main
iv_maint_expired = lv_maint_expired.
* CATCH CX_COM_IOITF_ACTION .
* ENDTRY.
* -------------------------------------------------------------------- *
ENDMETHOD.
You register your actions with the IOITF as follows:
...
1. From the IMG, choose Customer Relationship Management à Master Data ® Products à Individual Objects à Individual Object Integration Framework (IOITF) à Action à Register Action
2. Specify the action name, description, and class.
3. Save your entry.
Below is the list of actions registered for the High Tech Software Entitlement Demo application.
IOITF Actions for HT Software Entitlement Demo
Action |
Description |
Action Class |
ISHT_AC_EXP_MAINT |
ISHT: IndObj RefModel - Expire Maintenance |
CL_ISHT_AC04 |
ISHT_AC_RVK_ENTIT |
ISHT: IndObj RefModel - Revoke Entitlement |
CL_ISHT_AC06 |
ISHT_AC_SET_MAINT |
ISHT: IndObj RefModel - Set Maintenance |
CL_ISHT_AC01 |
ISHT_AC_SET_REG |
ISHT: IndObj RefModel - Set Registration |
CL_ISHT_AC02 |
ISHT_AC_UPD_BIN_VER |
ISHT: IndObj RefModel - Update Binary Version |
CL_ISHT_AC03 |
ISHT_AC_UPG_PROD |
ISHT: IndObj RefModel - Upgrade Product |
CL_ISHT_AC05 |