cancel
Showing results for 
Search instead for 
Did you mean: 

HR_INFOTYPE_OPERATIONS FM usage

Former Member
0 Kudos

Hi

the follwoing code is not updating the SPRPS field in PA0001 infotype. Can you plz let me know if there any mistake.... I have used MOD operation also.

READ TABLE it_p0001 INTO wa_p0001 INDEX 1.

IF sy-subrc EQ 0.

IF wa_p0001-sprps IS INITIAL.

wa_p0001-sprps = 'X'.

ENDIF.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '0001'

number = lv_pernr

lockindicator = 'X'

validityend = '99991231'

validitybegin = wa_p0001-begda

record = wa_p0001

operation = 'COP'

IMPORTING

return = return.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi raj,

If you want to modify lock indicator ie sprps then while passing to the function module parameter lockindicator value should be '' as it is used to select the existing record for modifying.

therefore correct code will be :

READ TABLE it_p0001 INTO wa_p0001 INDEX 1.

IF sy-subrc EQ 0.

IF wa_p0001-sprps IS INITIAL.

wa_p0001-sprps = 'X'.

ENDIF.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '0001'

number = lv_pernr

lockindicator = ''

validityend = '99991231'

validitybegin = wa_p0001-begda

record = wa_p0001

operation = 'MOD'

IMPORTING

return = return.

Former Member
0 Kudos

hi Sidh,

I have done the modification as per ur comments but now I am getting a run-time error sayign " Fehler in ASSIGN-Zuweisung im Programm "SAPLHRMM".

Regards

Rk

Answers (1)

Answers (1)

Former Member
0 Kudos

The issue is resolved, the SPRPS field can be updated in 0023 infotype but not in 0001. Ofcourse, my requirement is met.