Learn how to customize the employee self-services (ESS) ABAP Web Dynpro application for the pay statement in both the SAP Enterprise Portal and SAP NetWeaver Business Client in enhancement package 5.0, using Business Add-In functionality. In this real-life example, see how one business customized this functionality.
Key Concept
With SAP Business Add Inn (BAdI) functionality, SAP delivers a way for companies to control the output of employees’ salary statements in employee self-services (ESS) via standard BAdI HRESS_PAYSLIP_BADI_IMPL. By default, this BAdI is active in the SAP standard system and the standard code is executed automatically. BAdIs allow companies to adjust the standard SAP system’s code for displaying certain functionalities—for example, in the salary statement—which provides great flexibility for the output and what data is seen by employees.
A challenge I have seen firsthand with many organizations is that once the standard functionality for the ABAP Web Dynpro salary statement application has been implemented, the standard SAP system program may not always fit all the requirements of the company. A best practice is to try to avoid customizing the standard Web Dynpro application, if at all possible, as this prevents the receipt of new updates when SAP enhances the particular functionality.
This BAdI pertains to the top section of the salary statement, which lists all of the payroll results, as shown in Figure 1. This is the first thing you see when you launch the Salary Statement application after logging into the employee self-services (ESS) portal. By default, the SAP system displays basic information such as payment date, gross amount, and payment (net) amount on this screen. In this section you can select a particular payment and view the details of that payment in a PDF output. Customization of the PDF output using HR Forms is outside the scope of this article, but you can find more details in this HR Expert article by Muhammad Usman Malik, “Create Versatile HR-Related Forms in HR Forms Workplace.”

Figure 1
The standard salary statement overview and selection screen (shown here using SAP NetWeaver Business Client [NWBC] with the Corbu Theme)
Before going any further, you must have in place an existing SAP Enterprise Portal or SAP NWBC, with the salary statement functionality already implemented or currently being implemented. Once you have met the prerequisites and the salary statement functionality is active in ESS, you can now customize the data that is pulled back when an employee launches the salary statement.
Salary Statement Configuration: BAdI Requirements
To control the data that is to be shown on the salary statement, follow IMG menu path Personnel Management > Employee Self-Service (Web Dynpro ABAP) > Service-Specific Settings > Benefits and Payment > Salary Statement > Form Using HR Forms Workplace (HRFORMS) > BAdI: Define Settings. In the screen that appears (Figure 2) you create a new enhancement BAdI by clicking the create implementation icon . This opens the screen in Figure 3, where you tell the system to use your newly created enhancement rather than the standard BAdI HRESS_PAYSLIP_BADI_IMPL.

Figure 2
Creating a new enhancement implementation

Figure 3
Activating the new enhancement BAdI for salary statement
There are several options for limiting the date range for displaying salary statements on ESS. In my example I show how to restrict the display of historical salary statements records that are shown to the employee before a particular year—in this case, 2012. From my experience, this is one of the most common customizations using this BAdI because many organizations (especially those who have had SAP Payroll live for more than 10 years) do not want all of the historical payroll results to be displayed.
Salary Statement BAdI – Methods and Details
In the previous section I showed how to create the new BAdI. Next you need to write your own custom code, such as logic to control which salary statements are available. I discuss the details for how to do this, and show examples of how standard SAP functionality behaves for each method. First, here is the complete list of SAP methods provided for this BAdI, as well as a brief synopsis of the purpose of each:
- PROVIDE_FILTERED_RGDIR: Limits the available salary statements in ESS for an employee
- PROVIDE_FILTER_LIST: You can specify which entries are offered for selection in the drop-down options for the salary statement
- PROVIDE_FIELD_CATALOG: You can specify the maximum possible columns for the configuration of the overview table
- ADJUST_FIELD_CATALOG: You can activate or deactivate different columns depending on personnel number and other attributes (such as country grouping or off-cycle payroll run)
- PROVIDE_OVERVIEWTAB_LINE: You can specify the contents of the overview table. Please note that the contents must match the layout of the table specified in the PROVIDE_FIELD_CATALOG method.
- PROVIDE_TITLES: You can dynamically change the title of the application or the title of the pop-up; for example, the period being displayed appears in the title.
- ADJUST_PRINTBUTTON_STATUS: You specify whether the Central Print pushbutton is active or inactive for the employee
I discuss each in more detail in the following sections.
1. The PROVIDE_FILTERED_RGDIR Method
This method controls which salary statements an employee can see. In my example, I am customizing to restrict the dates of the salary statements available in ESS. As my example, I show how to do this by restricting any statements before 2012 being shown. This method limits the available salary statements by removing the entries from table CT_FILTERED_RGDIR, which is ultimately displayed to the employee.
The simplest way to accomplish this requirement is to use simple code, shown in Figure 4. Alternatively, if the date is something that should be dynamic, then you should put the restricted date on a constant table, such as table T511K, and then select it from there. That way any time you want to change it you can simply change the value of the constant.

