AH025 - 0 - Learn First - Process Model
AH025 - 0 - Learn First - Process Model
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.
Optional Read:
https://blogs.sap.com/2015/06/24/customize-hr-process-workbench-pust/
● 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
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.
------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.