Configuring Action Type Handlers

Objective

After completing this lesson, you will be able to assign action type handlers in SAP S/4HANA PEO for effective operation management.

Action Hook Framework

The action hook framework (AHF) is a mechanism in SAP S/4HANA PEO that allows customers and partners to enhance the logic of how an action is executed by applying implemented methods. The action hook framework provides a flexible and configurable means of defining and executing sequences of action handlers that the system executes when a user selects an action.

To configure the action hook framework, choose Customizing (transaction SPRO) under Production Manufacturing for Production Engineering and OperationsProduction OperationsAction Processing in activityDefine Action Handlers.

Screenshot of customizing activity with Define Action Handlers highlighted

In this Customizing activity, you can assign action handler classes to action handlers, assign action handlers to object types and actions, and specify whether the system can execute the action handler before or after it performs the action.

Action Handlers and Action Handler Classes

Action handler classes are ABAP classes containing business logic, such as checks, executed when a user performs an action. An action handler class is assigned to an action handler, which determines when and for which objects the logic can run. For instance, an action handler class checks if planned components match assembled quantities for serialized materials, raising exceptions if there's a discrepancy. The action handler specifies that this logic applies to operation activities and must be executed before actions like Complete.

The following figure lists all action type handlers that are delivered out-of-the-box with SAP S/4HANA PEO:

  • Object type 1 means that the type handler is applicable to an operation activity.
  • Object type 4 means that the type handler is applicable to a serialized material in operation activity.
screenshot of change view action handler overview

Action Assignment defines recommended and logically-relevant actions for an action type handler. The assignment can be modified if necessary or added if a new type handler has been introduced in the system.

screenshot of action assignment

Processing Points

Processing points are the locations in the coding of an action where a sequence of handlers is triggered. SAP provides the following processing points:

Processing PointDescription
Preprocessing (PR)The action handler sequence is called at the beginning of an action before all other coding is executed.
Postprocessing (PO)

The action handler sequence is called at the end of an action after all other coding has been executed.

Action handlers assigned to postprocessing point are internally called "fire and forget". The system will trigger an activity (for example, send document to a print server) after the action (for example, Complete) has been executed, but will not expect and get any result (whether printed or not) back.

In Customizing, you enable each action handler to be called at a processing point.

screenshot of action handler view settings

Action Handler Order of Execution and Parameters

You can create sequences of action handlers so that you can execute multiple action handlers when a user performs a single action. In addition, you can overwrite the default parameters that are defined in Customizing.

Action type handlers are the most convenient and reliable way to extend SAP S/4HANA PEO with custom logic – be it checks before a certain action executes, or activities that can be triggered after the action has been performed. How to define a new type handler.

Assignment of Type Handlers to Actions

In SAP S/4HANA PEO, you can assign type handlers to actions in the following SAP Fiori apps:

  • Manage Action Settings
  • Manage Shop Floor Routings

In the Manage Action Settings app, the user first selects a plant, an object type, and then an action where the action handler has to be assigned. Then the system allows the user to specify the following:

  • OA Segment type: A type of an operation activity within an operation, for example, Setup, Produce, Teardown.
  • Type Handler Processing Point: When the logic is to be triggered – before or after the action executes.
  • Execution Sequence: The order in which action handlers will execute if more than one is assigned to an operation activity. "Sequence" here has more a technical meaning. For the end user it makes no difference, because if at least one check defined in any action handlers fails, the complete action is rolled back.
  • Action Type Handler: The logic itself defined by the associated ABAP class.
  • Action Handler is Active: Defines whether the assigned action handler shall be executed or not.

Note

To be able to access the Manage Action Settings app, make sure your user has been assigned the SAP_BR_PRODN_PROC_SPCLST_EPO (Production Process Specialist (EPO)) PFCG role in the front-end system. To be able to access the Manage Shop Floor Routings app, make sure your user has been assigned the SAP_BR_PRODN_ENG_DISC_EME (Production Engineer - Discrete Manufacturing (EME)) PFCG role in the front-end system.

screenshot of Manage Action Settings

Points to note:

  • Action handlers defined in the Manage Action Settings app are plant- and object-type-specific, meaning that they are called every time an action is performed on the specified object, independent of an operation activity.
  • In the Manage Shop Floor Routings app, the user first selects a routing, then an operation activity, and then the Action Handlers view in the Details workspace. There, the system allows the user to add, change, and delete action type handlers defined for an operation activity. To add a new type handler, the user chooses the Add button and specifies all the same properties explained in this lesson.
  • The main difference this assignment has is that this action handler is plant-, routing-, object-type-, and operation-activity-specific, meaning that it is called only when an action is triggered at the specified operation activity.
