sitemap
ABAP HR
Guidelines to retrieve Time data

Reading Data

Infotypes 2000 to 2999 are time infotypes. The time data in these infotypes stored in
Tables PA2000 to PA2999. Infotypes are declared with the INFOTYPE statement, and
Data is made available for processing in the internal infotype tables (infotype 2011 is an
Exception)

You should not load all time infotype records from the lowest to highest system dates
Into the main memory. This would quickly lead to a memory overload, especially if a
Front-end time recording system is connected to your HR system.
This is why time data should be read only for a specific period.

Use the infotype declaration supplement MODE N to define that the internal time
Infotype tables should be declared but not filled at the GET PERNR time point.
Later you can fill these tables using a statement with selection period parameters.
Use the following report to read time data:


    REPORT RPABAP05.
    TABLES: PERNR.
    INFOTYPES: 2001 MODE N.
    GET PERNR.
    RP-READ-ALL-TIME-ITY PN/BEGDA PN/ENDDA.
    LOOP AT P2001.
    WRITE: / P2001-ABWTG.
    ENDLOOP.

An ABAP/4 macro reads the time data. This macro uses the data selection period
Parameter of the selection screen.

Due to the time constraint of infotypes, several special features must be taken into
account when processing time data. Views of time data are generally not practical.
In time infotypes, data is determined on the basis of the validity period.
When you enter an absence record, the number of days of absence is calculated on the
basis of the absence period.

In a view, new partial periods are created without any changes being made to infotype
data. This would lead to incorrect results in time infotypes, since this data depends on
the validity period.

For example, if, a leave record extends from the middle of January to the middle of
February and 20 days of leave are calculated for this period, then a view for the month
of February would result in a leave record which extends from the beginning to the
middle of February. The number of days of leave would not have changed and the
information would be incorrect.

In master data, the time constraint is a definite feature of the infotype or subtype.
There are no time dependencies between infotypes and subtypes.

Time data is basically different. Let us assume that an employee becomes sick during
vacation. The leave record is then delimited on the first day of the sickness, and the
sickness record follows. Likewise, the system prohibits the entry of a leave record that
coincides with a sickness record. The same also applies to overtime during a sickness.

The time dependency of time infotype records is not limited only to dependencies
between records of one and the same infotype, but covers all infotypes and subtypes.
The time constraint of time infotypes is not an attribute but is defined by the
relationships between infotypes.

Moreover, certain time infotype records have specific clock-in/clock out times. Several
records may therefore exist for one infotype on a particular day. Since views require
explicit data and this prerequisite is not fulfilled by time infotypes, you should not use
joins and projections for time data.

Time infotype tables are processed with the LOOP statement since the PROVIDE
statement limits, and thus changes, the infotype begin and end dates to the data
selection period.

Processing 'Time Data'

· Dependence of time data on validity period
· Importing time data
· Processing time data using internal tables

Time Data and Validity Period

· Time data always applies to a specific validity period.
· The validity periods of different types of time data are not always the same as the
date selection period specified in the selection screen.

Date selection period |---------------|
Leave |-------------|

· PROVIDE in this case is therefore not used for time infotypes.

Importing Time Data

· GET PERNR reads all time infotypes from the lowest to highest system data, not only
those within the date selection period.
· To prevent memory overload, add MODE N to the infotype declaration. This prevents
the logical database from importing all data into infotype tables at GET PERNR.
· Use macro RP-READ-ALL-TIME-ITY to fill infotype table.

    INFOTYPES: 2001 MODE N.
    GET PERNR.
       RP-READ-ALL-TIME-ITY PN/BEGDA PN/ENDDA.
       LOOP AT P0021.
            If P0021-XYZ = ' '. A=B. Endif.
       ENDLOOP.
    Processing Time Data
    · once data is imported into infotype tables, you can use an internal table
    to process the interested data.
    DATA: BEGIN OF ITAB OCCURS 0,
                 BUKRS LIKE P0001-BUKRS, "COMPANY
                 WERKS LIKE P0001-WERKS, "PERSONNEL AREA
                 AWART LIKE P2001-AWART, "ABS./ATTEND. TYPE
                 ASWTG LIKE P2001-ASWTG, "ABS./ATTEND. DAYS
              END OF ITAB.
    GET PERNR.
    RP-PROVIDE-FROM-LAST P0001 SAPCE PN-BEGDA PN-ENDDA.
    CLEAR ITAB.
    ITAB-BUKRS = P0001-BURKS. ITAB-WERKS = P0001-WERKS.
    RP-READ-ALL-TIME-ITY PN/BEGDA PN/ENDDA.
    LOOP AT P2001.
         ITAB-AWART = P2001-AWART. ITAB-ASWTG = P2001-ASWTG.
         COLLECT ITAB. (OR: APPEND ITAB.)
    ENDLOOP.
Back to ABAP HR Page
All of the  product names here are trademarks of their respective companies.  The site
www.allsaplinks.com no way affiliated with SAP AG. We have made every effort for the content
integrity.  Information used on this site is at your own risk.
SapMaterial.com
ABAP TECHNICAL

SAP Introduction

sap abap faq

sap Tables

SAP Transaction codes

Internal tables

data dictionary

performance tuning

transports & Requests

Sap scripts

Smartforms

lsmw

reports

sap Workflow

module pool/ dialog
programming

table control

user exits

sap memory

abap memory

alv reports

ABAP ADVANCED

IDOC

ALE

BAPI

BADI

RFC


FUNCTIONAL SIDE

Materials Management

FICO

Human Resources

BIW / BW / SEM


Free Documentation
Abap Material

Ale Material

BAPI Material

BC Material

IDOC Material

R/3 Database Management

SAP material

RFC

Transport

Sales & Distribution Material

Basic Data and Function
Material

Basis (BC) Material

Billing Material

CA Material

CATT : Computer Aided Test
Tool

Capacity Evaluation and
leveling Material

Capacity Planning Material

Cross Application Material

Countries

Customer Service Material

Enterpise  Material

Financial / Controlling (FICO)

Internet Time Sheet

Inspection Material

HR Material

Material Management
Material

Payments Material

Payroll Material

Pension Fund

Production Planning and
Control

Plant Maintenance

Quality Management Material

Real Estate Material

SAP material

Wage Types