0% found this document useful (0 votes)
62 views

AH025 - 0 - Learn First - Process Model

A process model in SAP HR allows automating payroll processing steps. It starts with a selection program that triggers events and transfers control to a process manager. Programs included in a process model must include specific function modules and use a workflow container to share data between steps. The container holds data from previous steps that is transferred to selection screens and available for subsequent steps.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

AH025 - 0 - Learn First - Process Model

A process model in SAP HR allows automating payroll processing steps. It starts with a selection program that triggers events and transfers control to a process manager. Programs included in a process model must include specific function modules and use a workflow container to share data between steps. The container holds data from previous steps that is transferred to selection screens and available for subsequent steps.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Process model in SAP HR

A process model starts with a selection program. The selection program can be
started in the background or directly from the HR Process Workbench . It
triggers the JOB_STARTED workflow event, starts the process, and transfers
process control to a function module, which is otherwise known as the process
manager.

A process model allows you to automate payroll processing steps, e.g.


regular payroll, off-cycle post processings etc.

● Use tcode PEST to create/maintain process models and PUST to


start/view
the processmodel and the corresponding processing steps.

Optional Read:
https://blogs.sap.com/2015/06/24/customize-hr-process-workbench-pust/

Must read: debugging process model:


https://blogs.sap.com/2013/07/22/debugging-a-process-model/

The programs you want to include in a process-model need to have


specific function modules
to read and set a “container” which is used in the automatic processing.
This container holds the employee numbers and a status for each.

● Include RPUPMDP3
● Function module HRPY_PROCESS_FIRE_EVENT
● Function module HRPY_PROCESS_SET_PERNR_STATUS
● Function module HRPY_PROCESS_SET_ALL_PERNR_ST

You use a workflow container for a program in a process model . The program
stores data in the workflow container so that it can be made available to other
programs.
To use the workflow container, proceed as follows:
In the first process step, use the macros SWC_SET_ELEMENT and
SWC_SET_TABLE to put the required program data into the workflow container.
The macros are contained in include <CNTN01>. The macros use the following
transfer parameters:
Name of container
Name of element or table
Value or table contents to be transferred

Program in Process Model


Definition
A program that you insert as a process step in a process model, rather than
executing it directly.

Use
You insert a program as a process step in a process model so that the system
automatically executes it during a process.

Structure
You can use the following types of program in a process model:

● Programs that process personnel numbers and use one of the following
logical databases to do so:
○ PNP (HR master data)
This includes logical database PNP for HR master data and
logical database PNP with the selection screen variant for
Payroll .
○ PNPCE (HR master data (including Concurrent Employment))
● Programs that do not use a logical database and do not process
personnel numbers
● Programs that do not use a logical database but do process personnel
numbers
The following applies to all types of program: if the program needs to provide
data to other programs in the process model, it must store this data in a workflow
container .

Note

You must not use Human Resources to change programs that belong to other
components, such as Financial Accounting . If you want to use a different
component’s program in a process model, you must create a main program.
Program H99_RFF_FRAME (Main Program for Calling RFFO*_C) is an example
of a main program. It is used to access an Accounting program for creating
payment media.

See below for an overview of the elements that programs of various program
types must include.

Note

All of the elements listed below determine whether the program is accessed
within a process model at all. Therefore, you are not required to use statement
IF NOT PYPARAID IS INITIAL to check this explicitly before an element is
called. However, you can use the statement to prevent the function group from
being loaded to the memory.

Programs That Process Personnel Numbers Using a Logical Database


● Function modules for checking personnel numbers
Every program that processes personnel numbers must check that a
personnel number has been successfully processed by the program.
This is necessary because the HR Process Workbench includes status
management for personnel numbers as well as flow control. To perform
this check, you use the following function modules:
○ HRPY_PROCESS_SET_PERNR_STATUS
Sets the status for a personnel number.
○ HRPY_PROCESS_SET_ALL_PERNR_ST
Sets the status for a group of personnel numbers.
● Function module HRPY_PROCESS_FIRE_EVENT
Returns control to the process managerat the end of a program.
However, you only need to use this function module if you conclude the
program with a LEAVE statement because the program is then unable
to reach the logical database. If you do not conclude the program with a
LEAVE statement, the logical database ensures that the function
module is accessed.
Programs That Do Not Use a Logical Database And Do Not Process Personnel
Numbers
● IncludeRPUPMDP3
This include contains parameter PYPARAID. This parameter is declared
with NO-DISPLAY, which means its input field is hidden from the
selection screen. It is needed for communication between the program
and the process manager.
The include also contains the declaration of container
PY_PM_CONTAINER.
● Function module HRPY_PROCESS_FIRE_EVENT
You must always access function module
HRPY_PROCESS_FIRE_EVENT in programs that do not use a logical
database.

Programs That Do Not Use a Logical Database But Do Process Personnel


Numbers
● Include RPUPMDP3
● Function module HRPY_PROCESS_FIRE_EVENT
● Function module HRPY_PROCESS_SET_PERNR_STATUS
● Function module HRPY_PROCESS_SET_ALL_PERNR_ST

------ON Comtainer----
In the program’s selection screen, the system overwrites data that originates
from the process model’s selection program with data that originates from the
workflow container. It proceeds as follows:
The system first overwrites the data contained in the program’s variant with the
data you specified when executing the selection program.
It then takes from the workflow container of the previous step all of the data for
which a selection criterion of the same name exists on the selection screen, and
inserts it in the selection screen. If the selection program has already written data
to one of these fields, it is overwritten.
The system follows this sequence because data created during a process run is
more up-to-date than the data you entered when creating the process model and
starting the process.
If you require data from the workflow container for the program belonging to the
subsequent step, and if a selection criterion of the same name does not exist for
this data on the selection screen, call the workflow container at the start of the
START-OF-SELECTION event by using function module
HRPY_PUST_GET_CONTAINER. To import the data from the workflow
container, use the macros SWC_GET_ELEMENT and SWC_GET_TABLE.
The program assigned to the subsequent step processes the data from the
workflow container and changes it if necessary. If the selection screen includes a
selection criterion for the data that has the same name, the workflow container
automatically forwards the changed data to the next process step.
If you want to transfer additional data from a process step to the next step, you
must store it in the workflow container by using the SWC_SET_ELEMENT and
SWC_SET_TABLE macros.

At the end of a process step, data from the previous step that is not transferred
back to the workflow container is not available to the subsequent step. However,
this only applies to data for which no selection criterion with the same name
exists on the selection screen.
If you do not transfer the workflow container to the subsequent step at all at the
end of a process step – that is, if you do not specify it in the interface of function
module HRPY_PROCESS_FIRE_EVENT – the data in the workflow container is
not lost. Instead, the subsequent step uses the data from the process step prior
to its previous step. If the subsequent step has just one previous step, it uses the
data from the selection program provided that it uses the workflow container. If
this is not the case, it means there is no workflow container that can be
transferred to the subsequent step.

You might also like