Fonction SAP BAPI_PTMGRATTABS_MNGCREATION - BAPI: Creates Attendances/Absences

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
ABS_ATT_TYPE BAPIHRTYPES-ABS_ATT_TYPE C 4 Att./Absence Type
EMPLOYEENUMBER BAPIHRITBASE-EMPLOYEENUM N 8 Personnel Number
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
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

Paramètre Reférence Type Long. Description
ABSENCE_FLAG BAPIHRTYPES-ABSENCE_FLAG C 1 Absence Indicator
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 New Record
LOCKINDICATOR BAPIHRITBASE-LOCKINDICATOR C 1 Lock Indicator for HR Master Record
WORKTAXAREA BAPIHRTYPES-WORKTAXAREA C 4 Tax Area Work Center

Paramètre Reférence Long. Facultatif Description
RETURN BAPIRET2 548 Message Table

Functionality
This method creates attendance/absence records. The record to becreated is checked for consistency. Information for different(alternative) payment and for account assignment (cost assignment andactivity allocation) can also be created here.

Notes
This method does not support country-specific information such as anyillnesses linked to the records or any manual changes for continued paydata and the like.
This method uses single entry of data records. Thus, you have to callup this method frequently when creating several attendance/absencerecords at a time.

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

Description
The short texts for the attendance and absence types are returned inthis structure.

Description
This output structure contains the following:

  • All original attendance/absence data (see HRABSATT_IN parameter)
  • that has been changed so far in the sytem
    • Derived length of attendances/absences

    • The following detail information can be recorded for attendance/absence data:
      Calendar days
      Number of calendar days included in this record
      Attendances
      Counted attendances
      Attendance/absence days
      Counted attendance/absence days
      Accounting hours
      Derived number of hours for acounting and/or quota deduction
      Accounting days
      Derived number of days for accounting and/or quota deduction
      Quota Deduction
      If the record is deducted from a time quota, the time quota taken isentered in this field
      Time Unit
      Internal key of the time unit for quota taken
      ISO Code of Time Unit
      Time unit for quota taken in ISO code format
      Time Unit Text
      Short description of the time unit

      Description
      Each attendance and absence record is identified by a unique key. Thekey differs from the usual infotype key and comprises the fields inthis structure. The attendance or absence key is assigned automaticallyby the system when a new record is created and comprises the followingfields:

      • LOGICALSYSTEM - logical system of original document

      • DOCUMENTNUMBER - internal document number

      • After a new attendance or absence record has been created, the key isreturned in this structure.

        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 process. They are not taken intoconsideration in payroll, when transferring account assignment data, orin quota deduction.
        You can create a locked record if you have the relevant HRauthorization. Please note that the lock indicator is set automaticallyby the system for some HR authorizations.

        Description
        For information on tax areas at work centers, see the relevant dataelement documentation on the Tax center work area
        .

        Description
        The attendance/absence type must always be entered when inserting a newrecord. The attendance/absence type contains certain technical featuresrequired by the system for counting purposes, possible durations,conditions for days off and so on. The attendance/absencetype is also used to differentiate between attendances and absences.

        Description
        The employee personnel number is a mandatory parameter. It is a keyfield in all of the HR internal structures and is the explicitindividual code for identifying an employee.
        For more information on the personnel number, see the relevant dataelement documentation: personnel number

        Value range
        Numerical, 8-characters
        00000001 - 99999999

        Description
        You specify the general parameters for the attendance or absence inthis structure:
        Start and end date : obligatory
        Start and end time : optional
        Number of hours : optional
        The clock times and number of hours are subject to the followingdependencies and conditions:

        • If the start and end times are specified, the number of hours is
        • ignored. The number of hours is derived from the clock times and theemployee's daily work schedule when the record is counted.
          • If the start time and the number of hours are specified, but no end
          • time, the end time is derived when the record is counted.
            • If the end time and the number of hours are specified, but no start
            • time, the start time is derived when the record is counted.
              • If only the number of hours is specified, there are two possible system
              • reactions:
                Time recording without clock times: (feature HRSIF returns the value'X')
                Clock times are not generated.
                Time recording with clock times: (HRSIF returns the the value ' ').
                Clock times are generated by the system on the basis of the personalwork schedule.
                • The HR system only accepts a number of hours and/or clock times for
                • partial-day and one-day records (start date = end date).
                  Note: Please note that you cannot change the generated clock times ornumber of hours when using the function module, as you can whenentering the data online. If you use the function module, you shouldprovide a change mode for new data in your transaction. You can use thefunction module BAPI_PTMGRATTABS_MANAGECHANGE.
                  Full-day flag : optional
                  Specifies that the record being created must be a full-day record. Ifthis parameter is active, the entries in the Start time, Endtime, and Number of hours fields are ignored.
                  Previous day flag: optional
                  This field can only be selected for attendances. The contents of thefield are ignored for absences. For more information on previous dayassignment in the HR system, please see the R/3 library.

                  Description
                  This is an import parameter storing information on activity allocationfor the attendance or absence records.

                  Description
                  This is an import parameter storing information on different paymentfor the attendance or absence records.
                  For information on the meaning of the individual parameters, please seethe relevant data element documentation.

                  Description
                  This is an import parameter storing information on cost assignment forthe attendance or absence records.

                  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 process. They are not taken intoconsideration in payroll, when transferring account assignment data, orin quota deduction.
                  You can create a locked record if you have 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 information on tax areas at work centers, see the relevant dataelement documentation on the Tax center work area
                        .

                        Description
                        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.