SAP HCM Processes and Forms is a highly flexible framework that allows automating business processes and is available for direct online user entry. The most powerful features of SAP HCM P&F include Configuration of SAP delivered services (SAP_PA, SAP_PD and SAP_PT), Rich UI and Integration with different UI technologies, enhancements for extended customer-specific validations, and complex business process flow. As part of the frame work capabilities, SAP has provided functionalities like Generic Services, User Events, Rules, and Attachments to design an effective HR Process.
User Events play a vital role in SAP HCM Processes and Forms. With the release of EHp2, along with SAP defined events ‘Initialize’ and ‘Check’, we can also define our own Custom Events specific to each process separately in the design time work bench (Transaction: HRASR_DT).
Initialize Event: Initialize event refreshes the form and provides defaults values & help values based on the field contents of the forms fields.
Check Event: Once Check event is triggered, all fields on the forms will be passed to backend to check for errors and calculate any fields values (if required).
Here in both events all forms fields will be sent to backend and form will precede to next step (2 or 3) based on the user input. In order to determine or calculate a set of fields dynamically while entering data (In step 2), we should define a custom user event for that field group.
User Event Definition:
A User Event is defined for a subset of form fields. These fields are grouped under a field group and it is linked to an operation. Here operation defined is different from operation defined for info objects in form scenario.
- Raise error message by validating the data entered by user on form.
- Check data entered by user and calculate derived data without moving to next step.
- Search functionality to find values for other fields based on user entered data.
- Dynamically determine drop down (help values) based on data selected/entered in other fields.
- Partially Initialize forms without clearing all user entered values (default values for a set of fields).
Let us take a scenario where we have two drop down fields and help values of second drop down are dependent on first drop down selection. Once the value in first drop down is selected the user event will be triggered and help values for the second drop down will be determined. We cannot achieve this functionality without defining a custom event. Likewise we can use this for “Search” functionality and default values based on value selected in drop down fields.
Steps to Create User Event:
Step 1: Define User Event- Nothing but Operation name and description.
Step 2: Define Field Group.
Step 3: Select Form fields which are needed to be updated or validated during that user event call
After selecting values, Press Enter. Fields assignment will be updated as shown below.
Step 4: Assign field group to the user event with processing type ‘Check’. Click ‘Field Group’ to select from help values.
Press F4 to get the Field group created in previous steps.
Based on your requirement you have to select ‘Initialize’ or ‘Check’ processing type and Errors check
box. In our scenario we have selected ‘Check’ Processing type and Ignore Errors.
After selecting values, press Enter. Field group assignment will be updated as shown below.
- While selecting fields to field group, select mandatory fields like PERNR, MASSG, MSSN in SAP_PA and LEAD_OBJECT_ID in SAP_PD if they are part of form scenario services.
- After defining User Event, if any of the field involved in user event are to be removed from Form Scenario. First deselect the field in Field group and then remove from the form scenario.
User Event can be used to determine or calculate values without using SAP events and to pass a subset of fields to backend. This article throws some light on the basic concept of User Events and uses. For more information, please look into the below links and also contact at the above email ID.