Organizations operating in Nigeria and Ghana often struggle to calculate PAYEE taxes accurately, because both tax structures are complex and SAP Payroll ships no standard functionality for either country. A tailored solution is the only route.
Why the SAP standard is not sufficient
SAP Payroll has no standard solution for PAYEE tax calculation in Nigeria or Ghana. The standard payroll functions for tax calculation are country-specific and simply do not cover these two, so a custom payroll function has to be created to meet the requirement.
The requirement itself is to calculate PAYEE tax against the tax slabs and relief amounts defined by each government. Those slabs and relief amounts change from year to year and must be updated accordingly, and the calculation has to account for the employee’s projected annual income based on the current month and the months remaining in the year.
The slabs and relief amounts live in four maintainable tables, not in code. The annual statutory update is a configuration change, not a development request.
What the add-on gives you
- Flexibility. The solution adapts to changes in tax regulations, so compliance holds as the rules move.
- Ease of maintenance. It is designed to be maintained without extensive technical expertise.
- Regular compliance updates. Updates keep it aligned with the latest statutory modifications.
- A unified platform. It integrates with SAP Payroll rather than sitting beside it, so multi-geography payroll stays in one place.
Systems involved
SAP S/4HANA HCM is the HRMS holding and processing the employee master data and the payroll data — a comprehensive set of business processes and capabilities across industries and regions.
Approaches considered
There were two ways to create the custom payroll function:
- Copy an existing standard payroll function and modify it to suit the requirement.
- Build a new payroll function from scratch using the payroll function builder (PE02).
We chose the second. It gives more flexibility and control over both the logic and the parameters of the function, and it avoids the conflicts and errors that come from copying and modifying a standard function.
Solution design
The design has three components: custom tables holding the tax slabs, wage types and relief amounts per country; the custom payroll function ZNTAX, which calculates the tax from those tables and the payroll input table; and the SAP Payroll driver schema, which invokes the function and generates the output table.
The four tables
- ZT1
- Tax slabs per country and the applicable rates — country code, slab code, validity start and end dates, slab range start and end, and the percentage for that slab.
- ZT2
- The wage types used for tax calculation per country — country code, validity dates and wage type.
- ZT3
- The wage types used for tax relief per country — country code, validity dates and wage type.
- ZT4
- The tax relief amount per country — country code, validity dates and the relief amount itself.
Keeping the slabs and relief amounts in tables rather than in code is what makes the annual update a configuration change rather than a development request.
The calculation logic
Project annual income→Deduct reliefs→Apply the country’s slabs→Divide by months remaining
Base value
The country code of the employee’s payroll area comes from table T001 via the BURKS field on PA0001. That code filters the rows in ZT2 for the payroll month. The values of the wage types used for tax calculation are summed from the payroll input table, then projected by multiplying by the number of months remaining in the year including the current one. That projection is the base value, BAS1.
Taxable income
The same country code filters ZT3 for the payroll month. The wage types used for tax relief are summed from the input table and projected the same way, giving the projected relief value REL1. The flat relief amount for the country comes from ZT4 as REL2. Taxable income is then BAS1 less the sum of REL1, REL2 and 20% of BAS1.
Nigeria
Taxable income is passed to ZT1 by country code and payroll month. The matching slab is found by comparing the slab range start and end fields, and the slab code and percentage are read for that slab and every preceding one. The annual tax is calculated across those slabs, then divided by the months remaining in the year including the current month — that is the current month’s tax, stored in wage type RT-3003, with the same value stored as tax deducted so far in RT-3004.
Three special cases apply:
- If taxable income is negative, tax is 1% of total monthly income.
- For payroll areas A211 and A511, tax is 5% of the basic wage type RT-1000.
- If the sum of the tax-calculation wage types is below the threshold, the calculation stops rather than running.
Ghana
The base value is derived exactly as above. The chargeable income and rate-of-tax table then locates the slab that applies to the projected base value; the tax for each slab is the difference between its range end and range start multiplied by the percentage, and those are summed to the annual tax. Dividing by the remaining months including the current one gives the month’s tax.
Conclusion
The result is a robust, adaptable framework for calculating payroll taxes for employees in Nigeria and Ghana. It simplifies the calculation, keeps compliance with local regulations current, and — because the slabs and relief amounts live in maintainable tables rather than in code — minimises the technical expertise needed to keep it right year after year.