Ansicht
Dokumentation

COM_IOITF_IMG_10 - Define/Create State Manager

COM_IOITF_IMG_10 - Define/Create State Manager

RFUMSV00 - Advance Return for Tax on Sales/Purchases   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.
SAP E-Book

In this IMG activity you determine which state managers will be used by your object families.

The state manager's role is to manage the life cycle of an object. State managers determine which action needs to be performed when certain event types occur. To do this, they look at the state of an object (for example, "sold") and determine an appropriate transition when an event type is raised.

Event types are defined as relevant or not to a state. If an event type is relevant to the state, when the event type is raised, the state manager fires a transition in response to the event type.

Transitions can both execute actions and change the state of an object (for example, from the state "available" to the state "sold").

The purpose of the state manager is to determine the appropriate transition to use when an event type is raised.

State managers are assigned to object families. There is one state manager per object family.

SAP delivers a state manager called the OITF State Manager which can be used as a template for creating other state managers.

If you determine that you can used the OITF State Manager for your object families, then no further action is required on your part.

If you determine that you need state managers in addition to the delivered OITF State Manager, you must create them yourself. Your state manager must conform to the state manager adapter, IF_COM_IOITF_SMA, specified by OITF.

Follow the guidelines below to create your own state manager.

  • Name your state manager, for example, CL_MY_STATE_MANAGER.
  • Using Class Builder (transaction SE24) create a Usual ABAP Class with the name CL_MY_STATE_MANAGER.
  • On the Interfaces tab specify IF_COM_IOITF_SMA.
  • On the Methods tab double-click on the method IF_COM_IOITF_SMA~DETERMINE_TRANSITION. Put necessary code here.

Given the application context this method returns a transition object (conformant to the transition, CL_COM_IOITF_TR, specified by OITF).

METHOD if_com_ioitf_sma~determine_transition.

* 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.

* --> Begin: Put your code

* You can access the information in Application Context as follows -

* lv_iobj_guid = lo_my_appl_ctx->iobj_guid.

* ...and so on!

* --> End: Put your code

* Create your own Transition

DATA: lo_my_transition TYPE REF TO cl_my_transition

                         VALUE IS INITIAL.

  CREATE OBJECT lo_my_transition

    EXPORTING

      iv_av = lv_action

...

.

* Return Transition

  ro_tr ?= lo_my_transition.

ENDMETHOD.

  • You are free to model your class however you want to.
  • Save and activate your state manager.
  • Register your state manager with OITF in the IMG activity Register State Manager.
  • Assign you state manager to the object's object family using the IMG activity Assign State Manager to Object Family. Associate class CL_MY_STATE_MANAGER with the object's object family.






TXBHW - Original Tax Base Amount in Local Currency   ABAP Short Reference  
This documentation is copyright by SAP AG.

Length: 5302 Date: 20240523 Time: 183052     sap01-206 ( 61 ms )