Show TOC

 Workflow Template WS17900260: Save Form with Error Handling

Use

You can use this workflow template to have the data of a form automatically saved in the infotypes in the backend system, without a human user initiating the save.

You can use the workflow template if you do not want to give the last person to process the form data the extensive authorizations required to save the data securely on the database. If error messages arise in the backend system during automatic processing, you can have the data processed by an authorized expert.

This workflow template is intended for use only within a surrounding workflow template as a multistep task. You can use it without adjusting the standard version. If the standard version does not meet your requirements, you can copy it and adjust the copy.

Workflow Template: 17900260

ID: Sichern_Beh

Name: Save Form with Error Handling

Standard Tasks Used

Standard Task TS17900107: Check Form Data

Standard Task TS04200011: Wait Step

Standard Task TS04200007: Find and Lock Employee

Standard Task TS17900160: Forwarded Because of Errors

Standard Task TS17900108: Save Form Data

Standard Task TS17900110: Import Form Container to Workflow

Standard Task TS17900112: Instantiate BOR EMPLOYEET

Standard Task TS04200008: UnlockEmployee

Standard Task TS17900106: Check Existence of PA Infotype

Process

The system attempts to save the data.

If the system is able to save the data, the workflow template is completed. If the system is not able to save the data, it reacts as follows, depending on the cause:

Errors or warnings arise during the data check by the business logic. The system enters a work item in the expert's worklist for processing.

The default settings is that only serious errors (type ERROR) cause the save to fail. However, you can specify that an expert receives an interactive work item also in the case of warnings. You can also specify whether the system is to save the data first, despite the warnings.

The employee's data is locked for processing because the payroll is being run.

Logic is implemented in the workflow template for this scenario: The system now attempts to lock the personnel number multiple times an hour to save the data. You can set how often the system repeats the attempts in the workflow container.

Once the maximum number of attempts is reached, an expert receives a work item for processing.

If the system is able to lock the personnel number and then the save fails, due to inconsistent data, for example, an expert receives a work item to process the relevant form.

The employee's data is locked for maintenance because it is being processed in another application.

In this case, the system attempts to lock the personnel number itself until the lock is lifted by the other application.

The expert processes the data that the system was unable to save automatically.

You can specify that a particular expert receives the work item depending on the type of error.

For more information, see Error Handling.

Structure

Agent Assignment

Data is saved in the background by the user workflow batch.

If the system was unable to save the data, it determines the expert responsible on the basis of the type of error. You specify which agents receive the work item for which errors in Customizing for HR Administrative Services, under Configuration of Forms/ProcessesError Handling.

Authorization Check

Make sure that the WF Batch user and the experts have the required authorizations:

Authorization object P_ASRCONT: The activity R (READ) is used for the authorization check.

The relevant Personnel Administration authorization objects, such as P_ORGIN to check authorization for HR infotypes.

For more information, see Authorization Concept of HCM Processes and Forms.

Process Control

If you want to use this workflow template in a workflow step of a workflow template, you have to define a binding for the mandatory container elements of the WS17900260 template. If you do not assign any values in the binding for the optional importing container elements, the system uses the default value.

When you define the binding, you have the following options:

You can specify the values directly in the binding of this workflow template.

You can assign the container element of the workflow template the value of the corresponding container element of the surrounding workflow template. In the latter case, you have to create the element in the same data type in the surrounding workflow container. For information about the data type, you can double-click the corresponding element of the sub-workflow.

Data Flow: Import Elements

Container elements to control the logic implemented by the workflow template

Form (FORM) – Mandatory

You can use this element to specify the form scenario whose data you want to automatically save in the background. Note that all other form scenarios that have been processed but not yet saved are also saved at the same time.

This element consists of a structure with the following three fields:

FormScenario (FORM_SCENARIO) - mandatory

Enter the form scenario that is to be used within the workflow step.

VersionFormScenario (FORM_SCENARIO_VERSION) – mandatory

Enter the version of the form scenario that you want to be used.

Do Not Save Directly (SUPPRESS_SAVE) – optional

You can use this field to override the settings in the element SEND_VARIATION.

Enter an X here if the data is not to be written to the infotypes even if the value A (Check and Save) is set in the SEND_VARIATION element.

