Open all | Close all


Function module HR_INFOTYPE_OPERATION

The HR_INFOTYPE_OPERATION function module is used for the Maintenance of HR infotypes, such as inserting, changing, deleting data etc

Parameters Explained
Here is a list of the fm's parameters and how they are used, obviously not all parameters will be used depending on what function you are performing i.e. insert, change, delet etc

infty - Infotype being updated

objectid - object id from infotype

number - Personnel number

validityend - validity end date

validitybegin - validity begin date

record - infotype record values to be updated, inserted etc (will be structure of infortyoe you are updating)

recordnumber - sequence nunber from infotype record you are updating

Operation - describes what operation is to be performed
COP = Copy
DEL = Delete
DIS = Display
EDQ = Lock/unlock
INS = Create
LIS9 = Delimit
MOD = Change
INSS = Create for Actions is not converted to Change

nocommit - commit yes('X') / no(' ')

dialog_mode - dialog mode or not, default is '0'

Example coding for MOD operation
      CONSTANTS: change TYPE pspar-actio VALUE 'MOD'.

      "loop at p0071 into p_p0071.  "added to put code in context
      validitybegin = p_record-begda.
      validityend   = p_record-endda.
      p_record-endda = pn-begda - 1.

      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
        EXPORTING
          infty         = '0071'
          subtype       = p_record-subty
          objectid      = P_record-objps
          number        = p_record-pernr     "employeenumber
          validityend   = validityend
          validitybegin = validitybegin
          record        = p_record
          recordnumber  = p_record-SEQNR
          operation     = change
          nocommit      = nocommit
          dialog_mode   = '0'
        IMPORTING
          return        = return_struct
          key           = personaldatakey
        EXCEPTIONS
          OTHERS        = 0.

       "endloop.

Example coding for INS operation
      CONSTANTS: insert TYPE pspar-actio VALUE 'INS'.
      validitybegin = p_record-begda.
      validityend   = p_record-endda.
      p_record-begda =  pn-begda.
      p_record-endda =  validityend.
      p_record-begda = pn-begda.
      p_record-subty = p_SUBTY.  "subtype of new entry
      p_record-SCREF = p_SUBTY.  "subtype of new entry
      "plus populate any other fields you need to update

      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
        EXPORTING
          infty         = '0071'
          subtype       = p_record-subty
          number        = p_record-pernr     "employeenumber
          validityend   = validityend
          validitybegin = validitybegin
          record        = p_record
          operation     = insert
          nocommit      = nocommit
          dialog_mode   = '0'
        IMPORTING
          return        = return_struct
          key           = personaldatakey
        EXCEPTIONS
          OTHERS        = 0.