cancel
Showing results for 
Search instead for 
Did you mean: 

how to use hr_infotype_operation fm

Former Member
0 Kudos

hi folks,

please let me know how to use this fm

what we need to pass at record field(syntax).

iam getting the data like

idoc_data-sdata format so how i convert this and pass to fm and also please provide how to use the other mandatory fields.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Venkat! I make the abap source in follow form.

In this form you can precede all dumps at system.

Regards!

REPORT ZHR0006.

INFOTYPES: 0006. "Declaration of infotype

DATA: exc TYPE REF TO cx_sy_conversion_no_number ,

text TYPE string.

DATA: bapi_return LIKE bapireturn1,

bapipakey LIKE bapipakey.

START-OF-SELECTION.

CLEAR: p0006."Initialization of record

TRY.

IF NOT p0006-pernr CO '0123456789' OR

NOT p0006-begda CO '0123456789' OR

NOT p0006-endda CO '0123456789'." OR

RAISE EXCEPTION TYPE cx_sy_conversion_no_number .

ENDIF.

CATCH cx_sy_conversion_no_number INTO exc.

text = exc->get_text( ).

ENDTRY.

CALL FUNCTION 'BAPI_EMPLOYEET_ENQUEUE'

EXPORTING

number = p0006-pernr

validitybegin = sy-datum

IMPORTING

return = bapi_return.

TRY.

CLEAR: bapipakey, bapi_return.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = p0006-infty

subtype = '0'

number = p0006-pernr

validityend = p0006-endda

validitybegin = p0006-begda

record = p0006

operation = 'INS'

IMPORTING

return = bapi_return

key = bapipakey.

CATCH cx_sy_conversion_no_number INTO exc.

text = exc->get_text( ).

ENDTRY.

former_member181966
Active Contributor
0 Kudos

I always refer to SAP code .. look at report RPTQTA00

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = p2006-infty

number = p2006-pernr

subtype = p2006-subty

validityend = p2006-endda

validitybegin = p2006-begda

record = p2006

operation = operation

IMPORTING

return = return.

Thanks,

Saquib Khan

Former Member
0 Kudos

Hi,

U have to use like below.

call function 'BAPI_EMPLOYEE_ENQUEUE'

exporting

number = v_pernr

importing

return = return .

  • Error

if return-number <> 0.

clear : v_message.

concatenate return-type return-id return-number return-message+0(145)

into v_message separated by space.

else.

*--- Appending the Record

call function 'HR_INFOTYPE_OPERATION'

exporting

infty = '0014'

number = i_i0014-pernr

subtype = i_i0014-subty

objectid = ' '

lockindicator = 'X'

validityend = val_endda

validitybegin = val_begda

record = record

operation = operation

  • nocommit = no_commit

dialog_mode = '0'

importing

return = return

key = key.

if return-number ne 0.

clear : v_message.

concatenate return-type return-id return-number return-message+0(145)

into v_message separated by space.

endif.

*--- Unlocking the employee.

call function 'BAPI_EMPLOYEE_DEQUEUE'

exporting

number = v_pernr

importing

return = return

.

  • Error

if return-number <> 0.

clear : v_message.

concatenate return-type return-id return-number return-message+0(145)

into v_message separated by space.

endif.

Thanks & Regards,

Shiva vs.

Former Member
0 Kudos

Hi Venkat,

Following is an example of inserting a new record into IT2001.

Pls refer to it.

p2001-pernr = employeenumber.

p2001-SUBTY = '0100'.

p2001-endda = validityend.

p2001-begda = validitybegin.

p2001-AWART = '0100'.

call function 'HR_INFOTYPE_OPERATION'

exporting

infty = '2001'

number = employeenumber

SUBTYPE = '0100'

lockindicator = 'X'

validityend = validityend

validitybegin = validitybegin

record = p2001

operation = 'INS'

nocommit = nocommit

objectid = ' '

tclas = 'A' (tclas = 'B' for applicant data)

importing

return = return

key = personaldatakey

exceptions

others = 0.

Regards,

Dilek

Edited by: Dilek Ersoz on Aug 1, 2008 4:16 PM