Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying SPRPS Field in HR INFOTYPE OPERATION

Former Member
0 Kudos
1,310

Hello,

I have a requirement in which i need to lock the employee record for IT2001 by setting P2001-sprps as 'X'.That is, initially when a record is created

Then after few approvals, i need to read the same record from infotype 2001 and need to modify the lock indicator with blank(unlock)

Can the same requirement be achieved using HR_INFOTYPE_OPERATION ?

I tried using HR_INFOTYPE_OPERATION but the employee record is not unlocking.Please suggest.

6 REPLIES 6

sergey_korolev
Active Contributor
222

Hello,

To unlock a locked infotype record you use HR_INFOTYPE_OPERATION with LOCKINDICATOR = 'X' and

OPERATION      = 'EDQ'.

Regards,

Sergey Korolev


0 Kudos
222

Hi,

I have coded as per your suggestion but I am getting an error

"A complex application error has occurred"

0 Kudos
222

Such an error can occur when you call HR_INFOTYPE_OPERATION from within some HR user exit or BADI within standard infotype logic (say in transaction PA30). Alternatively if your functionality is to be called within standard PA30 you can employ infotype dynamic actions (table T588Z).

sujeet2918
Active Contributor
0 Kudos
222

Hello Neetu,

 

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

      INFTY = '0006'

      NUMBER = sp2001-pernr

      SUBTYPE = sp2001-subty

* OBJECTID =

     LOCKINDICATOR = 'X'

    VALIDITYEND = sp2001-endda

    VALIDITYBEGIN = sp2001-begda

* RECORDNUMBER =

RECORD = sp2001

OPERATION = CHANGE

 

* TCLAS = 'A'

* DIALOG_MODE = '0'

 

NOCOMMIT = 'X'

 

* VIEW_IDENTIFIER =

* SECONDARY_RECORD =

 

IMPORTING

RETURN = retcd .

if sy-subrc = 0.

commit work.

endif.

Regards,

Sujeet Mishra

0 Kudos
222

Hi,

I have coded as per your suggestion but I am getting an error

"A complex application error has occurred"

0 Kudos
222

Hi,

Did you get solution to unlock employee record. I am also required same functionality.

Please suggest if you have any solution.

Thanks,

Brahma