Application Development and Automation 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: 
Read only

Automatic insert OM record on insert IT0001 using HR_INFOTYPE_OPERATION

Former Member
0 Likes
631

I perform a HR_INFOTYPE operation on IT0001 inserting a new record when a extrnal employee has a p0016-ctedt <= sy-datum.

In PA30 when this is done automaticly, OM record is insert assigning plans = 9999999, but doiung this with the FM the OM is not changed.

Anybody know a sollution how to insert a new OM record with the plans from the new IT0001 record??

  • Bepaal waarden voor toevoegen orgainsatorische eenheid default FP

MOVE-CORRESPONDING p0001 TO lw_pa0001.

lw_pa0001-begda = p0016-ctedt + 1.

lw_pa0001-endda = '99991231'.

lw_pa0001-plans = '99999999'.

  • Voeg uitdiensttredingsprocedure uit op einde tijdelijk contract

  • WRITE DATA

CLEAR: return, personaldatakey.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '0001'

number = pernr-pernr

validityend = '99991231'

validitybegin = lw_pa0001-begda

record = lw_pa0001

operation = 'INS'

nocommit = 'X'

tclas = 'A'

IMPORTING

return = return

key = personaldatakey

EXCEPTIONS

OTHERS = 0.

IF return-number IS INITIAL.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
565

hi,

before using this hr_infotype_operation u should always lock the employee first using BAPI_EMPLOYEE_ENQUEUE and then unlock it after the operation. If u want to create a position u can create from BDC on pp01 & pp02 .we did the same way.

Regards,

Sumanjeet.

2 REPLIES 2
Read only

Former Member
0 Likes
566

hi,

before using this hr_infotype_operation u should always lock the employee first using BAPI_EMPLOYEE_ENQUEUE and then unlock it after the operation. If u want to create a position u can create from BDC on pp01 & pp02 .we did the same way.

Regards,

Sumanjeet.

Read only

Former Member
0 Likes
565

Used call transaction "PA40" to solve this issue.