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

function module to update a database table

Former Member
0 Likes
1,223

please give me the name of the function module which will update a hr table from an infotype.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
396

Hi,

The FM 'HR_INFOTYPE_OPERATION' is used to update the HR infotype.

U can lock the pernr using 'BAPI_EMPLOYEE_ENQUEUE' FM. After that, u can unlock it using 'BAPI_EMPLOYEE_DEQUEUE' .

see this sample code...

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'

EXPORTING

NUMBER = P2013-pernr

IMPORTING

RETURN = wf_returne.

Test Mode

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

INFTY = '2013'

NUMBER = P2013-PERNR

SUBTYPE = P2013-SUBTY

OBJECTID = P2013-OBJPS

LOCKINDICATOR = P2013-SPRPS

VALIDITYEND = P2013-ENDDA

VALIDITYBEGIN = P2013-BEGDA

RECORDNUMBER = P2013-SEQNR

RECORD = P2013

OPERATION = 'INS'

TCLAS = 'A'

DIALOG_MODE = '0'

NOCOMMIT = 'X'

IMPORTING

RETURN = wf_return.

CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'

EXPORTING

NUMBER = P2013-PERNR.

Reward points if useful

Cheers,

Shanthi.

Edited by: shanthi ps on Jan 29, 2008 5:24 AM

1 REPLY 1
Read only

Former Member
0 Likes
397

Hi,

The FM 'HR_INFOTYPE_OPERATION' is used to update the HR infotype.

U can lock the pernr using 'BAPI_EMPLOYEE_ENQUEUE' FM. After that, u can unlock it using 'BAPI_EMPLOYEE_DEQUEUE' .

see this sample code...

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'

EXPORTING

NUMBER = P2013-pernr

IMPORTING

RETURN = wf_returne.

Test Mode

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

INFTY = '2013'

NUMBER = P2013-PERNR

SUBTYPE = P2013-SUBTY

OBJECTID = P2013-OBJPS

LOCKINDICATOR = P2013-SPRPS

VALIDITYEND = P2013-ENDDA

VALIDITYBEGIN = P2013-BEGDA

RECORDNUMBER = P2013-SEQNR

RECORD = P2013

OPERATION = 'INS'

TCLAS = 'A'

DIALOG_MODE = '0'

NOCOMMIT = 'X'

IMPORTING

RETURN = wf_return.

CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'

EXPORTING

NUMBER = P2013-PERNR.

Reward points if useful

Cheers,

Shanthi.

Edited by: shanthi ps on Jan 29, 2008 5:24 AM