Skip to Content
0
Former Member
Mar 14, 2008 at 12:24 PM

hr_infotype_operation error

96 Views

i am testing hr_infotype_operation FM

for some reason it dumps with the message:

*******************************************************************************************************

COMMIT_IN_PERFORM_ON_COMMIT

Error analysis

You cannot call a COMMIT WORK in a FORM not executed by the variants

PERFORM ... ON COMMIT or PERFORM ... ON ROLLBACK until the commit of the

calling program.

*******************************************************************************************************

my code:

REPORT z_test_hrinfotyop_el.

*Data

DATA : p0008 LIKE p0008.

DATA : return LIKE bapireturn1.

DATA : key LIKE bapipakey.

DATA : returne LIKE bapireturn1 .

*Values

p0008-pernr = '00004272'.

p0008-begda = '20080101'.

p0008-endda = '99991231'.

p0008-trfar = '01'.

p0008-trfgb = '04'.

p0008-trfgr = 'GG2'.

p0008-ancur = 'MYR'.

p0008-lga01 = '1000'.

p0008-bet01 = '5000'.

PERFORM save_record.

&----


*& Form save_record

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM save_record .

*Enqueue

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'

EXPORTING

number = p0008-pernr

IMPORTING

return = returne.

*Update

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '0008'

number = p0008-pernr

  • subtype = p0008-subty

  • objectid = p0008-objps

  • lockindicator = p0008-sprps

validityend = p0008-endda

validitybegin = p0008-begda

  • recordnumber = p0008-seqnr

record = p0008

operation = 'INS'

  • tclas = 'A'

  • dialog_mode = '0'

nocommit = 'X'

IMPORTING

return = return

key = key.

IF return IS NOT INITIAL.

WRITE :/ 'Error Occurred'.

ELSE.

COMMIT WORK.

ENDIF.

*Dequeue

CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'

EXPORTING

number = p0008-pernr.

ENDFORM. " save_record