The SAP HR Forms Workplace enables you to create custom reports for HR master data, personnel time data, and payroll results with an attractive design layout. In the examples used in this article, the focus is on SAP Payroll systems in the US and Switzerland, but the processes for other countries are similar.
In the following sections, I highlight the most important features for generating PDF payslips and present an overview of how to use the HR Forms Workplace. I show users how to get the most benefit from the HR Forms functionality, in terms of:
- Making sure that all the data structures are well designed (such as organizational structures, periods, employee details, payroll data, and wage type structures)
- Ensuring that the layout and interface are independent so that you can make changes in the layout of your payslips without touching any data
- Enabling you to have different layout options with a single interface (using the same data processing)
- Making the layout of the forms user-friendly and readable—what you see is what you get
Steps for Creating a New Custom SAP HR Form Payslip
The first step is to create a new HR Form for your payslips. (The details for configuring payslips, HR Forms enhancements, and options are out of the scope of this article, but you can read about this in more detail in my other HR Expert article, “Tips to Ease Configuring of Payslips with SAP HR Forms Workplace.”)
The HR Forms Workplace helps you create your own reports and edit forms while at the same time giving you access to a large amount of data, including payroll data and time data. You can access the HR Forms Workplace to start creating and designing forms by executing transaction code HRFORMS (Figure 1).
The overview screen of the HR Forms Workplace
The HR Forms Workplace is divided into three different sections:
- The overview screen shown in Figure 1
- The data-maintenance screen (HR Forms). The data in my example is Pay Results.
- The form-maintenance screen (Form Builder), which is an SAP form designer with a graphical tool
In the screen in Figure 1, select standard form SAP_PAY SLIP_USCE and click the copy icon to copy it to custom form ZAP_PAY SLIP_USCE. In this way, you can create custom forms that add elements such as your company’s logo or design forms and include custom fields relevant to your company.
When you click the copy icon (boxed in red in the figure), the screen in Figure 2 opens in which you enter a name for your form (in this case, ZAP_PAYSLIP_USCE) and specify the country grouping for your custom Z_form. Once you’ve made your entries, click the green checkmark icon to save them.
Copy the HR Forms to a custom Z-form, specifying the country grouping, and click the checkmark icon
Customize the New HR Form
The next step is to change the settings for your new HR form so that fields that need to be displayed can be selected based on the business requirement. Then, after activation, you can generate the print program.
Back in the screen in Figure 1, select the new form you created, ZAP_PAY SLIP_USCE, and double-click to open it (or select it and click the execute icon ). The Change HR Forms screen in Figure 3 opens, showing all the standard parameters and structures in the InfoNet. An InfoNet is a set of data you select to print on your form.
Select the data to be included on the printed custom Z form
In the screen in Figure 3, select the data that you want printed in your custom Z form─for example, PAY_ABSENCES on the left. The goal here is to activate all the required components that you want to include and print in your form, specifically taking advantage of the SAP-generated objects, such as the driver report and form. The driver report is the selection screen that SAP generates for you to mass print or display payslips.
Once you’ve made your selections, click the Activate button in the ribbon to save and activate your new custom form. This action opens the screen in Figure 4. The activation process helps you to update the structure in the background with the new fields you have added in your InfoNet.
Select the items to display in the custom print program
In Figure 4, you see the different tabs that contain information for the forms and structures used.
The driver print program is under the HR Form tab, but first go to the Select. (Selection) Screen tab. Here you can select the fields (using the check boxes on the right) that you want to be displayed by default based on your business requirements. After activation, you can generate the print program. In this example, I select four automatic field settings.
In this example, the selection of the Number of Employees per Form (0= All) check box causes this selection to be displayed as an input parameter in the print report.
In Figure 4, if you select the check box next to the Include retroactive accounting: no, yes, also ‘retr accg runs’ field, the system determines how retroactive accounting is done within the calculation.
The default values for this are as follows: 0 only the original accounting period is run, X the original and the retroactive accounting period are run, and blank means that only retroactive accounting is run. In this case, I enter X and press Enter.
When you create a new HR Form, the data-selection step and form-layout settings are made separately. In data selection, you use MetaNet and InfoNet to select the data that needs to be printed in the Adobe PDF form. (The MetaNet screen is on the left of Figure 5; the InfoNet screen is shown on the right of the figure.)
Drag and drop the data and its objects from the MetNet section to the InfoNet section
To add new metadata to the InfoNet screen, select the InfoStars tab on the right (Figure 5) and just drag and drop the folder and its objects, as shown in Figure 6.
After dragging and dropping, you see all the fields you need to print in your forms on the right side
To use custom metadata, execute transaction code HRFORMS_METADATA. (For more information about creating custom metadata follow this link.)
To create your own InfoNet (e.g., ABAP structure, form definition, and print report) that includes the required Infostars and InfoDimensions, follow these steps:
- In the left overview tree of Figure 5, expand the MetaNet node SAP_DEFAULT (all the data sources in SAP ERP HCM).
- In the right overview tree, expand the InfoNet ZAP_PAYSLIP_USCE node. Using drag-and-drop functionality, drag the absences information from the MetaNet to the InfoNet (Figure 5).
Note: For more information use transaction code HRFORMS_METADATA to maintain your InfoNet with additional tables and structures if they do not exist in the SAP system. Your system is probably set by default with the SAP MetaData. In general, SAP delivers enough standards objects to display in the form so that, in most cases, you won’t need to create custom metadata.
I recommend you start by copying HR Form SAP_DEFAULT to HR Form ZCUSTOM. Then you need to update the Metanet field in Figure 7. (I do not go into detail here about how to do this as most of these settings are set by default based on your company’s requirements.)
Enter SAP_DEFAULT in the MetaNet field to update it
Create a Print Program and Activate the New Custom Payslip Form
The next steps are to create the print program and to activate the new custom payslip form. Execute transaction code SFP. In the Form Parts section of the screen that system displays (Figure 8), activate the SAP Form ZPYXXFO_ZAP_PAYSLIP_USCE by selecting it and clicking the Activate button.
The report is not yet generated and the Adobe form is not ready
Note: Before you activate your HR Forms, the print report is not yet generated, and the Adobe form is also not ready to use, indicated by the status of red.
Figure 8 shows you that the structure /1PYXXFO/ZAP_PAYSLIP_USCE is generated and initially is activated (see the green button in Figure 8), but you still need to activate the form and generate the print report. To change the status from Inactive to Active, you have two different methods: A and B. The first one has two steps to activate the form and the print report separately, but with the second one, you activate all components at once.
A. Activate objects separately by following these steps:
- Click the Layout button in Figure 8. The system then opens a screen in which you activate form ZPYXXFO_ZAP_PAYSLIP_USCE by selecting it and clicking the activate icon (Figure 9). Use transaction SFP to go to the screen shown in Figure 9. Click the activate icon to activate your form.
- Go back to Figure 8 and click the activate icon. The system generates the print report /1PYXXFO/ZAP_PAYSLIP_USCE_PRNT in the background (Figure 10). To edit this form, execute transaction code SE38. Click the execute icon to be prompted to go to Figure 11 to display your form in PDF format.
SAP form processing user interface
The print report
You need just to enter your parameter to display the payslip for the current period, as shown in Figure 11.
Selection screen to mass print/display the payslip you designed.
B. Activate all components in one shot out of the HR Forms framework. You can also activate the form and generate the print report in one shot. Click the activate icon in Figure 8 to go to Figure 12, or run standard report H99HRF_GENERATE via transaction code SE38.
Activate SAP forms and generate the print report in one shot
1. Select the Generate structure and program radio button to generate the print report and activate the form. Click the execute icon and you see the form and print report are activated and ready to use (Figure 13).
HR Forms and the print report are activated and ready for use
The HR Form framework offers another feature that helps you to sort wages and display wage type and related information in a certain order. For instance, click the InfoNet WAGETYPE (for example, Gross Remunerations). See the selected line in Figure 14 under the BRUTTOBEZUEGE folder, which means Gross Remunerations. Click the Selections tab to provide the order as shown in Figure 14.
Only those wage types will be visible and sorted in the payslip
In this step, the HR Forms framework allows you to hide wage types in your payslip. In this case the wages M550 and S170 are not displayed in your payslip, as shown in Figure 15. The two wage types are excluded from the display as indicated by the red icons.
Wage types M550 and S170 are not selected for display in the payslip
Modifying the Payslip Form
In this section I demonstrate how to make a change on the form side. Based on how you have structured your InfoStars data, the system creates a structure named HRDATA that contains all tables with data to output in your payslip (Figure 16). In the left side of the HR Forms screen shown in Figure 1, use transaction code SE11 to display Figure 16.
Type of generated structure HRDATA used by the interface of your Adobe Form Builder
Refer to Figure 17 to see the correspondence between the InfoNet and the generated structure /1PYXXFO/ZAP_PAYSLIP_USCE you obtain via transaction code SE11 (on the right side of Figure 16).
Correspondence between the InfoDimension DEDUCTIONS and the generated structure STAR_DEDUCTIONS
To make any change to a structure, copy the structure /1PYXXFO/ZAP_PAYSLIP_USCE to ZAP_PAYSLIP_USCE. Don’t make any enhancements to generated SAP structures. I recommend you keep a generated structure and copy it into a custom structure for any business requirement. To make your change, copy the EARNINGS table /1PYXXFO/ZAP_PAYSLIP_USCEU0005 to ZAP_PAYSLIP_USCEU0005 via transaction code SE11 (Figure 18).
Copy the EARNINGS table /1PYXXFO/ZAP_PAYSLIP_USCEU0005 to ZAP_PAYSLIP_USCEU0005
In this example, table ZAP_PAYSLIP_USCEU0005 is ready to be modified according to the requirement in the interface of your Adobe Design Builder using transaction code SFP. In your Adobe form (Figure 19) replace all items that refer to /1PYXXFO/ZAP_PAYSLIP_USCEU0005 with ZAP_PAYSLIP_USCEU0005. In Figure 19 you need to declare your own custom structure to be used in the Adobe Form Designer tool. Double-click the Types option in the Global Definitions folder to declare your new type of custom structure.
Declare your new type of custom structure
In Figure 20, you see the internal table you declared updating the content of the earnings table you need to display in your payslip form. Double-click the Global Data entry under the Global Definitions folder.
Declare a new type of internal table
This action opens the screen in Figure 21 in which you declare a new type of internal table (based on the type you created before in Figure 19).
Update custom table GT_EARNINGS_CUSTOM with new data to display in the form
You declare internal table TT_EARNINGS_CUSTOM as global data, which makes your structure visible and ready to be used. Add your structure by clicking the add entry icon as shown in Figure 21.
In Figure 21, based on the content of the standard structure GT_EARNINGS, you update your custom table GT_EARNINGS_CUSTOM with new data. Figure 21 shows an example of how to implement your own business requirement in term of earnings by creating a new internal table GT_EARNINGS from data already in the delivered GT EARNINGS table. Based on Figure 18, the SAP standard structure HRDATA has the type as /1PYXXFO/ZAP_PAYSLIP_USCE and the custom table ZHRDATA is typed as ZAP_PAYSLIP_USCE.
To add your custom structure to show in your payslip, execute transaction code SFP. In the Interface table of the screen that opens (Figure 22), add HRDATA_CUSTOM. In addition, in the same area you are able to add text, a logo, or a URL link in the interface as new import parameters. The arrows highlight the naming convention you should adopt to ease the coding. You rename your structure from /1PYXXFO/ZYAP_PAYSLIP_USCE to ZYAP_PAYSLIP_USCE to enable you to modify your structure.
Add new data to display in the payslip as new import parameters
Once import parameters are declared, you need to implement code according to your business requirements. To do so, double-click the initialization icon under the Code Initialization folder as shown in Figure 23. For example, Figure 23 shows how to fill the MIME_TYPE field to display a logo on the payslip.
Code to add a company logo to payslips (SAP standard class)
Via transaction code SFP, you create:
- An import parameter in the interface. In Figure 24 you have, for example, the GRAPHIC has the type name string. Click the activate icon to activate the form.
- Via transaction code SFP select the form and click the Context tab. Right-click the HREXPERTONLINE folder and add your logo. Create the graphic from the drop-down menu (Figure 24). Then map MIME_TYPE with parameter GRAPHIC in this example (see map type in Figure 24).
Select the Graphic type from the drop-down menu
In Figure 24, right-click the HREXPERTONLINE folder to create a new field, in my example GRAPHIC, in the same folder.
Then the MIME_TYPE is validated as shown in Figure 24. The layout editor is your main workplace in which the design of the form takes place. There are four tabs at the top of the area as shown in Figure 25 that show different views of the payslip. Select the Master Pages tab to bind the picture to the parameter GRAPHIC already declared in Figure 24.
Bind the picture to the parameter
Master Pages is a layout editor section used to design the form. It includes texts and pictures. In the same view, you are able to add text, addresses, and comments. In my example I map a logo with the data-binding GRAPHIC.
Now go to the Binding tab on the right side of the design view in the Object pallet. Click the icon on the right side of the default field below Data Binding (Open, Save, Submit): as shown in Figure 26. Since the current floating fields have a relationship with the global variable that is passing the values, you need to update the binding properties of the custom field. In Figure 21, you already declared your custom table, as shown in Figure 26.
Layout to design the payslip
As shown in Figure 26, you can update the RT table (Result Table where payroll data is stored). Even the structure HRDATA generated by the system can be copied to a Z structure. You can change it within the interface and then display it your Adobe form. You also can add information about the employee such as hiring date, annual salary, and work schedule.