Screeenshot of add action handler

In the Action Handlers view, the system shows the Source of an action handler; in other words, where this action handler has been defined:

  • Routing – in a routing for an operation activity
  • Plant – for an action within a plant
Screenshot highlighting the source in rge add action handler

Description of Action Handlers in S/4HANA PEO

In SAP S/4HANA Manufacturing for production engineering and operations, various action handlers are designed to enforce specific checks and validations during the production process.

CHECK_COMPONENT_AVAILABILITY

This action handler checks whether a serial number, scanned or entered during assembly, exists in stock and if not, prevents the component to be consumed at an operation activity or into serialized material in operation activity.

This type handler may not be required anymore, as starting from 1909 FPS1, the configuration of the serial number profile is taken into account.

Serial Number Profile settings screenshot

Serial number profile (check against stock):

This setting defines how the Perform Operation Activity app will react on the entry of SN that does not exist in the inventory. We differentiate 3 values here – error, warning, and no stock check for the profile.

  • Error: If a serial number does not exist in stock, the error is displayed on assembly and the user cannot continue.
  • Warning: If a serial number does not exist in stock, the warning dialog will show up with the option to continue.
  • No stock check: No check against stock is performed during assembly. No warnings or error dialogs. The system will always allow to consume the serial number. Later, if there is a failed material movements occur, the user can correct them in the Reprocess Failed Material Movements app.

CHECK_COMP_ASSEMBLED_QTY

This action handlers checks that the consumed quantity of a component exactly matches the required planned quantity of the component at an operation activity.

CHECK_REWORK_STS_AT_GOODS_MOVT

This action handler is used for non-serialized rework scenario, where we relax all quantity checks during execution, plus the user can decide at which operation the goods receipt (manual or automated) shall be performed. We recommend this type handler to be used at the "last" operation, where the goods receipt shall happen and where the user shall enter all actuals they really have on hand and reconcile inconsistencies. The action handler will check that all rework operation activities have been completed before performing the goods receipt. Available from 1909 FPS1.

CHECK_ACTUAL_QTY_AT_REWORK

This action handler is used for non-serialized rework scenario and checks that quantities that are processed at rework and are not more than the reported defective quantity. For example, if during defect recording the user specifies defective quantity as 3 out of 10, then the system will check at rework operation that no more than 3 can be started and used as planned qty. Available from 1909 FPS1.

CHECK_DEFECT

This action handler checks that there are no defects with the status "Open" exist for the current operation activity or serialized material at the operation activity.

CHECK_INSPECTION_CHARACTERISTICS

This action handler checks that the inspection results recorded for all the ‘Required’ inspection characteristics which are specified as "Critical Characteristic" are collected at an operation activity or for a serialized product in the operation activity.

screenshot of Critical Characteristic

CHECK_OAC_COMPONENTNS_ASSIGNED

This action handler checks if the components are assigned to an operation activity and if yes, will not allow to skip the operation activity during production execution.

CHECK_OVER_DELIVERY

This action handler checks whether the confirmed operation activity quantity does not offend against the over delivery tolerance of the order.

CHECK_UNDER_DELIVERY

This action handler checks whether the confirmed operation activity quantity does not offend against the under delivery tolerance of the order

CHECK_DURATION_ST_CP

This action handler can have additional parameters specified for it such as "Duration" and "Unit". If the value for the duration is entered and the action handler is assigned to an operation activity or serialized material at an operation activity, the system will check that the time elapsed between the Start and Complete action corresponds to the pre-defined time in the action handler. If this does not match, the system will display an error at the processing point where the action handler is assigned.

screenshot of action handler parameter showing check duration parameter

Action Assignment defines recommended and logically-relevant actions for an action type handler. The assignment can be modified if necessary or added if a new type handler has been introduced in the system.

Summary

This lesson covers the assignment and management of action type handlers in SAP S/4HANA PEO to enhance operational processes.

  • Use the action hook framework to execute custom logic during action transitions.
  • Assign action type handlers to specific processing points before or after actions.
  • Customize handler execution order and modify parameters for precise operational control.
  • Utilize SAP Fiori apps to assign handlers based on plant, routing, and operation activity needs.
  • Enforce checks with action handlers to validate components, quantities, and inspection results.