Wednesday, May 30, 2007

SAP ECC6.0 : Payroll - DELIMIT

This is i must put credit to Hisyam who shared this knowledge with me on how to delimit a record in a table. Needless to say, one of my original requirement needs this feature so we go straight to the procedure:

1. I assume that you have created a master table
2. I also assume that you had made the table maintainable.
3. Go to table generator maintenance.
4. click "generate time dependent" button.
5. Click "maintenance object" then "Generate".

There you are, your table can be maintain...

is sky the limit... delimit your record

Tuesday, May 29, 2007

SAP ECC6.0 : Payroll - SAPMail Function Module

Sometimes you might want to include an email alert to users when they run their program. Recently, I was asked to provide an email alert if one of the records failed to process when run overnight. Thus in the morning, they can get feedback and proceed with their next course of action. So the very nice function module which you can use is below:


To use this function module, fill up the following parameter:
1. DOCUMENT_DATA : obj_name, obj_descr
2. OBJECT_HEADER : line.
4. RECEIVERS : line. (SAP Users)

Then you are ready to send. Check your email in your SAP Business Workplace at the main menu or you can use TCODE : SBWP.

is sky the limit... you've got mail...

SAP ECC6.0 : TAX - EC Form Enhancement

Annually, Malaysians working either in private or public sector will received a tax form from their employers. Those working in the private sector will get the EA Form. Others in the public sector will get the EC Form. EC Form describes how much one earns and gets remunerated (benefits) as well as how much of one earnings gets deducted. Thus the calculation of taxable of one employee. Therefore EC/EA Form denotes all of this in one year.

EC Form which i had to modify to fill up some blank spaces which was not filled up by SAP standard program took me nearly a week or more. I had to go through the standard program and see how the SAPScript (EC Form) and the standard program goes together to process payroll information. Nevertheless, I had to enhance one include file and pump the data into the SAPScript EC Form.

Although SAP did provide 2 BADI for developers to enhance those forms but it only work on certain way and i find it hard to fullfil my functional request thus forcing me to activate enhancement on the standard program itself. This solved one issue over another. Perhaps I would like to meet people who have experience similar situation in modifying or enhancing the EC Form.

So here goes the famous BADI offered by SAP:
1. HRPAYMY_ECFORM - calculation for BIK (Benefit In Kind). This generally displays a lump sum of benefit in kind into the section B (Manfaat Barangan). Unfortunately, my request was to display the breakdown list of all the benefits to one person.

2. HRPAYMY_EAFORM - process to fill up EA Form header only.

Now for those who had not gone through the EC Form or just started to modify it, my adviced is to really go over the program thoroughly because SAP did provide us a EC/EA Form Breakdown List. You need not to modify it.

Yet, that does not solve my problem because the EC Form still does not display the total amount of earnings, benefit and tax deductible. Thus I have to enhance the standard program.

That took me another few days to trace so i can find the best logical and reasonable point to make the enhancement. As you see, enhancement does not allow you to modify the standard program but you may add your coding at the top or bottom of a standard function without modify the mid section part. If you get my point, enhancement only allows addition of custom code at the top and bottom of the standard code. That is where i have to think where is the best part. Not to mention, that customized code should not affect other process too. It should be safe. So far my enhancement has not yield any justifiable complain that will lead to taking off the code. God knows if that happens!

Note : RPCTEAL0 is the original version given by SAP. RPCTEAL0_01 in this context is the new version given to the customer by SAP after a report was make to correct a certain mistake in the past.
So, in order to enhance the EC Form, there is this INCLUDE file named RCPTEAL3_01 that you can enhance to fullfil the request as above mentioned. RPCTEAL3_01 is an include file that do all the calculation process and also assigning of data to SAPScript. That is where you can modify it. In the process, the following are what i have done:

1. Enhancing subroutine FUELLEN : FUELLEN is a subroutine that will pass data to the SAPScript. This portion i put control to certain feature of the SAPScript to only display a specific format of PERNR(PNALT).

2. Changing PERNR to display a concatenated version PERNR(PNALT) and pass it to FUELLEN.

3. Changing DEPT to hold WERK/TEXT and KOSTL/TEXT and pass it to FUELLEN. Currently the DEPT field in SAPScript is left empty even though SAP did provided logic to determine it.

4. Calculation of earnings and benefits from internal table IT_BLTAB and pass it to EC Form Breakdown List.

For points 1 to 4, enhanced subroutine Fill_HD_TAB to cater the changes.

For points 1, enhanced subroutine FUELLEN to cater the changes.

SAPScript involves:
2. HR_MY_TAXEABL007 - EC BreakDown List

IMPORTANT: You will need to open up your SAPScript EC Form to see what fields are displaying your value as you do your enhancement.

is sky the limit... EC Form the best enhancement ever done so far....

Thursday, May 17, 2007

SAP ECC6.0 : Payroll - Steps to create schema functions

Just like previous assignment in this entry, an additional 6 more functions to be added to the Payroll Driver Malaysia to validate existence:
- IT0003 (Payroll Status)
- IT0009 (Bank Details)
- IT0185 (Personnel IDs)
- IT0196 (EPF)
- IT0000 (BackDated Pay)
- IT0198 (Check if record exist)

When you need to create or add functions to payroll driver of a certain country, you will need to know three things and there are:

- PE01 - Schema Directory

Schema directory allows you to include steps, constraints and functions to be group together (its like maintaining a group of belonging functions or steps). In a schema, it can have subschemas, processess and instructions. Schema directory must be created if you are customizing a new functions for standard payroll driver. PE01 does not only cater for payroll but time management too.

Steps to create a schema structure:

Step 1: Enter a name e.g. ZTSW

Figure 1.0 : PE01 Main Screen

Step 2: Click create to get into the schema attributes. (Note : Choose country grouping accordingly to which payroll is being used. E.g. 14 is for Malaysia because this example is using Malaysian payroll).

Figure 1.1 : Schema attributes.

Step 3: Choose program class either payroll or time management.

Figure 1.3 : Program class selection

Step 4 : Save and exit. (Note : For the time being we go to PE04 to create functions before we come back to link both of them up)

- PE04 - Maintain Functions and Directories

PE04 allows you to create functions/operations for either payroll or time management. This functions will be saved and enabled in the following program and link to the schema directory above. Thus completing your setting up of additional schemas to your payroll program.

Steps to create function(s) in schema functions

Step 1: create a new name e.g. zsub1.

Figure 2.0 : Create a function

Step 2: Click create to go into characteristics of function payroll. Provide description and country assignment should be according to which country payroll are being run by the client.

Figure 2.1 : Choosing country assignment and description.

Step 3 : Click Save. (Note : Ensure your country assignment is selected correctly.)


After performing the above steps, you can start to insert functions into include program (PCBURZMY0) of main program (RPCALCL0). Additional functions of payroll schema/driver are added to PCBURZMY0. RPCALCL0 will go through each of the functions in PCBURZMY0 when payroll administrator runs payroll.

is sky the limit... payroll driver... how-to