cancel
Showing results for 
Search instead for 
Did you mean: 

crack the logic for old pernr

Former Member
0 Kudos

Hi Experts,

iam trying with the present pernr we are going to identify the old pernr and moving that into pa0002 infotype.

That they are trying to move that into pa0002 infotype allias field.

My doubt is pernr is Numc n allias is char. How is it possiblt to move.

I think we can go through enhancement for thar field.

I wrote some code.

Please give me the proper code.

Thanks in advace.

Kavitha.

FORM OLD_EMPNO USING P_PERNR P_OLD_EMPNO.

DATA: L_PERNR(8) TYPE N,

L_REM TYPE I,

L_CD(1).

L_PERNR = P_PERNR.

L_REM = ( ( L_PERNR+3(1) * 5 ) +

( L_PERNR+4(1) * 4 ) +

( L_PERNR+5(1) * 3 ) +

( L_PERNR+6(1) * 2 ) +

( L_PERNR+7(1) * 1 ) ) MOD 11.

IF L_REM = 10. L_CD = '-'. ELSE. L_CD = L_REM. ENDIF.

CONCATENATE L_PERNR L_CD INTO P_OLD_EMPNO.

ENDFORM.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member226519
Active Contributor
0 Kudos

no problem to move NUMC field to CHAR field. Maybe you have to care about leading zeroes.

former_member181966
Active Contributor
0 Kudos

May be you want to look at infotype 0031 -Reference Personnel Numbers .

Thanks,

Saquib

Former Member
0 Kudos

Hi,

Actually i want to find out: the present pernr is there with this what should be the old pernr.

Can any one give me the code for that.

Thanks in advance.

Pasula.

former_member182426
Active Contributor
0 Kudos

Hi,

When your hiring a new employ it will automatically generate one pernr number and assing it. This is called internal pernr assignment.

And one more thing External, this is given by user. when ever you enter a number externally it will be checking weather its exist or not.

Can you tell me little bit more clearly wats your requirement....

Former Member
0 Kudos

Kavitha,

Try this. Just move the L_PERNR to a character field.

FORM OLD_EMPNO USING P_PERNR P_OLD_EMPNO.

DATA: L_PERNR(8) TYPE N,

char_pernr(8),

L_REM TYPE I,

L_CD(1).

L_PERNR = P_PERNR.

L_REM = ( ( L_PERNR+3(1) * 5 ) +

( L_PERNR+4(1) * 4 ) +

( L_PERNR+5(1) * 3 ) +

( L_PERNR+6(1) * 2 ) +

( L_PERNR+7(1) * 1 ) ) MOD 11.

IF L_REM = 10. L_CD = '-'. ELSE. L_CD = L_REM. ENDIF.

char_pernr = l_pernr.

CONCATENATE char_PERNR L_CD INTO P_OLD_EMPNO.

ENDFORM.