SAP Function BAPI_PTMGRATTABS_MNGCHANGE - Change Attendances/Absences

Parameter Reference Type Length Default Optional Text
HRABSATT_IN BAPIHRABSATT_IN u 34 Entry Structure for Attendances/Absences
HRACTIVITYALLOC BAPIHRACTIVITYALLOC u 328 X Activity Allocation
HRALTPAYMENT BAPIHRALTPAYMENT u 45 X Different Payment
HRCOSTASSIGN BAPIHRCOSTASSIGN u 196 X Cost Assignment
HRTIMESKEY BAPIHRTIMESKEY u 30 Object Key for Record to be Changed
LOCKINDICATOR BAPIHRITBASE-LOCKINDICATOR C 1 X Lock Indicator for HR Master Record
SIMULATE BAPIHROPERATION-TESTRUN C 1 ' ' X Simulation Mode
WORKTAXAREA BAPIHRTYPES-WORKTAXAREA C 4 X Tax Area Work Center

Parameter Reference Type Length Text
ABSENCE_FLAG BAPIHRTYPES-ABSENCE_FLAG C 1 Absence Indicator
ABS_ATT_TYPE BAPIHRTYPES-ABS_ATT_TYPE C 4 Absence or Attendance Type
EMPLOYEENUMBER BAPIHRITBASE-EMPLOYEENUM N 8 Personnel Number
HRABSATTEXT BAPIHRTYP_TEXT-ATYPE_TEXT C 25 Short Name for Attendance/Absence Type
HRABSATT_OUT BAPIHRABSATT_OUT u 68 Detail Data on Attendance/Absence Records
HRTIMESKEY BAPIHRTIMESKEY u 30 Object Key for Record to be Changed
LOCKINDICATOR BAPIHRITBASE-LOCKINDICATOR C 1 Lock Indicator for HR Master Record
WORKTAXAREA BAPIHRTYPES-WORKTAXAREA C 4 Tax Area Work Center

Parameter Reference Length Optional Text
RETURN BAPIRET2 548 Message Table

Functionality
Thi method changes data records in the Absences (2001) andAttendances (2002) infotypes.

Notes
The record to be changed is specified in the Object key for recordto be changed.
The new attendance/absence data is entered in the structureHRABSATT_IN. New account assignment or different paymentinformation is transferred by the structures HRCOSTASSIGN,HRACTIVITYALLOC and HRALTPAYMENT.
If the SIMULATE parameter is marked, then only a consistencycheck of the changed data and a collision check with the existingdatabase records takes place. No check is performed for any of the newattendance/absence records and those records that are not yet saved.
For more information on function modules, see the documentation on thefunction module in BAPI_PTMGRATTABS_MNGCREATE.

Further information
You will find the valid record key for calling theBAPI_MGRATTABS_MNGCHANGE in the function moduleBAPI_EMPATTABS_GETLIST.
Prior to calling the function module Update mode (SIMULATE = ""), you have to lock the personnel number for the employee whose timerecord you want to change.
The function module BAPI_TRANSACTION_COMMIT must be called towrite the changed time record to the database.
If any critical errors occur during processing, the database changes inthe Logical Unit of Work are also changed in theembedded function module. The BAPI_TRANSACTION_ROLLBACK is thencalled.

Description
This field indicates an absence record. The indicator is set if absencedata is returned. The field remains blank for attendances.

Description
For more information on attendance and absence types, see thecorresponding data element documentation on the Attendanceor absence type.

Description
For information on the meaning of the personnel number, see the dataelement documentation on the personnel number.

Description
INCLUDE BAPI_DATAELEMENT

