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: 

How to UPDATE MASTER DATA RECORD PA0377 using FM HR_INFOTYPE_OPERATION

Former Member
0 Kudos
189

How to UPDATE MASTER DATA RECORD IN INFOTYPE 0377 DIRECTLY using function module HR_INFOTYPE_OPERATION ? When i use operation = 'MOD' im getting an ERROR as NO DATA STORED FOR 0377 IN SELECTION PERIOD.

Can anyone please help me how to use HR_INFOTYPE_OPERATION to UPDATE MASTER DATA RECORD.

Thanks,

Karthi.

4 REPLIES 4

Former Member
0 Kudos
110

Hi,

It looks like no data exist for that PERNR in PA0377.Or You can use FM 'HR_MAINTAIN_MASTERDATA'to modify the data.

Thanks & regards,

Rock.

Former Member
0 Kudos
110

check if UR passing all the parameters to the FM ..

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = '0377'

number = innnn-pernr

subtype = l_0377-subty

objectid = l_0377-objps

lockindicator = l_0377-sprps

validityend = wa_0377-endda

validitybegin = wa_0377-begda

recordnumber = l_0377-seqnr

record = wa_0377

operation = 'MOD'

IMPORTING

return = l_return.

Former Member
0 Kudos
110

HI,

Check this Code

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.

Former Member
0 Kudos
110

Hi,

please check this code

it is very useful

infotypes: 0105.

parameters: p_pernr type p0105-pernr,
            p_subty type p0105-subty,
            p_begda type p0105-begda,
            p_endda type p0105-endda,
            p_opera type pspar-actio,
            p_usrid type p0105-usrid,
            p_commt as checkbox.    "Useful only when NO_COMMIT is 'X'

data: w_return type bapireturn1,    "Error handling data
      w_key type bapipakey,         "If record has been created or changed the created/ changed
                                    "record's key (PSKEY) will be populated
      v_message type string.        "For printing returned messages

call function 'BAPI_EMPLOYEE_ENQUEUE'
  exporting
    number = p_pernr
  importing
    return = w_return.

if w_return is initial. "Employee is not locked

  p0105-pernr = p_pernr.
  p0105-subty =
  p0105-usrty = p_subty.
  p0105-begda = p_begda.
  p0105-endda = p_endda.
  p0105-usrid = p_usrid.
*Calls Internally HR_MAINTAIN_MASTERDATA
  call function 'HR_INFOTYPE_OPERATION'
    exporting
      infty         = '0105'
      number        = p_pernr
      subtype       = p_subty
      validityend   = p_endda
      validitybegin = p_begda
      record        = p0105
      operation     = p_opera
      dialog_mode   = '0'
      nocommit      = 'X'
    importing
      return        = w_return
      key           = w_key.
endif.

if w_return is not initial.

  message id w_return-id type w_return-type number w_return-number
          with w_return-message_v1 w_return-message_v2 w_return-message_v3
          w_return-message_v4 into v_message.

  case w_return-type.
    when 'A' or 'E'.
      format color col_negative. write:/ v_message.
    when others.
      format color col_heading. write:/ v_message.


  endcase.

  call function 'BAPI_EMPLOYEE_DEQUEUE'
    exporting
      number = p_pernr.

else.

  format color col_positive. write:/ 'Record Updated Successfully.'.
  if w_key is not initial.
    write:/ 'Key contains',
          / 'Personnel Number:', w_key-employeeno,
          / 'Subtype (absence type):', w_key-subtype,
          / 'Start date of Absence:', w_key-validbegin,
          / 'End date of Absence:', w_key-validend.
  endif.

  commit work.

endif.

Thanks and regards

durga.K