Figure 4
Sample code for BAdI to limit the date range for timesheets displayed
Another common option is to limit it based on the current date, which has the advantage of being dynamically updated rather than by a hard-coded date (e.g., 01/01/2012). So, for example, if you wanted to show the past year’s statements, then you could use logic such as Filter_Date = SY-DATUM – 365.
Another common customizing option that organizations want to control is if employees can view future payroll results. For example, if payroll is actually run on Tuesday 6/17/2014, but is not paid out until Friday 6/20/2014, companies can determine what date they want this information to be viewable by the employee. The default SAP logic allows employees to see anything from the current date (SY-DATUM), plus three days. Using custom logic (shown in Figure 5) you can change this standard code to allow them to see this information from the current date plus one day (Figure 6).

Figure 5
SAP default logic

Figure 6
Customized code for the BAdI to control the date when latest salary statement is shown
Finally, one other customizing option is to restrict what time of day an employee can view their salary statement for the most recent payroll run. You can do this using the SY-UZEIT field, which contains the system time. An example of when you might want to use this functionality is if you only want people to be able to see a paycheck beginning at a certain time of day (02:00PM) after the payroll run.
2. The PROVIDE_FILTER_LIST Method
This method controls which entries are offered for selection in the drop-down box shown in the Overview and Selection screen (Figure 7). This allows you to choose the filter (e.g., display all salary statements, three months of salary statements, six months of salary statements, or 12 months of salary statements) based on what you want to be shown. For each selection entry, you have to enter the sequence number of the oldest salary statement that is in the set of hits selected.

Figure 7
Overview and Selection filter list of salary statements
The standard SAP system code for this method as shown in Figure 8 for the filtered values, with an example of the last 3 months being shown (highlighted in Figures 7 and 8). You can customize this and change as you see fit depending on the filter you desire (for example, Last 3 months).

Figure 8
Standard SAP system code for METHOD PROVIDE_FILTER_LIST
3. The PROVIDE_FIELD_CATALOG Method
This method allows you to specify the maximum possible columns for the configuration of the overview table. It also gives you control over the data that is seen by employees on the overview and selection table when they first pull up the salary statement functionality.
The standard code in this method shows an example of the flexibility it offers—for example, adding additional rows or hiding existing rows to the table. The fields that SAP has enabled by default are shown in the screen in Figure 9. The benefit of this method is that you can customize what you want shown on the overview screen.

Figure 9
Standard SAP system code for column headings as well as the output
4. The ADJUST_FIELD_CATALOG Method
This method allows you to activate or deactivate different columns depending on the personnel number or other attributes, such as country grouping. The SAP standard code for this, which gives the flexibility to make a decision based on the type of payroll run (off cycle or regular) to append different fields, is shown in the top of Figure 10.

Figure 10
SAP standard code for output of regular payroll run
The main benefit of this method is that you have greater control over the columns shown. For example, you can have different information for the columns depending on if it is an off cycle run or if it is a regular run. In Figure 10 you can see how this works using the example of a regular payroll run.
5. The PROVIDE_OVERVIEWTAB_LINE Method
Figure 11
Figure 11
Standard code to display data in the column of the overview and selection table
This is particularly beneficial when you need to have different information across multiple countries. For example, in the United States the tax wage types are /4** while in other countries these are not used. So this functionality gives you the flexibility to output different data per your requirements
6. The PROVIDE_TITLES Method
Using this method, you can dynamically change the title of the application based on the selection of different entries in the overview table. Figure 12 shows the SAP standard code in this method for you to dynamically change the title. This code is based on the type of run—whether it is an off cycle payroll run or not—and it shows you the date of the selected payroll run in the header.

Figure 12
SAP standard code for adjusting Salary Statement Title
The benefit of this method is that you can have the title of the screen show whatever you want and can even have it be dynamic. An example of this, using the standard SAP setup, is shown in Figure 12.
7. The ADJUST_PRINTBUTTON_STATUS Method
Using this method, you can specify whether the Central Print button is active or inactive for the employee. SAP standard code shows the enabling of the print button, but with a very simple code change you can adjust this code to hide the display of the button (Figure 13).

Figure 13
Code showing how you can disable the print button status
The benefit of this method is that it gives you the flexibility to choose whether you want to allow employees to have the option to print out all their salary statements or not.

Imran Sajid
Imran Sajid is a Senior Education Consultant at SAP based in the Atlanta, GA, area. At SAP, he focuses on teaching classes in the HCM area within both SAP and SuccessFactors. Previously, Imran was a consultant who implemented and provided post-go-live support for more than a dozen different client systems spanning many industries, including manufacturing, automotive, retail, information systems, the public sector, and energy. He is the author of the book entitled, The Payroll Control Center for SAP ERP HCM and SAP SuccessFactors, as well as a frequent contributor to SAP Experts, where he has published almost a dozen articles. Imran is also frequent blogger on SAP Community Network (SCN). He graduated from the Georgia State University Robinson College of Business with a degree in Computer Information Systems. Imran can be found on Twitter @ImranSajidSAP.
You may contact the author at Imran.Sajid@sap.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.