Skip to Content
0
Jun 09, 2009 at 04:19 PM

Infotype 0315 u2013 Unable to insert data using HR_MAINTAIN_MASTERDATA

70 Views

Hi Guys,

I am trying to insert the data in infotype 0315 using HR_MAINTAIN_MASTERDATA.

My program created a record in PA0315 with PERNR, BEGDA and ENDDA only. I am passing KOSTL and LSTAR in the internal table but these 2 fields are not being populated in PA0315. Employee already exists in the system.

Below is the program for your reference. Please tell me what I am missing?

This program executes without any error, but does not update fields KOSTL and LSTAR.

REPORT  zmg_update_it007                        .

DATA: gi_prop_vals TYPE TABLE OF pprop,
      gi_modified_keys TYPE TABLE OF pskey,
      gw_return TYPE bapireturn,
      gw_return1 TYPE bapiret1.

DATA: gw_prop_vals TYPE pprop.

*// Input Parameter
PARAMETERS: g_pernr LIKE p0000-pernr.

*// IT0315 - Sender Cost Centre
MOVE '0315' TO gw_prop_vals-infty.
MOVE 'KOSTL' TO gw_prop_vals-fname.
MOVE '0000226043' TO gw_prop_vals-fval.
APPEND gw_prop_vals TO gi_prop_vals.

*// IT0315 - Activity type
MOVE '0315' TO gw_prop_vals-infty.
MOVE 'LSTAR' TO gw_prop_vals-fname.
MOVE 'FI-02' TO gw_prop_vals-fval.
APPEND gw_prop_vals TO gi_prop_vals.

*//   Lock Employee
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
  EXPORTING
    number = g_pernr.

CLEAR: gw_return, gw_return1.
CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
  EXPORTING
    pernr              = g_pernr
    actio              = 'INS'
    tclas              = 'A'
    begda              = '20081201'
    endda              = '99991231'
  IMPORTING
    return             = gw_return
    return1            = gw_return1
  TABLES
    proposed_values    = gi_prop_vals
    modified_keys      = gi_modified_keys
  EXCEPTIONS
    OTHERS             = 1.

*//   Unlock Employee
CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
  EXPORTING
    number = g_pernr.

IF NOT gw_return1 IS INITIAL.
  WRITE: gw_return1-number.
  WRITE: gw_return1-message.
ELSE.
  MESSAGE s054(hrwpc_pcr).
ENDIF.

Thanks a lot for your help.

mini