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

Info type update

Former Member
0 Likes
1,141

Hi

My Scenario is when an employee get hired through PA40. At the end of hiring action info type 41 get update automatically.

I am using enhancement HRPAD00_ENTRY_LEAVE to update info type 41, using the condition that when its last screen of the hiring action then update the info type 41 using below FMs

BAPI_EMPLOYEE_ENQUEUE , HR_INFOTYPE_OPERATION , BAPI_EMPLOYEE_DEQUEUE

but data doesn't get commit in data base for the both last screen of hiring action as well as for the info type 41

kindly advice

Regards

Ammad

7 REPLIES 7
Read only

former_member209703
Active Contributor
0 Likes
1,110

Hi

Have you checked what does HR_INFOTYPE_OPERATION return? I mean, sometimes there can be issues related with the data you're actually passing to this FM and this can lead to errors. Be sure RETURN parameter is initial before trying to do anything else. Besides, check first if the employee number is already locked (you're still in the middle of the hiring process) so maybe BAPI_EMPLOYEE_ENQUEUE may return an error as well. In this case you'd need to unlock the employee, update the Infotype and lock it again.

Regards

Read only

0 Likes
1,110

i have done this it doesn't return error, can i use INSERT statement to directly insert data into info type 41 . what do u recommend ?

Regards

Ammad

Read only

0 Likes
1,110

You could, however is not recommended as you're bypasing all the security restrictions, and I'd only do it as a last resource.

What I'd try to do is instead of using HR_INFOTYPE_OPERATION is a Batch Input (BDC) against PA30 and insert the record using mode 'N' (The user won't see anything of this)

Read only

0 Likes
1,110

PA30 will not work as employee no will be locked

Read only

0 Likes
1,110

You'll have to unlock it first using either DEQUE_EPPRELE or DEQUE_ALL

Read only

0 Likes
1,110

code is as follows by not working

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'

EXPORTING

NUMBER = w_0041-pernr

IMPORTING

RETURN = return

.

if return is initial .

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

INFTY = '0041'

NUMBER = w_0041-pernr

  • SUBTYPE =

  • OBJECTID =

  • LOCKINDICATOR =

VALIDITYEND = w_0041-BEGDA

VALIDITYBEGIN = w_0041-ENDDA

  • RECORDNUMBER =

RECORD = w_0041

OPERATION = 'INS'

  • TCLAS = 'A'

  • DIALOG_MODE = '0'

  • NOCOMMIT =

  • VIEW_IDENTIFIER =

  • SECONDARY_RECORD =

IMPORTING

RETURN = return

KEY = key

.

CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'

EXPORTING

NUMBER = w_0041-pernr

IMPORTING

RETURN = return

.

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'

EXPORTING

NUMBER = w_0041-pernr

IMPORTING

RETURN = return

.

Read only

0 Likes
1,110

Hi.

Another option would be to place your code in the IN_UPDATE method of the BADI HRPAD00INFTY

When the last infotype (screen) of the hiring process is saved, this event will be fired and you can place your logic there.

Anyway I'd keep in mind the PA30 approach as well in case HR_INFOTYPE_OPERATION won't work.

Best of luck.