Ansicht
Dokumentation

HRASR_PROCESS_EXECUTE - Process execute RFC

HRASR_PROCESS_EXECUTE - Process execute RFC

BAL Application Log Documentation   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

This function module can be used to execute the HR processes created with the HCM Processes and Forms (HCM P&F) Design Time Tool (DTT). Processes can be started programmatically without the aid of the Webdynpro ABAP (WD ABAP) based start applications. This function module can be invoked from custom applications.

The importing parameter IV_EVENT is very important and must always be passed. The function module reacts based on the event passed and invokes the corresponding HCM P&F backend operations to operate on the form data. The different values for the parameter IV_EVENT are as follows:

  • INITIALIZE - Initialize form data. The field values returned from the infotype framework will be passed back. Use constant if_hrasr00_ui_constants=>c_event_initialize.
  • CHECK - Check form data. Use constant if_hrasr00_fpm_constants=>c_event_check.
  • SAVE_DRAFT - Save the form as a draft for processing later. The form data is submitted to the backend. Use constant if_hrasr00_fpm_constants=>c_event_save_draft.
  • SEND - Submit the form data to the HCM P&F backend. Use constant if_hrasr00_fpm_constants=>c_event_send.
  • APPROVE - Approve a workitem. The workitem is submitted to the backend for further processing based on the workflow. Use constant if_hrasr00_fpm_constants=>c_event_approve.
  • REJECT - Reject a workitem. The workitem is submitted to the backend. Use constant if_hrasr00_fpm_constants=>c_event_reject.
  • CONTINUE - Submit the form inspite of errors. Use constant if_hrasr00_fpm_constants=>c_event_continue.
  • FORWARD_TO_EXPERT - Forward the form to an expert for further processing in case of form errors. Use constant if_hrasr00_fpm_constants=>c_event_fwd_expert.
  • DELETE_DRAFT - Delete a draft workitem. Use constant if_hrasr00_fpm_constants=>c_event_delete_draft.
  • BACK_TO_USER - Send the workitem back to the user. Use constant if_hrasr00_fpm_constants=>c_event_back_to_user.
  • BACK_TO_AUTHOR - Send the workitem back to the initiator. Use constant if_hrasr00_fpm_constants=>c_event_backto.
  • WITHDRAW - Withdraw a process. Use constant if_hrasr00_fpm_constants=>c_event_withdraw.
  • ADD_ATTACHMENT - Add an attachment. Use this event to add attachments. Use constant if_hrasr00_ui_constants=>c_event_add_attachment.
  • DELETE_ATTACHMENT - Delete an attachment which as already been attached. Use constant if_hrasr00_ui_constants=>c_event_del_attachment.
  • GET_ATTACHMENT - Get the list of attachments for a particular workitem. Use constant if_hrasr00_ui_constants=>c_event_get_attachment.
  • GET_LINK_LISTS - Get the list of link lists. Use constant if_hrasr00_ui_constants=>c_event_get_link_list.
  • GET_HISTORY - Get the previous processors of the process's workitems. Use constant C_EVENT_GET_HISTORY_DETAILS.

The typical sequence of events that must be passed to the function module during the execution of a process is as follows:

  1. INITIALIZE - It is mandatory to invoke the function module with the INITIALIZE event before any further processing can be performed. This applies to both launching a workitem as well as starting a new process.
  2. CHECK - After users have made changes to the form data, a CHECK event can be fired to the backend to check the form data. Invoke the function module with the parameter IV_EVENT = 'CHECK'. If there are any errors, warnings or information messages returned from the infotype backend business logic, these will be filled in the parameter ET_MESSAGES.
  3. User events - Any user events configured for a form scenario stage in the Design Time Tool (DTT) can be passed for execution.
  4. SEND - After executing the CHECK if there are no errors, the form data can be submitted to the backend, for further processing. Invoke the function module with the parameter IV_EVENT = 'SEND'.

Initialization

Before you execute the process, the form fields must be initialized based on the field default value configuration configured in the DTT. To initialize the form fields, the function module must be invoked with the following parameters:

When starting a new process:

,,IV_PROCESS

,,Specify the full (technical) name of the process (as it appears in the DTT). Do not specify the process ,,description.

,,IV_OBJECT_KEY

,,The personnel number of the employee in the case of Personnel Administration (PA) ,,,,,,,,,,processes or the object ID of the Organizational Management (OM) in the case of OM ,,,,,,,,processes.,,

When launching a workitem:

,,IV_WI_ID

,,Specify the workitem ID of the workitem being launched.

Apart from the parameters mentioned above, the following parameters must be passed in both the cases.

,,IV_INITIATOR_ROLE

,, Specify the initiator role. If no value is passed the function module uses the default (HRASRA - HR ,,Administrator).

,,IV_EVENT

,, This parameter indicates the event to be executed. Pass the value INITIATLIZE to initialize the ,,,,,, ,,form. Use constant if_hrasr00_ui_constants=>c_event_initialize.

,,IT_SELECTED_FIELD