Meaning
This output structure contains all of the

  • Original attendance/absence data (see parameter HRABSATT_IN),
  • and
    • All accompanying attendance/absence reasons

    • Depending on the validity period entered, the following detail data canbe queried for attendance/absence data:
      Calendar days
      Attendance/absence hours
      Attendance/absence days
      Accounting (payroll) hours
      Accounting (payroll) days
      Quota deduction
      If the record is deducted from a time quota, then this field containsthe time quota taken.
      Time/measurement unit
      ISO code for time measurement unit
      Time unit for quota taken in ISO code format
      Text for time unit
      Short description of the time/measurement unit

      Description
      Each attendance and absence record is identified by a unique key. Thekey is not the same as the usual infotype key and comprises the fieldsof this structure. The attendance or absence key is assignedautomatically by the system when a new record is created.
      The key must be specified if an existing attendance or absence recordis changed. The keys of existing records are returned inBAPI_EMPATTABS_GETLIST.

      Description
      This field indicates the status of a record in the HR System. If thefield is activated, the record is locked. Locked records are inthe middle of an approval procedure. They are not taken into account inpayroll, when transferring account assignment data, or in quotadeduction.
      You can change a locked record if you are assigned the relevant HRauthorization. Please note that the lock indicator is set automaticallyby the system for some HR authorizations.

      Description
      For more information on work center tax areas see the correspondingdata element documentation on the Tax area workcenter.

      Meaning
      This structure contains all of the general parameters for attendancesand absences.

      • FROM_DATE From date : obligatory

      • TO_DATE To date : obligatory

      • START_TIME Start time : optional

      • END_TIME End time : optional

      • ABS_ATT_HOURS Att./Absence hours : optional

      • ALL_DAY_FLAG Full-day record : optional

      • If this indicator is set, the data record becomes a full-day record,and the entries in the Start time, End time, andAtt./absence hours fields are ignored.
        PREVIOUS_DAY Previous day indicator : optional
        This field can only be set for part-day attendances. The field isignored for absences.

        Notes
        The following dependencies and conditions exist for the clock times andnumber of hours:

        • If the start and end times are specified, the number of hours is
        • ignored. It is derived from the clock times and the employee's dailywork schedule when the record is counted.
          • If the start time and the number of hours are specified without an end
          • time, the end time is derived from the first two entries when therecord is counted.
            • If the end time and the number of hours is specified without a start
            • time, the start time is derived from the first two entries when therecord is counted.
              • If only the number of hours is specified there are two options:

              • Time recording without clock times: (Feature HRSIF returns the value"X") Clock times are not generated.
                Time recording with clock times: (HRSIF returns the value " ") Thesystem generates clock times on the basis of the employee's personalwork schedule.
                • The HR system only accepts the entry of a number of hours and/or clock
                • times for records of less than one day (start date = end date).

                  Description
                  This is an import parameter containing information on activityallocation for the attendance and absence records.

                  Description
                  This is an import parameter containing information on a differentpayment for the attendance and absence records.
                  For information on the meaning of the individual parameters, see therelevant data element documentation.

                  Description
                  This is an import parameter containing information on cost assigmentfor the attendance and absence records.

                  Description
                  Each attendance and absence record is identified by a unique key. Thekey is not the same as the usual infotype key and comprises the fieldsof this structure. The attendance or absence key is assignedautomatically by the system when a new record is created.
                  The key must be specified if an existing attendance or absence recordis changed. The keys of existing records are returned inBAPI_EMPATTABS_GETLIST.

                  Description
                  This field indicates the status of a record in the HR System. If thefield is activated, the record is locked. Locked records are inthe middle of an approval procedure. They are not taken into account inpayroll, when transferring account assignment data, or in quotadeduction.
                  You can change a locked record if you are assigned the relevant HRauthorization. Please note that the lock indicator is set automaticallyby the system for some HR authorizations.

                  Description
                  If this parameter is marked, then you are in simulation mode. Allvalidations are carried out that are required to create a new infotyperecord.
                  The simulation mode is only used to check a record if no subsequentphysical database change is intended. The "Change" function isperformed and the record is validated. The database buffer is notinitialized until this is done.
                  If want to change several attendance or absence records in succession,you should not use the simulation mode. Otherwise there is a risk thatthe HR time data collision check does not recognize overlapping datarecords and consequently gives the incorrect impression that therecords have been inserted without errors.
                  There are two possible scenarios for changing several attendances orabsences at the same time:

                  • The attendance/absence data is held in a transaction buffer of the
                  • relevant application:
                    The method is called without simulation for each individual record
                    In the case of a critical error due to collision: MethodBAPI_TRANSACTION_ROLLBACK is called
                    The entry data is corrected
                    The process is repeated
                    Otherwise BAPI_TRANSACTION_COMMIT is used to post the data physically
                    • The attendance/absence data is written in a loop to the corresponding
                    • ABAP structures and transferred to the PTManagerAttAbsence.ManageChangemethod:
                      The function module is called without simulation
                      If successful, BAPI_TRANSACTION_COMMIT is called (irrevocable databasechange)
                      In the case of a critical error, BAPI_TRANSACTION_ROLLBACK is called,and you return to data maintenance for correction
                      The above steps are repeated for each of the subsequent records
                      Notes:
                      • The personnel number is not locked in a simulation run.

                      • For technical reasons, no details on the time record can be displayed
                      • in the simulation run (structure HRABSATT_OUT is empty).

                        Description
                        For more information on work center tax areas see the correspondingdata element documentation on the Tax area workcenter.

                        U1&MEANING&
                        Table with messages from record processing.
                        Critical errors are assigned the categories E (error) and A
                        (abort). Warnings are indicated by a W, information andsuccess messages by I and S respectively.
                        If at least one E or A record appears in the table, theattendance/absence record was rejected by the system.