SAP Function RP_25_CONVERT_CPF_AC - HR-SG: Convert CPF account number

Parameter Reference Type Length Default Optional Text
IN_CPFAC P0186-CPFAC C 15 CPF a/c with any format

Parameter Reference Type Length Text
OUT_CPFAC P0186-CPFAC C 15 CPF a/c with standard format

Exception Text
NO_ENTRY no a/c number entered

Functionality
This function is used to convert employee's CPF account number basedon
the following rule:
- First character must begin with S or T, whereby S denotes forthose
born before the year 2000 and T denotes for those born on theyear
2000 onwards. As for foreigner, the S or T will depend on thedate
of application of CPF account number to CPF board.
- Second character can be numeric for local or alphabet A, B, C,D, or F
for foreigner.
- Third character till eighth character must be numeric.
- Ninth character will be the check-digit which will be in
alphanumeric.
The conversion of alpha to numeric check digit is shown below:
If second character is A , B, C or 0 to 9, then
Alpha CD : A B C D E F G H I J Z
Numeric CD: 1 2 3 4 5 6 7 8 9 0 -
If second character is D or F, then
Alpha CD : A B C E J K L N P X V
Numeric CD: 0 1 2 3 4 5 6 7 8 9 -
- There shoud not be any decimal places to separate the checkdigit.

Example
Input A/C No. Output Result Remarks
S1234567A S1234567A Standard format (local)
S1234567.1 S1234567A Convert check-digit
T12345671 T1234567A Convert check-digit
SA123456C SA123456C Standard format (foreigner)
A123456C SA123456C Append prefix 'S'
C123456C TC123456C Append prefix 'T' (foreigner)
SD1234568 SD123456P Convert check-digit
P123456A initial Invalid a/cnumber prefix