,,Contains the list of fields for which the help data must be retrieved. The corresponding data will be returned in ,,the exporting parameter CT_INPUT_HELP_VALUES.

The following parameters are returned if the initialization is successful:

,,EV_IS_OK

,, Contains a value of ABAP_TRUE (X) if the initialization is successful. This parameter contains a value of ,,ABAP_FALSE if there were errors during initialization.

,,ET_MESSAGES

,,This parameter contains the messages returned from the HCM P&F backend framework.

,,CT_FORM_FIELD_VALUES

,,Contains the list of form scenario fields along with their values.

,,CT_INPUT_HELP_VALUES

,,Contains the input help values returned from the HCM P&F backend framework.

,,CT_FIELD_UI_ATTRIBUTES

,,Contains the UI attributes for fields based on the DTT configuration.

,,CT_EVENTS

,,The different events such as CHECK, SEND, SAVE DRAFT and so on, that can be performed ,,,,,, ,,on the form. Any user events configured in DTT for the form scenario stage are also returned in ,,,,,, ,,this table.

,,CT_LINK_LISTS

,,Returns the link list configured for the form scenario stage.

,,CT_HISTORY_DETAILS

,,In the case of workitems, returns the previous processors of the workitem.

Checking form data

The function module must be invoked with the following parameters to check form data (analogus to the 'Check and Send' button in the start process WD ABAP application).

For a new process:

,,IV_PROCESS

,,,,Specify the full (technical) name of the process (as it appears in the DTT). Do not specify the process ,,,,description.

,,IV_OBJECT_KEY

,,,,The personnel number of the employee in the case of Personnel Administration (PA) ,,,,,,,,,,processes or the object ID of the Organizational Management (OM) in the case of OM ,,,,,,,,,,processes.,,

For a workitem:

,,IV_WI_ID

,,,,Specify the workitem ID of the workitem being launched.

,,IT_SELECTED_FIELD

,,Contains the list of fields for which the help data must be retrieved. The corresponding data will be returned in ,,the exporting parameter CT_INPUT_HELP_VALUES.

In addition to the parameters mentioned above, the following changing parameters must be passed to the function module:

,,CT_FORM_FIELD_VALUES

,,List of form scenario fields along with the values filled in. After the CHECK event is processed, new field values ,,returned from the backend business logic are available in this table, if no errors are encoutered.

,,CT_INPUT_HELP_VALUES

,,Contains the input help values returned from the HCM P&F backend framework.

,,CT_FIELD_UI_ATTRIBUTES

,,Contains the UI attributes for fields based on the DTT configuration.

,,CT_EVENTS

,,In addition to the events such as CHECK, SEND, SAVE DRAFT which are allowed on the form, events such as ,,'Forward to expert' are appended if there are errors returned from the HCM P&F backend framework when ,,checking for the form data (subject to nature of error messages and send variation configured in the DTT).

The following export parameters are returned:

,,EV_IS_OK

,, Contains a value of ABAP_TRUE (X) if the processing was successful. This parameter contains a value of ,,ABAP_FALSE if there were errors during initialization.

,,ET_MESSAGES

,,Contains the messages returned from the HCM P&F backend framework.

Executing a user event configured in DTT

User events which are configured for a particular form scenario stage can be executed by invoking the function module with the form data and input help data. The name of the user event must be passed in the parameter IV_EVENT. Any messages returned by the backend framework are returned in the parameter ET_MESSAGES.

Submitting form data

Events such as SEND, APPROVE, SAVE_DRAFT, CONTINUE, FORWARD_TO_EXPERT, REJECT, BACKTO, BACK_TO_AUTHOR and DELETE_DRAFT submit the form data for further processing by the backend.

The process reference number is returned in the parameter EV_PROCESS_REF_NUMBER when the form is submitted to the backend with the event specified as SEND. It must be noted that this is applicable only in the case of a new process. When a workitem is submitted, the process reference number is not returned and an appropriate message is returned by the framework instead.

The parameter EV_CONFIRMATION_TEXT is filled with the confirmation text configured in DTT based on the language the user is logged in with.

Example

Notes

Further information





Parameters

CT_ATTACHMENTS
CT_EVENTS
CT_FIELD_UI_ATTRIBUTES
CT_FORM_FIELD_VALUES
CT_HISTORY_DETAILS
CT_INPUT_HELP_VALUES
CT_LINK_LISTS
ET_MESSAGES
EV_CONFIRMATION_TEXT
EV_IS_OK
EV_PROCESS_REF_NUMBER
IT_SELECTED_FIELD
IV_ASYNC_BACKGROUND_SAVE
IV_EVENT
IV_INITIATOR_ROLE
IV_OBJECT_KEY
IV_PROCESS
IV_UPDATE_IN_SAME_TASK
IV_WI_ID

Exceptions

Function Group

HRASR_SERVICES

PERFORM Short Reference   General Data in Customer Master  
This documentation is copyright by SAP AG.

Length: 13111 Date: 20240523 Time: 094540     sap01-206 ( 143 ms )