Skip to Content
author's profile photo Former Member
Former Member

how to use hr_infotype_operation fm

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2008 at 02:16 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2008 at 02:47 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2008 at 07:28 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2008 at 08:20 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.