Enter nothing if the data is to be saved according to the settings in the SEND_VARIATION element.

Data type (Data Type tab page, ABAP Dictionary Data Type field): Type name HRASR00_FORM_KEY_ELEMENT

Mode in which manual processing takes place (HANDLING_MANUALLY) – optional

You can use this element to control the conditions under which an expert receives a work item for processing. The following values are possible:

ERROR (default setting)

If errors occur when the form data is saved, an expert receives a work item.

In the case of errors, the form data is not saved on the application database.

WARN_PREV

If errors or warnings occur when the form data is saved, an expert receives a work item. The system does not save the data to the application database, even if only warnings occur.

WARN_AFTER

If errors or warnings occur when the form data is saved, an expert receives a work item. If warnings occur, the system saves the data directly to the application database before the expert processes the work item.

Data type (Data Type tab page, ABAP Dictionary Reference): Structure HRASR00_PROCESS_MODELLING and Field HANDLING_MANUALLY

Maximum number of save attempts (COUNTER_MAX_PAYROLL) – optional

If the personnel numbers are locked by a current payroll run, the data cannot be saved. The system can then attempt to lock the personnel numbers itself every hour and to save the data.

You can use this element to specify the maximum number of times the system should attempt to lock the personnel numbers. The default limit is 26 (hours).

Data type (Data Type tab page, ABAP Dictionary Data Type): Type name INTEGER

Container elements to control the behavior of the interactive step for the expert.

Scenario Stage (FORM_SCENARIO_STAGE) - mandatory

You specify the scenario stage for the workflow step at which the form has to be processed by an expert if errors or warnings occurred on saving. You must have configured the scenario step in Customizing for the form scenario.

When defining the data flow in the workflow container, the system provides you with input help (F4) for the FORM_SCENARIO_STAGE field, which enables you to access your Customizing entries. You can use the value help in the Workflow column and, in the subsequent dialog box, the value help for the field in the Temporary Check Results of Table column.

Data type (Data Type tab page, ABAP Dictionary Reference field): Structure HRASR00_PROCESS_MODELLING and field FORM_SCENARIO_STAGE

Send Variant (SEND_VARIATION) – optional and button Save Draft (SAVE_DRAFT_BUTTON_VISIBLE) - optional

For more information about these container elements, see the Standard Task TS17900100: Edit Form documentation.

Container Definition: Export Elements

You will not usually have to use these export elements. You can however, add customer-specific implementations of functions and logic.

Processing Status (PROCSTATE) – Optional

Once the workflow template is completed, the PROCSTATE element contains the processing status of the last workflow step executed. This may be a different step, depending on the process flow within the workflow template.

The form data can be saved to the infotypes without problems. After the workflow template is completed, the PROCSTATE container element has the processing status of the step used to save the data in the background. It has the value PROCESSED.

Warnings occur when data is saved in the background. You specified in the Mode in which manual processing is carried out container element (HANDLING_MANUALLY) that an expert is to receive a work item to postprocess data only in the case of errors (ERROR). After the workflow template is completed, the PROCSTATE container element has the processing status of the step used to save the data in the background. It has the value WARNING.

Data type (Data Type tab page, ABAP Dictionary Reference field): StructureHRASR00_PROCESS_MODELLING and field PROCESSING_STATUS

Form Field EFFECTIVE_DATE - optional

The EFFECTIVE_DATE element contains the value of the form field of the same name of the form scenario that you specified for the FORM container element.

Data type (Data Type tab page, ABAP Dictionary Data Type): Type name DATUM

Error Category (ERROR_CATEGORY) – optional

If messages arise when the form data is saved, this container element contains the highest-priority error category.

For more information about prioritizing error categories, see Customizing for HR Administrative Services, and choose Configuration of Forms/ProcessesError Handling.

Data type (Data Type tab page, ABAP Dictionary Data Type): Type Name ASR_ERROR_CATEGORY

Error Messages (ERROR_MESSAGS) – optional

If messages were raised when saving the form data, this container element contains the messages that arose for the ERROR_CATEGORY category (see above).

Data type (Data Type tab page, ABAP Dictionary Data Type): Type Name HRASR00ERROR_INFO_TAB