Application Development 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: 

using the FM HR_INFOTYPE_OPERATION

Former Member
0 Kudos

Hi folks,

I am using the FM HR_INFOTYPE_OPERATION, in my report. What values i need to pass for the import parameter RECORD. Without passing this parameter, its going to dump...Could any one suggest me how to pass this paramter..or if any sample code...

Thanks,

Shyam.

3 REPLIES 3

Former Member
0 Kudos

Hi,

You need to pass the Structure of p0001 table to this RECORD.

Cheers

Kothand

Former Member
0 Kudos

It depends on which Infotype UR updating/inserting/deleting ..

If U want to update/del/insert infotype PA0001 .. then U need

to pass the structure P0001 to the RECORD parameter ..

EX :

DATA : p0001 like P001 occurs 0 with header line .

call function 'HR_INFOTYPE_OPERATION'

exporting

infty = '0001'

number = p0001-pernr

subtype = p0001-subty

objectid = p0001-objps

lockindicator = p0001-sprps

validityend = p0001-begda

validitybegin = p0001-endda

recordnumber = p0001-seqnr

record = p0001

operation = 'DEL'

  • TCLAS = 'A'

  • DIALOG_MODE = '0'

  • NOCOMMIT =

  • VIEW_IDENTIFIER =

  • SECONDARY_RECORD =

importing

return = l_return.

Look at standard report : RPTQTA00

or BAPI .. BAPI_PERSDATA_CREATE

former_member188685
Active Contributor
0 Kudos

First you need to Lock the PERNR, then call the function, and then unclock the PERNR.

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
    EXPORTING
      number = p0003-pernr
    IMPORTING
      return = return_struc.

IF NOT return_struc IS INITIAL.
    WRITE: / pernr-pernr, (70) return_struc-message.
    REJECT.
  ENDIF.

ALL FUNCTION 'HR_INFOTYPE_OPERATION'
      EXPORTING
        infty                  = '0003'
        number                 = p0003-pernr
*   SUBTYPE                =
*   OBJECTID               =
*   LOCKINDICATOR          =
        validityend            = p0003-endda
        validitybegin          = p0003-begda
        recordnumber           = p0003-seqnr
        record                 = p0003
        operation              = 'MOD'
*   TCLAS                  = 'A'
        dialog_mode            = '1'
*   NOCOMMIT               =
*   VIEW_IDENTIFIER        =
*   SECONDARY_RECORD       =
      IMPORTING
        return                 = return_struc
        key                    = record_key.

    IF NOT return_struc IS INITIAL.
      WRITE: / return_struc.
    ELSE.
      WRITE: / 'Record '(002), record_key, 'modified'(003).
    ENDIF.

  CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
    EXPORTING
      number = p0003-pernr.