Skip to Content
0
Former Member
Sep 11, 2008 at 03:14 PM

Unlock a locked record in Infotype 168 using HR_INFOTYPE_OPERATION func mod

119 Views

How could you unlock a locked record (ie., P0168-SPRPS = 'X') in IT 168 using HR_INFOTYPE_OPERATION function module? The code I got to unlock is as below - but the thing is, I am not even seeing the locked record in debug mode under P0168 structure ! Is SAP preventing a program from processing a "locked" record. I can unlock this record using PA30 though.

DATA: V_PA0168 LIKE BAPIRETURN1 .

DATA : S_P0168 TYPE P0168.

LOOP AT P0168.

S_P0168 = P0168.

S_P0168-SPRPS = ''. " To unlock the record.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

INFTY = '0168'

NUMBER = '0234647'

SUBTYPE = 'SLIF'

VALIDITYEND = S_P0168-ENDDA

VALIDITYBEGIN = S_P0168-BEGDA

RECORD = S_P0168

OPERATION = 'MOD'

TCLAS = 'A'

DIALOG_MODE = '0'

IMPORTING

RETURN = V_PA0168 .

ENDIF.

ENDLOOP.

Thanks.