!--a11y-->
Program in Process Model 
A program that you insert as a process step in a process model, rather than executing it directly.
You insert a program as a process step in a process model so that the system automatically executes it during a process.
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.

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.

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.
· 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 manager at 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.
· Include RPUPMDP3
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.
· Include RPUPMDP3
· Function module HRPY_PROCESS_FIRE_EVENT
· Function module HRPY_PROCESS_SET_PERNR_STATUS
· Function module HRPY_PROCESS_SET_ALL_PERNR_ST
See also:
Example: Program in Process Model
