Example for the steps given in this document: http://scn.sap.com/docs/DOC-28362
Defining interface and file format along with sample code to be written in file format.
To process employee’s time data i.e. reading ZL table of PCL2 (B2) and computing added hours for each wage type for an employee, updating Infotype 0415, updating payroll
record to next payroll period, sending the file to
application server. File has a header, body and a trailer record.
Assumptions: Required configurations for executing PU12 are done.
Define the interface format as per the master data and time data to be read. Here PCL2 (ZL) is read.
As only time data needs to be evaluated the attributes of the interface format should be like below:
2. Define the file format
Four blocks were used:
1. Begin of file: To define header structure of file (depends on the requirement). No user-exit implemented at this level.
2. During Processing of employee: To implement processing logic of calculating hours for a wage-type for an employee. (This can be entirely requirement specific).
User exit implemented at structure level for easy access to structure data.
Code Snippet of Report ZFIR_PYFILE:
Note: zfir_pyfile_1 is the include generated while defining file format and contains the types of all data being read at interface format and also structures defined at file format level.
Note: Any further subroutines created are in the same program ZFIR_PYFILE
3. After Processing Employee Data: After all the periods for an employee gets processed this block gets executed, once for each employee by default.
4. End of file: This block gets called after the entire employee’s data for all the employees gets processed.
With Payroll control records being maintained, on entering payroll area the current period dates can be seen by pressing enter. However, to run in some other
period ‘Other Period’ option has to be selected.
The screen can be scrolled down to see the export statistics as shown in the screenshot above.