Use of RP_PROVIDE_FROM_LAST
Hi experts ,
I need to fatch the record base on PERNR in RFC . as well i need fatch data from othere info type . but my requirement is i need last record .
there is some thread to use RP_PROVIDE_FROM_LAST , but i am not confident to how can use this .
Please if any body have sample program please send me . so i can refeer the same .
Regards
Ajay Pandey
GET PERNR.
RP_PROVIDE_FROM_LAST P0002 SPACE PN-BEGDA PN-ENDDA.
LOOP AT P0002.
MOVE: P0002-VORNA TO GW_0002-VORNA,
P0002-NACHN TO GW_0002-NACHN.
MODIFY GT_0002 FROM GW_0002
TRANSPORTING BEGDA WHERE PERNR = P0002-PERNR.
ENDLOOP.
I used this code but i not know how i will make this with my import parameters . and i am getting two records
Similar Messages
-
Proper use of rp_provide_from_last
Hello Experts,
I've used the macro rp_provide_from_last p0000 space pn-begda pn-endda
pn-begda = 05.07.2010
pn-endda = 05.07.2010
I can't retrieve the last record with
p0000-begda = 07.07.2010
p0000-endda = 31.12.9999
Instead I keep retrieving the second to the last record with
p0000-begda = 01.09.2009
p0000-endda = 06.07.2010
What is the reason why I keep retrieving the second to the last record? Hope you can answer my query.
Thanks in advancegive
pn-begda = 01.01.1800
pn-endda = 31.12.9999
With this specification you will always retrieve the latest record.
In short the macro will give you the last record in the given dates i.e. last record between pn-begda and pn-endda.
cheers
AJ
Edited by: Ajay Hosur on Jul 16, 2010 7:02 AM -
System unable to read table in Adhoc Query
Hi Experts,
I am trying to extract a report based on Infotype 0022 through Adhoc query. Even after maintaining data for IT0022 for a few employees the system is unable to read the educational details of those employees.
I am unable to trace the defect . can anybody please tell me what could be the reason. I have checked the table PA0022, there the data is been stored.
Thanks & Regards,
SmithaHi paul and experts
actuall im reading data from 0022 infotype . im using macro
rp_provide_from_last p0022 '11' pn-begda pn-endda.
no data found for this.
but in pa30 for that particular employee data is there.
please help me out of this.
thanks a lot -
How to write macro's in hr abap
Hi,
All
I am new to HR ABAP .Does any body give links to write macro's in HR ABAP
Thanks in advance.
regards
Ramh,
adding to the aboce post.
chk this.
Macros:
Introduction
Programs that process the cluster data (for example, RX) do not access the cluster independently. The data is accessed using a defined interface created with macros.
Macro contains some part of source code which it will be useful for number of applications. Macro is module which is stored
Naming Conventions of Macro:
RP-aaa-bb-cc
aaa is the type of Macro. It takes two values
o IMP Import Macro
o EXP Export Macro
bb is the Database table where the data is saved:
o C1 Database object PCL1
o C2 Database object PCL2
o C3 Database object PCL3
o C4 Database object PCL4
Cc is the cluster, it may take
o RX Cluster object RX
o RD Cluster object RD
o B2 Cluster object B2 and so on.
Defining and Calling the Macros
Defining:
There are two options for defining the Macros
Macros are defined using the ABAP Commands DEFINE .END-OF-DEFINITION. A macro can be used within a report or within include. If a macro is used in a report, and the macro is defined in include with the DEFINE command, include must be integrated.
Macros can also be defined as RMAC macros. The source code of these modules is stored in the function section of the control table TRMAC. The coding is grouped under a specific name in the table key.
According to conventions, the first two letters of the name must stand for the application. The rest of the name is freely definable.
Difference between the two methods is:
If a macro is changed, each report using this macro is automatically regenerated when it is executed.
When you change a RMAC macro in the table TRMAC, the reports that use this macro are not regenerated automatically. You must regenerate them manually.
Standard HR Macros
o The macro RP-PROVIDE-FROM-FRST retrieves the first(start) data record which is valid in the data selection period.
o The macro RP-PROVIDE-FROM-LAST retrieves the last(latest) data record which is valid in the data selection period.
o The macro RP-READ-INFOTYPE retrieves the data record(s) which is valid in the data selection period.
How to check whether the macro operation is successful or not
For every macro, whether the operation was successful or not will be checked with
PNP-SW-FOUND.
If PNP-SW-FOUND = 1, then the operation is successful.
Where exactly the Macro code is stored
The program code pertaining to this macro is stored in the control table RMAC
Guidelines for how and when to use the Standard Macros
o RP_PROVIDE_FROM_FRST
Use macro RP_PROVIDE_FROM_FRST in programs for the logical databases PNP and PAP where the first data record for a period (can be a subtype) is read from an infotype table. The infotype table has been filled earlier (for example, with GET PERNR or RP_READ_INFOTYPE). This macro is only helpful if the infotype has time constraint 1 or 2.
Prerequisites
The validity begin date of the time period must be before or the same as the validity end date.
Validity start and end dates are correct (preferably of the type DATE).
The infotype table is sorted in ascending order. Otherwise, you would receive the first fitting table entry that might not necessarily correspond to the first time entry.
Features
The first entry for a specified period is placed in the table header entry from an internal infotype table.
Parameters
RP_PROVIDE_FROM_FRST inftytab subty beg end
IN : 1) Name of the internal table
2) Subtype required or SPACE if no subtype is being specified
3) Validity start date of the time interval
4) Validity end date of the time interval
OUT: 1) PNP-SW-FOUND: has the value 0 if there is no matching entry in the infotype table in the given time period. Otherwise it has the value 1.
2) The matching table header entry if PNP-SW-FOUND = 1 or
the initial table header entry if PNP-SW-FOUND = 0
Example
(RP_PROVIDE_FROM_FRST inftytab subty beg end)
RP_PROVIDE_FROM_FIRST P0021 '1' PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND EQ '1'.
ENDIF.
or
RP_PROVIDE_FROM_FRST P0001 SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND EQ '0'.
WRITE: / 'Error: Org. assignment is missing' REJECT.
ENDIF.
o RP_PROVIDE_FROM_LAST
You use macro RP_PROVIDE_FROM_LAST in programs for the logical databases PNP and PAP where the last data record for a period (can be a subtype) is read from an infotype table. The infotype table has been filled earlier (for example, with GET PERNR or RP_READ_INFOTYPE). This macro is only helpful if the infotype (or subtype) has time constraint 1 or 2.
Prerequisites
The validity begin date of the time period must be before or the same as the validity end date.
Validity start and end dates are correct (preferably of the type DATE).
The infotype table is sorted in ascending order. Otherwise, you would receive the last fitting table entry that might not necessarily correspond to the last time entry.
Features
The macro RP_PROVIDE_FROM_LAST makes sure that the last entry for a specified period is placed in the table header entry of the report output list.
Parameters
RP_PROVIDE_FROM_LAST inftytab subty beg end
IN : 1) Name of the internal table
2) Subtype required or SPACE if no subtype is being specified
3) Validity begin date of the time interval
4) Validity end date of the time interval
OUT: 1) PNP-SW-FOUND: has the value 0 if there is no matching entry in the infotype table in the given time period. Otherwise it has the value 1.
2) The matching table header entry if PNP-SW-FOUND = 1 or
the cleared table header entry if PNP-SW-FOUND = 0
Example:
RP_PROVIDE_FROM_LAST P0021 '1' PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND EQ '1'.
ENDIF.
OR
RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND EQ '0'.
WRITE: / 'Error: Org. assignment is missing'. REJECT.
ENDIF.
RP_READ_INFOTYPE
You can use the macro in all programs at any point. You can also use it in function modules. In database PNP, an infotype is usually read with GET PERNR. Using macro RP_READ_INFOTYPE is an exception.
You can also use the function module HR_READ_INFOTYPE. For information on how to use the function module, see the documentation on Function Modules.
Prerequisites
The validity begin date of the time period must be before or the same as the validity end date.
Validity begin and end are correct date specifications (preferably of the type DATE).
The infotype table must match the infotype number.
The program using the macro must contain the include DBPNPMAC.
Features
The macro RP_READ_INFOTYPE makes sure that all data records for a person for the specified period are placed in an internal infotype table.
Parameters
RP_READ_INFOTYPE pernr infty inftytab beg end
IN : 1) Personnel number of the person requested
2) Infotype number of the required infotype
3) Name of the internal infotype table
4) Validity start date of the time interval
5) Validity end date of the time interval
OUT: 1) PNP-SW-FOUND = 0, if there is no matching record in the dataset
PNP-SW-FOUND = 1, if there is no matching record in the dataset
2) PNP-SW-AUTH-SKIPPED-RECORD = 0, if the HR authorization check has not retained any records due to incorrect authorizations.
PNP-SW-AUTH-SKIPPED-RECORD = 1 , if the HR authorization check has retained at least one record due to lack of authorization
3) Internal infotype table, containing all matching records for which the user is authorized (this table can also be empty).
Example
(RP_READ_INFOTYPE pernr infty inftytab beg end)
INFOTYPES: 0001.
RP-LOWDATE-HIGHDATE.
DATA: PERNR LIKE P0001-PERNR.
DATA: BEGDA LIKE P0001-BEGDA, ENDDA LIKE P0001-ENDDA.
PERNR = '12345678'.
BEGDA = LOW-DATE + 15
ENDDA = HIGH-DATE - 5.
RP-READ-INFOTYPE PERNR 0001 P0001 BEGDA ENDDA.
IF PNP-SW-AUT-SKIPPED-RECORD EQ '1'.
WRITE: / 'Insufficient authorization'. STOP.
ENDIF.
IF PNP-SW-FOUND EQ '0'.
WRITE: / 'Infotype 0001 missing'. STOP.
ENDIF. -
Dear All,
I have some doubts on HR ABAP. Could you pls give me your best replay on those.
1. What is HR ABAP?
2. What is the main use of HR ABAP?
3. What is the Architecture of HR ABAP and how it will work on ERP.
4. HR ABAP will comes under Netweaver or ERP only?
I will be for your replay...
Regards,
Chandra.The HR module is a true demonstration of the strength of the SAP product in Enterprise Resource Planning.
The Human Resource module is comprised of major areas of functionality known as submodules.The HR system has very strong integration points (where data is passed back and forth without human data entry) with just about all of the other SAP modules. In addition, there is very tight integration amongst the HR submodules.
INFOTYPES:
To begin with , let me give you a small overview on the HR Infotypes .
Infotypes are the units of information in the Human Resource Management System .
Infotypes are used to group related data fields together. They provide information with a structure, facilitate data entry, and enable you to store data for specific periods.
USE :
Recording employee data for administrative, time recording, and payroll purposes is of primary importance for master data administration in HR. In the SAP System, the information units used to enter master data are called infotypes.
Structure
Infotypes are characterized by the following:
Infotype Structure
Data Entry
Time-Dependent Storage of Infotype Data
Infotype Structure
To the user, infotypes appear as data entry screens. They contain whole series of information (for example, last name, first name, date of birth) that you enter in data fields. Data fields concerning the same or similar subject matter are combined into data groups or information units.
In database terms, infotypes represent a data structure or set of related data records. When you update an infotype, old data is not lost but is instead stored in the system for historical evaluation purposes.
Time-Dependent Storage of Infotype Data
When you update an infotype, the old data may not be lost. Instead, it must be retained so that past data can be evaluated. When you update an employee´s personal data, the old data is automatically time-delimited. The system creates a validity period for each infotype record. As a result, each employee infotype has several data records that differ from each other by their validity periods.
Time Constraints in HR Master Data
The concept of Time Constraints is very important in HR ABAP . This is due to the fact that all the infotype records are Time Delimited which is to say that all the records are valid only for a particular time frame .
When you update an infotype, old data is not lost but archived for historical evaluation. The system records a specific period of validity for each infotype, This enables the system to store more than one infotype record at the same time, even if their validity periods overlap. This means that the time relationships between infotype records must be defined. The concept of time constraints enables you to do this.
HR master data uses the following three time constraints:
Time Constraint 1
For the entire time that the employee works at the enterprise, exactly one valid infotype record must exist. The validity periods of the individual records must not overlap. If a new record is created, the system automatically uses the start date of the new record as the delimitation date of the old record. Gaps are only allowed between the employees entry date and the start date of the first record.
Time constraint 1 must be used for all of the infotypes containing information that must be available at all times. This is particularly true of personal and organizational assignment data.
If a record is delimited because of time constraint 1, the system displays an appropriate message.
Time Constraint 2
No more than one valid record can exist at any one time. Records with constraint 2 must not overlap. Their existence is not obligatory. If a new record is created, the system automatically delimits the previous record, if one exists.
If a record is delimited because of time constraint 2, the system displays an appropriate message.
Time Constraint 3
Any number of valid records can exist at any one time. The individual records do not conflict with each other.
BASIC FORM :
INFOTYPES nnnn.
Each info type has a formal description in the ABAP Dictionary as structure Pnnnn
nnnn between 0000 and 0999: HR master data info types
nnnn between 1000 and 1999: HR planning data info types
nnnn between 2000 and 2999: HR time data info types
nnnn between 3000 and 8999: Not yet used
nnnn between 9000 and 9999: Customer-specific info types
Effect
Declares the HR info type nnnn . Creates an internal table as follows:
DATA BEGIN OF Pnnnn OCCURS 10.
INCLUDE STRUCTURE Pnnnn.
DATA END OF Pnnnn VALID BETWEEN BEGDA AND ENDDA.
Example
INFOTYPES: 0000, 0001, 0002.
Addition 1
... NAME c
Effect
c is a name up to 20 characters long. Creates an internal table as follows:
DATA BEGIN OF c OCCURS 10.
INCLUDE STRUCTURE Pnnnn.
DATA END OF c VALID BETWEEN BEGDA AND ENDDA.
Example
INFOTYPES: 0005 NAME VACATION, 0006 NAME ADDRESS.
Addition 2
... OCCURS occ
Effect
occ is a number for the OCCURS value. Creates an internal table as follows:
DATA BEGIN OF c OCCURS m.
INCLUDE STRUCTURE Pnnnn.
DATA END OF c VALID BETWEEN BEGDA AND ENDDA.
Example
INFOTYPES 0003 OCCURS 1.
All the Repository objects required for the infotype have been created. The relevant infotype specific table entries in tables T777T (Infotype texts) and T778T (Infotypes) have been maintained by the infotype copier. The user has maintained the relevant entry in T777I (Infotypes per object type).
Infotype Groups
Definition
An infotype group, or info group, is a sequence of related infotypes that are displayed one after the other for maintenance purposes when a personnel action is performed.
Use
The infogroup guarantees that during the personnel action, all information needed for the business processes is stored.
Structure
An infogroup exists in the standard system for every personnel action type in the Personnel Actions section.
In Customizing for Personnel Administration, you can modify the relationship between individual infogroups and define the infogroups as user-dependent.
In the standard system, different types of employee data are stored in individual infotypes. Rather than accessing each infotype individually and entering data into them, the system can group together the most important infotypes into personnel actions and lead you through processing the employee data.
Personnel actions
Personnel procedures, such as hiring an employee, organizational reassignment, or an employee leaving the enterprise are represented by individual personnel actions in Personnel Administration. Each personnel action contains the infotypes that you must maintain to record the personnel action at hand. The infotypes are retrieved in succession so that you can maintain them. For example, all the fields in which you need to make entries to hire an employee will be offered to you for maintenance automatically by the system in the personnel action Hiring.
This ensures that all the core data is entered into the system. This function also facilitates entering data as you do not need to access each infotype within the personnel action individually .
Example : ORGANISATION INFOTYPE(0001)
The Organisational Assignment (0001) deals with the incorporation of the employee into the organizational structure .
We can display the infotypes from the transaction PA30(Maintain HR Master Data) .
Goto PA30 .
Enter the Personnel No . and the infotype no . in the places shown and then
Create/Change/Display .
On pressing the Display button the following screen appears .
For the particular person (120) the organization structure can be displayed on pressing the Org Structure button .
The Above screen gives us the Organisational Assignment for the particular person . For Example 120 belongs to the Org unit Direction Market Switzerland
Holds the position of Secretary Head Office CH and the position is described by the Job Secretary .
LOGICAL DATABASES:
After this brief discussion on INFOTYPES let us now concentrate on the HR PROGRAMMING BASICS and in General and Logical Databases in Particular .
Hierarchy of a Logical Database
Logical databases are programs that read data from database tables and pass it to other programs for processing. The order of reading the database tables is determined by a hierarchy.
Many tables in the R/3 System are linked using foreign key relationships. Parts of these relationships form tree-like hierarchical structures. Logical databases allow you to read data easily from database tables that form parts of these structures. The logical database F1S has the following hierarchy:
Transaction SE36 .
When reading the tables, the system first reads one element of table SPFLI. Then, it reads the first element of the subordinate table SFLIGHT that, according to the foreign key relationship, belongs to the first element of table SPFLI. Then, it reads all elements of table SBOOK that belong to the first element read from table SFLIGHT. Next, it reads the second element of table SFLIGHT and all corresponding elements of table SBOOK. This step is repeated until the system has read all elements of table SFLIGHT that belong to the first element of table SPFLI. Then the system reads the second element of table SPFLI and the entire procedure starts again. This procedure is repeated until the entire hierarchy has been processed.
Logical databases contain Open SQL statements that read data from the database. You do not therefore need to use SQL in your own programs. The logical database reads the program, stores them in the program if necessary, and then passes them line by line to the application program or the function module LDB_PROCESS using an interface work area.
Structure of Logical Databases
A logical database is made up of three components .They are:
Structure
The structure defines the data view of the logical database. It determines the structure of the other components and the behavior of the logical database at runtime. The order in which data is made available to the user depends on the hierarchical structure of the logical database concerned.
Selections
The selections define a selection screen, which forms the user interface of the executable programs that use the logical database. Its layout is usually determined by the structure. You can adapt the selections to your own requirements and also add new ones. When you link a logical database to an executable program, the selections of the logical database become part of the standard selection screen of the program (screen number 1000).
The database program contains the ABAP statements used to read the data and pass it to the user of the logical database. The structure of the database program is a collection of special subroutines. It is determined by the structure and the selections. You can adapt the database program to your own requirements and also extend it.
Other components such as documentation, language-specific texts, and user-defined selection screens extend the functions further.
Structure
The structure of a logical database is usually based on the foreign key relationships between hierarchical tables in the R/3 System. Logical databases have a tree-like structure, which can be defined as follows:
There is a single node at the highest level. This is known as the root node.
Each node can have one or several branches.
Each node is derived from one other node.
The nodes must be structures defined in the ABAP Dictionary or data types from a type group. Normally, these are the structures of database tables which the logical database reads and passes to the user for further evaluation. However, it is also possible, and sometimes useful, to use ABAP Dictionary structures without an underlying database. For technical reasons, the maximum number of nodes allowed in the structure of a logical database is 300.
Any executable ABAP program that has a logical database linked to it can contain a GET statement for each node of the structure. When you run the program, the corresponding event blocks are processed in the sequence prescribed by the hierarchical structure of the logical database. If a program does not contain a GET statement for every node of a logical database, the processing passes through all the nodes that lie in the path from the root to the nodes specified by GET statements.
Logical Databases - Views of Data
A logical database provides a particular view of database tables in the R/3 System. It is always worth using logical databases if the structure of the data that you want to read corresponds to a view available through a logical database.
The data structure in a logical database is hierarchical. Many tables in the R/3 System are linked to each other using foreign key relationships. Some of these dependencies form tree-like hierarchical structures. Logical databases read data from database tables that are part of these structures.
Retrieving Data Using a Logical Database
After you have specified the logical database in the report attributes, you can access the database in the program. In the declaration part of your program, declare the tables you want to access in the program using the TABLES statement, as described in the SELECT Statement section. This provides the work areas for passing the data from the logical database to the program. The system also configures the selection screen to include fields from the tables you specified.
The program of the logical database places the data from the database tables into the work areas created by the TABLES statement. The logical database then triggers an event. In your program, you catch this event using the keyword GET with the corresponding table name. If, for example, the logical database just filled the work area of table SBOOK, it triggers the event GET SBOOK in your program. The system then executes the statement block belonging to this event.
A statement block starts directly after the event keyword and ends at the next event keyword or at the end of the program.
GET EVENT
This is the most important event for executable programs that use a logical database. It occurs when the logical database has read a line from the node in the hierarchy. You should therefore not use these fields in your program or call subroutines that work with them .
The following program is connected to the logical database F1S.
REPORT EVENT_DEMO.
NODES: SPFLI, SFLIGHT, SBOOK.
START-OF-SELECTION.
WRITE 'Test Program for GET'.
GET SPFLI.
SKIP.
WRITE: / 'From:', SPFLI-CITYFROM,
'TO :', SPFLI-CITYTO.
GET SFLIGHT.
SKIP.
WRITE: / 'Carrid:', SFLIGHT-CARRID,
'Connid:', SFLIGHT-CONNID.
ULINE.
GET SBOOK.
WRITE: / 'Fldate:', SFLIGHT-FLDATE,
'Bookid:', SBOOK-BOOKID,
'Luggweight', SBOOK-LUGGWEIGHT.
ULINE.
The table work area SFLIGHT is also used in the event block for GET SBOOK. Depending on what you enter on the selection screen, the beginning of the list display might look like this:
In the logical database F1S, the nodes SFLIGHT and SBOOK are designated for field selection. This means that you can specify a field list in their GET event blocks:
REPORT EVENT_DEMO.
NODES: SFLIGHT, SBOOK.
GET SFLIGHT FIELDS CARRID CONNID.
GET SBOOK FIELDS BOOKID.
GET SFLIGHT LATE FIELDS PLANETYPE.
In this case, the logical database reads the following fields:
MANDT, CARRID, CONNID, FLDATE, and PLANETYPE from SFLIGHT
MANDT, CARRID, CONNID, FLDATE, and BOOKID from SBOOK
The system reads the fields MANDT and FLDATE from SFLIGHT, even though they are not specified in the field list, since they belong to the table key.
Only the key fields of SBOOK are read.
PROVIDE
PROVIDE Syntax Diagram
Basic form
PROVIDE f1 f2 ... FROM itab1
g1 g2 ... FROM itab2
FROM itabn
BETWEEN f AND g.
See PROVIDE - ENDPROVIDE not allowed .
Effect
Retrieves the contents of the specified fields from the internal tables (itab1, itab2 , ...) and places them in the table header lines within the required range. Also executes the processing block enclosed by the PROVIDE and ENDPROVIDE statements for each range.
Note
For itab1, itab2 ... only tables with header lines are allowed.
Effect
Basic principle:
The diagram below illustrates the functionality of the PROVIDE statement for the most simple case where just two tables A and B are to be processed:
IA1 IA2
|----
| |----
| table A
: IB1 : IB2 : :
: |----
| |----
| : table B
: : PROVIDE area : : :
...|----
|...
:TI1: TI2 :TI3: : TI4 : TI5 : TI6 :
...|-|---|-| |-----|-|---|...
result ranges
The data structures which form the basis for the table lines must each contain two components which can be interpreted as a range (e.g. start date and end date). In the diagram, the ranges belonging to the entries in table A are marked with IA1 or IA2 , and those in table B with IB1 or IB2. If you split the ranges of both tables into overlapping and non-overlapping ranges and then form the intersection with the PROVIDE area, this results in 6 sub-ranges TI1 to TI6. In these sub-ranges, the values of the tables A and B are constant. The PROVIDE statement makes the contents of the tables A and B available for the 6 sub-ranges, one after the other. It thus acts as a kind of loop where the data of the tables involved can be processed with reference to each range.
Effect
General principle
Each of the specified internal tables has two fields which contain the line-related validity range. You can determine these in the
DATA statement with the addition "VALID BETWEEN ... AND ...". If this addition is not used, the first two sub-fields of the table determine these range fields (corresponds to VALID BETWEEN first field AND second field). These fields can be date fields, time fields or number fields. Both these two fields and also f and g should be the same type.
PROVIDE splits the range f to g into sub-ranges so that each of the fields (f1, f2, ...) specified for each table is constant in this range and so that each sub-range is as large as possible (range limits are considered part of the range).
Each time the processing passes through the loop, the current range limits and the specified sub-fields are placed in the header lines of the internal tables. If you want to make all sub-fields available, enter '*' instead of the field list. The unspecified sub-fields are set to their initial value (
CLEAR).
It is a requirement that the ranges within a table are in ascending order and not overlapping. However, there can be gaps between one upper range limit and the next lower range limit.
For each table itab1, itab2 ... , the automatically generated fields itab1_VALID, itab2_VALID , ... indicate (with 'X' or blank ' ') whether a suitable entry was found for the current sub-range.
Example
The entries in the table SE, PR and SH contain time ranges and are filled as follows:
DATA: BEGIN OF SE OCCURS 3,
FROM TYPE D,
TO TYPE D,
NAME(15) TYPE C,
AGE TYPE I,
END OF SE,
BEGIN OF PR OCCURS 4,
START TYPE D,
END TYPE D,
PRICE TYPE I,
NAME(10) TYPE C,
END OF PR,
BEGIN OF SH OCCURS 2,
CLOSED TYPE D,
STR(20) TYPE C,
OPENED TYPE D,
END OF SH VALID BETWEEN OPENED AND CLOSED,
BEGIN TYPE D VALUE '19910701',
END TYPE D VALUE '19921001'.
SE-FROM = '19910801'. SE-TO = '19910930'.
SE-NAME = 'Shorty'. SE-AGE = 19. APPEND SE.
SE-FROM = '19911005'. SE-TO = '19920315'.
SE-NAME = 'Snowman'. SE-AGE = 35. APPEND SE.
SE-FROM = '19920318'. SE-TO = '19921231'.
SE-NAME = 'Tom'. SE-AGE = 25. APPEND SE.
PR-START = '19910901'. PR-END = '19911130'.
PR-NAME = 'Car'. PR-PRICE = 30000. APPEND PR.
PR-START = '19911201'. PR-END = '19920315'.
PR-NAME = 'Wood'. PR-PRICE = 10. APPEND PR.
PR-START = '19920318'. PR-END = '19920801'.
PR-NAME = 'TV'. PR-PRICE = 1000. APPEND PR.
PR-START = '19920802'. PR-END = '19921031'.
PR-NAME = 'Medal'. PR-PRICE = 5000. APPEND PR.
SH-CLOSED = '19920315'. SH-STR = 'Gold Avenue'.
SH-OPENED = '19910801'. APPEND SH.
SH-CLOSED = '19921031'. SH-STR = 'Wall Street'.
SH-OPENED = '19920318'. APPEND SH.
PROVIDE NAME AGE FROM SE
NAME FROM PR
FROM SH
BETWEEN BEGIN AND END.
ENDPROVIDE.
The three tables are processed according to the following schema:
ISE1 ISE2 ISE3
|-----| |--
| |----
|
: :IPR1 IPR2 : : IPR3 IPR4 :
: |----
|----| |--
|------| :
: : ISH1 : : : ISH2 : : :
|----
| |----
| :
: : : : PROVIDE area : : :
|----
|...
...|--||||--| |--
|------|...
result ranges
This PROVIDE loop is executed 7 times and produces the following sub-ranges:
o 01.08.1991 - 31.08.1991
o 01.09.1991 - 30.09.1991
o 01.10.1991 - 04.10.1991
o 05.10.1991 - 30.11.1991
o 01.12.1991 - 15.03.1992
o 18.03.1992 - 01.08.1992
o 02.08.1992 - 01.10.1992
In most of the loop passes, the fields SE_VALID, PR_VALID and SH_VALID contain 'X' . The exceptions to this are the 1st loop pass, where PR_VALID contains ' ', and the 3rd loop pass, where SE_VALID contains ' '.
Field contents (header lines) during the third loop pass:
SE-FROM = '01101991'
SE-TO = '04101991'
SE-NAME = ' '
SE-AGE = 0
PR-START = '01101991'
PR-END = '04101991'
PR-PRICE = 0
PR-NAME = 'Car'
SH-CLOSED = '04101991'
SH-STR = 'Gold Avenue'
SH-OPENED = '01101991'
o Notes
Strictly speaking, if you imagine each range as a short way of writing a set of single values, this is an "outer join" of the tables.
o After ENDPROVIDE, the contents of the system fields SY-INDEX, SY-TABIX and SY-SUBRC are undefined.
o Neither the header lines nor the actual table lines of the table specified with PROVIDE should be changed between PROVIDE and ENDPROVIDE. Otherwise, the PROVIDE results are undefined.
Provide the Last Entry in the Period
Use
Use the following programming utility to place the last entry in a required period (this can be a for a subtype) in the table header entry from an internal infotype table.
Macro: RP_PROVIDE_FROM_LAST
You define the macro using the keyword INFOTYPES.
You use macro RP_PROVIDE_FROM_LAST in programs for the logical databases PNP and PAP where the last data record for a period (can be a subtype) is read from an infotype table. The infotype table has been filled earlier (for example, with GET PERNR or RP_READ_INFOTYPE). This macro is only helpful if the infotype (or subtype) has time constraint 1 or 2.
Prerequisites
The validity begin date of the time period must be before or the same as the validity end date.
Validity start and end dates are correct (preferably of the type DATE).
The infotype table is sorted in ascending order. Otherwise, you would receive the last fitting table entry that might not necessarily correspond to the last time entry.
Features
The macro RP_PROVIDE_FROM_LAST makes sure that the last entry for a specified period is placed in the table header entry of the report output list.
Parameters
RP_PROVIDE_FROM_LAST inftytab subty beg end
IN : 1) Name of the internal table
2) Subtype required or SPACE if no subtype is being specified
3) Validity begin date of the time interval
4) Validity end date of the time interval
OUT: 1) PNP-SW-FOUND: has the value 0 if there is no matching entry in the infotype table in the given time period. Otherwise it has the value 1.
2) The matching table header entry if PNP-SW-FOUND = 1 or
the cleared table header entry if PNP-SW-FOUND = 0
Check
None
Example
(RP_PROVIDE_FROM_LAST inftytab subty beg end)
RP_PROVIDE_FROM_LAST P0021 '1' PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND EQ '1'.
or
RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND EQ '0'.
WRITE: / 'Error: Org. assignment is missing'. REJECT.
ENDIF.
The module PROVIDE-FROM-FINAL, which is not implemented, is a special case of PROVIDE-FROM-LAST:
PROVIDE-FROM-FINAL inftytab subty beg end =
RP_PROVIDE_FROM_LAST inftytab subty end end
Leaving Event Blocks Using CHECK
If you use the CHECK .
PROVIDE * FROM P0002
if ... then ...endif.
ENDPROVIDE.
Changing Infotypes - by using RMAC (macro) RP-READ-INFOTYPE.
Three steps are involved in changing infotypes:
1. Select the infotype records to be changed;
2. Make the required changes and store the records in an alternative table;
3. Save this table to the database;
The RP-UPDATE macro updates the database. The parameters of this macro are the OLD internal table containing the unchanged records and the NEW internal table containing the changed records. You cannot create or delete data. Only modification is possible.
INFOTYPES: Pnnnn NAME OLD,
Pnnnn NAME NEW.
GET PERNR.
PROVIDE * FROM OLD
WHERE .... = ... "Change old record
*Save old record in alternate table
NEW = OLD.
ENDPROVIDE.
RP-UPDATE OLD NEW. "Update changed record
Function Modules in HR
Function modules are program modules which have a defined interface and allow type testing of parameters.
They are managed with transaction SE37 and combined to function groups according to relevant criteria. You can access this transaction under Tools  ABAP Workbench  Function Builder.
The HR function groups use the naming convention RPxx or HRxx where xx is an identifier of your choice.
You can use the SHOW FUNCTION * editor command to branch from report processing to function module display.
Human Resources Glossary
ABAP/4: Advanced Business Application programming. SAPs fourth generation programming language to develop online applications and evaluate databases.
Absence Quota: An employees entitlement to certain absence. The quota has a limited validity period, and is reduced by each recorded absence.
Administrative Personnel Structure: Allows for the ability to group employees by their relationship within the company, their status, and their payroll processing. Consists of three indicators- employee group, employee subgroup and payroll accounting area.
Applicant Group: Is used in recruitment to classify applicants according to the type of employment contract for which they are applying (e.g. permanent, temporary, freelance, etc.).
Applicant Range: Is used in recruitment to classify applicants according to their hierarchical or functional criteria. (Functional- administration, factory, engineering.
Hierarchical- executives, line management, staff.)
Attendee Type: A grouping together of attendees with the same characteristics. These attendees can be either individual attendees or group attendees (for example, customer, or person).
Attributes: In PD, they are the inherent characteristics that describe an object. Infotypes are used to hold this information.
Authorization: The access privileges for performing an action in the R/3 system based on a set of authorized values for each of the fields in an authorization object.
Authorization object: An element of the authorization system which groups up to ten authorization fields for combined authorization checking. To pass an authorization test for an object, the user must satisfy the authorization check for each field in the object. The authorization objects are listed in the table TOBJ.
Balance: Used to store a goal amount for a deduction wage type. This is entered in infotype 0015 (Additional Payments).
Benefit Plan: The benefit plan is the core of benefit administration module; it encompasses a single benefit offered by the employer.
Business Navigator: The R/3 business navigator is the graphical browser and navigation tool that is used to display the R/3 Reference Model. With this tool you can view graphical process chains, directly access the applications and trigger transactions, call R/3 online documentation, and look at other repository information such as business objects and input/output.
Client: legally and organizationally independent unit on the highest level of the SAP R/3 system (do not make any changes to clients 000 or 001)
Cluster: Clusters are ways of organizing data in a database that consists of a number of tables. Types of clusters; B2, R*.
Command Field: Located on every SAP screen next to the Enter icon (green check mark). Used to type in direct commands that will allow the user to initiate shortcuts. Valid commands are:
Input Results
/n to end the current transaction
/I to end the current session
/o to create a new session
/nend to log off from the system
/nxxx to jump to a new transaction
/oxxx to create a new session and jump to a new transaction (xxxx = transaction code)
Company Code: A legally independent unit within a client and is the smallest organizational unit for which complete self-contained set of books can be maintained for external reporting (i.e., balance sheet and profit and loss statement).
Company Structure: Consists of following: Client, Company Code, Personnel area, Personnel subarea, and organizational key.
Constraint: A constraint describes dependencies between one or more objects and their characteristics in variant configuration.
Cost Center: An organizational unit within a controlling area that represents a separate location of cost incurred. Cost centers (departments) can be set up based on functional requirements, allocation criteria, activities or services provided, location or area responsibility (object type K).
Country Code: One of the geographical elements within the Differential Reference Code (DRC). The DRC Region field may be used to create pricing conditions.
Cumulations: Buckets of wage types stored on technical wage types /101 through /196. Examples include /101 gross wages, /102 RRSP wages and /110 employee deductions.
Data Dictionary: Central catalog that contains the descriptions of an organizations data and provides information about the relationship between the data and its use in programs and screens.
Date Modifier: Used if you want to have different pay dates with same period parameter (i.e., two bi-weekly payrolls by different pay dates.)
Dialog Wage Types: Wage types that can be entered on infotypes or calculated in payroll.
Daily Work Schedule: Represents a timetable for working on a specific day. The daily work schedule and work break schedule describes the exact working times for a particular day. One daily work schedule can represent a number of different time models.
Daily Work Schedule Variant: A daily work schedule that varies slightly from one that is normally valid. For example, some companies have a policy that employees work a half day proceeding a holiday. This half working day is an exception to normal schedule and can be defined as a variant.
Detail Maintenance (see also Simple Maintenance): One of the three methods you can use to create and maintain organizational plans in the Organization and Planning module of PD. With Detail Maintenance you work with objects one-at-a-time, at a detailed level. Complete PD functionality is available, which means you can work with all types of infotypes and record statuses, etc.
Dialog (Program): ABAP/4 program that allows the user to perform a certain task (transaction). A dialog program consists of screens, a module pool (i.e., type M ABAP/4 program) and a transaction code (call). In general, there is also a user interface that allows the user easy access to a number of functions. (In contrast to reports, a dialog program is normally started with a transaction code or is often incorporated into an area menu.)
Dynamic Action: Combines related infotypes into groups. Depending on the data entered, the system will generate subsequent infotypes.
Earliest Recalculation Date: This is set for each employee and also at the payroll control level. The higher of the two dates is used.
Employee Group: The employee group allows for the division of employees into groups that define their relationship within the company. In personnel administration, the main employee groups are active work force, temporary employees, and retirees
Employee Subgroup: Employee subgroups are subdivisions of the employee group, which allow for further definitions of the employee according to their status. Such as, within the active work force, a distinction can be made between union , non-union, salaried, hourly, trainees and executives.
Employee Subgroup Grouping for Collective Agreement Provisions (CAP): Allows selective assignment to the various pay scale groups. You can combine employee group/subgroups under this grouping customizing in the following categories:
(1) Industrial workers /hourly wage;
(2) Industrial workers /monthly wage;
(3) Salaried employees;
(4) Non-pay scale employee.
Within these groupings, pay scale groups and levels can be defined per scale type and pay scale area. Can be used for indirect valuation on an hourly or monthly basis.
Employee Subgroup Grouping for Personnel Calculation Rule (PCR): Allows selective assignments to various pay scale groups. You can combine employee groups/subgroups under this grouping using customizing in the following categories:
1. Hourly Wage Earners.
2. Monthly Wage Earners.
3. Salaried Employees
The meaning of these groups are fixed and may not be changed. The PCR is required for Payroll Accounting and is used for indirect valuation of wage types and infotype 0008, Basic pay.
Employee Subgroup Grouping for Primary Wage Type: Combines employee subgroups for eligibility for Primary wage type usage. Allows you to restrict specific wage types to certain employees group and subgroup.
Enterprise IMG: The Enterprise IMG is the top-level filter for the SAP Reference IMG. It is generated by selecting the business application components and countries to be implemented (all projects).
Evaluation Class: Similar to a processing class. Evaluation classes are used for post payroll processing. (i.e., assigning a G/L account number to a wage type)
Factoring: Proration process for salaries.
Features: Features are decision trees that perform operation on existing fields. Features can be used to set default values. Some examples of features are: ABKRS- default values for payroll area; PINCH- default for Administrator groups on infotype 0001.
Function: Used to process, collect and display data in schemas.
Human Resource Master Data: Employee-related data, which remain relatively constant during the course of time. Example includes personnel number, name, address, bank data and social insurance number.
Hiring: A personnel action in which all the data relevant to the entry of a new employee is recorded, such as name, address, personnel number, activity, cost center etc.
IMG: Implementation Guide. List of all the actions required for the SAP system and helps control and document the process. The IMG is used to do the actual parameter settings. It provides a GUI-supported, menu-led approach, and offers recommendations and explanations for what the system expects at each stage. Default settings are provided to facilitate configuration.
Infotype: A system information unit within the HR module. Infotypes represent a group of related data fields, provide information structure, facilitate data entry, and allow time-dependent storage of data. For example, information on a persons city of residence, street and house number combines to form the employees address, and is therefore stored (along with other data fields) in the infotype Address.
Infotype Groups: An infotype group is a set of infotypes processed for a particular personnel action. An infotype group can be dependent on a user group so that only certain infotypes are processed for a particular group of users.
Information Subtype: In information type (infotype) can be divided into subtypes. Foe example, family data can be broken down further to represent spouse and children. Each subdivision group is known as a subtype.
Jobs: Jobs are general classification of positions that exist within a company.
Modifiers: Used in rule KMOD to set value ranges for tables. The following tables use modifiers:
MODIF1 = T510S Wage Types constant
MODIF2 = T510J Constant Valuation
MODIF3 = T030 Fixed Accounts
MODIFA = T554C Absence Valuation
MODIFB = T51D1 Limits for Deductions
MODIFC = Valuation Basis for month-end accrual
MODIFD = Wage Type Processing with regard to month-end accrual
MODIFW = T510S Wage Type Generation
The modifiers allow you to set a specific range of table entries for different groups of employees.
Operation: Operations are building blocks for rules. They are used to process wage types.
Organizational Structure: Organizational Structures reflect organizational hierarchies and interrelationships for employees. They are composed of the following substructures: company structure, personnel structure, pay scale structure, wage type structure.
Organizational Unit: Organizational Units define the different employee groups (business areas) within a company (e.g. departments). Must be linked to one another to produce a hierarchical structure for the company.
PA (Personnel Administration and Payroll Accounting): The SAP Human Resources Management system is divided into two main areas of configuration: PA and PD. In PA, the organizational hierarchies and their control functions are defined using a system of control tables (which means that company structure and personnel structures can be set up independently of one another). The subsets of the implementation guide for PA consists of:
Personnel Administration;
Benefits;
Recruitment;
Time Management;
Payroll.
Pay Increase (Simple versus Extended):
Simple: Uses report RPU51000 to increase wage types in customizing.
Extended: Can define variant to use for increasing standard pay which add or delete wage types or replace existing ones. The variants include:
A increase a wage type to an absolute amount;
C delimit an existing wage type;
D increase by a difference;
E valuate according to another pay scale group;
G increase total pay by an absolute amount;
R replace one wage type by another;
T add a new wage type.
Pay Scale Area: Geographical area in which a pay scale or a collective agreement is valid. Two-digit code, setup in customizing and stored in PA country grouping. Used as default values for pay types and groups lined to the personnel subarea (see infotype 0008). Within a pay scale area, pay scale groups and levels can be defined per pay scale type and indicator.
Pay Scale Group: Provides a classification criteria for work and indirect valuations. Defined per PA country grouping, pay scale type, pay scale area and employee subgroup grouping for the collective agreement provision. The most important control features of pay scale groups and levels is checking the validity of entries in infotype Basic Pay (0008) and infotype Wage Maintenance (0052) and assigning payments for indirect valuation of wage types.
Pay Scale Types: Area in which pay scale or collective agreement is valid. This pay scale or agreement may be determined at company or trade union level. Two-digit code maintained in customizing and stored by PA country grouping. Pay scale groups and levels can be defined within a pay scale type per pay scale area and employee subgroup grouping for collective agreement provision.
Payroll Accounting Area (a.k.a. Payroll Area): The payroll area is a grouping for payroll runs. It is assigned to employees using feature ABKRS, which is based on the organizational assignment (infotype 0001). The payroll area identifies which payroll run (weekly, bi-weekly, monthly, etc.) will process an employee.
Payroll Driver: The payroll program RPCALCK0 is used to perform complete payroll runs on a period-by period basis and store results.
Payroll Status: Infotype 0003. It is used to keep track of last payroll run for an employee; retroactive activity and error indication.
PD (Personnel Planning and Development): The SAP Human Resources Management system is divided into two main areas for configuration: PA and PD. In PD an organizational plan is developed to depict a companys structure. It will include information about the individual positions, the reporting structure (or chain of command) and positions. Position information will include the types of job performed, the work centers, (physical locations) where jobs and positions are carried out and the different types of tasks performed. The subsets of the implementation guide for PD consists of:
Personnel planning and development global settings;
Organizational plan;
Seminar and convention management;
Personnel development;
Shift planning;
Room reservation planning.
Period Parameter: Determines payroll area frequency.
Personnel Actions: The personnel action function groups together all infotypes necessary to input a particular personnel procedure, such as hiring a new employee. Each action includes the infotypes for which it is essential that you enter data, and allows you to process them sequentially. This ensures that all data relevant to particular personnel procedure is recorded in the system.
Personnel Area: Personnel areas are used solely in Personnel Administration and are defined with a client. Each personnel area must be assigned to a company code. The personnel area allows you to generate default values for data entry, for example, for the payroll accounting area. The personnel area is a selection criterion for reporting. Personnel areas form a unit in authorization checks.
Personnel Subarea: Personnel Subareas are the last element in the company structure. Respective country-specific control features are stored here Specified grouping for Time management; which allows, for example, work schedules as well as substitution, absence and leave types to be setup on a personnel subarea specific basis. Default values are generated for pay scale types and area for an employees basic pay. A holiday calendar is specified. Personnel subarea-specific wage types per personnel area are defined.
Personnel File: The personnel file gives user the ability to access all infotypes for a particular personnel number. The infotypes are displayed in infotype sequence.
Position: Jobs are further described by position. Positions are specific roles performed by individual in the company.
Processing Class: Processing Classes are stored in the table T512W and is used in rules to determine which version of the rule should be selected for a particular wage type.
Rte, Num, Amt: The elements of a wage type.
Rule: Controls how wage types are processed during payroll processing. Rules consists of operations.
Schema: Series of sequential processing steps for payroll and time evaluation. Main schemas include;
K000 Canadian accounting payroll schema for RPCALCK0;
TM00 Main schema for Time Management;
TM01 Time evaluation schema for exceptions to the work schedule;
TM04 Time evaluation schema without clock time.
Split Indicator: Derived from WPBP. Splits will ensure accuracy during payroll processing. Splits occur when there is a change in one or more of the infotype in the WPBP table.
Subschema: Contains processing steps needed by payroll. Subschemas are called from main schema using function copy.
Symbolic Account: Interface between a wage type and general ledger account number. Symbolic accounts are assigned to wage type in T512W.
Technical Wage Types: Wage types that are calculated or used by payroll. Technical wage types start with a /.
Time Constraints: Time constraints are configured for each infotype. They serve as guidelines for when and how many records of an infotype you can maintain. Class 1information must exist, and only once for the life span of the object; Class 2 information is optional, but it can exist only once in any time period (non-continuous or continuous); Class 3 information is optional and many record can exist during any time period.
Time Types: Used in time evaluation to store balances formed from employee attendance and absence times.
Time Wage Type: Time Wage Types are the wage types that need to be evaluated because they carry only a unit (i.e. hours, days, etc.).
Total: Stores the total amount of a deduction with a balance. The total amount is calculated in payroll.
User Group: A user group defines a set of employee. User group are used when customizing the SAP HR system. The system can be customized so that the user group can determine the screen, infotypes and fields accessible.
Validity Dates: The validity period of an object and any infotype must be defined. Each infotype uses beginning and end dates to identify the infotypes validity period.
Valuation Basis: Technical wage types /00 (i.e. /001). The total amount is calculated in payroll.
Valuation Class Rule: Assigned to absence to determine how they will be processed in payroll.
Wage Type: Wage type refers to a four digit identifier for values (amount, number or amount per unit) which are necessary for calculating an employees wage/salary. Wage type represent deduction, earning or tax codes.
Wage Type Classes: Wage type classes are used for deduction limit processing.
WPBP: Table that contains data from infotypes;
0000 Actions;
0001 Organizational Assignment;
0007 Work Schedule;
0008 Basic Pay;
0027 Cost distribution.
SAP HR, FI, CO, MM, PP, SD, PM, PS, QM, SM, BW, APO, Basis, ABAP/4, Certification, Books
SAP HR Transaction Codes
Code Description
P1B1 Transfer hiring data for applicant
P1B2 Transfer hiring data for applicant
P1B3 Transfer hiring data for applicant
P1B4 Transfer table T588Z, infotype 4000
P1B5 Transfer opt. archive for applicant
P1B6 Transfer hiring data for applicant
P1B7 Conversion T750B
P1OA Transfer Settings for Opt.Archiving
P201 Transfer T514D/V from Client 000
P2W1 Transfer Incentive Wage Accounting
P2W2 Copy Incentive Wage Forms
P4SW Release notes BWP
P5P1 Addition of IT0122 to T588B
P5P2 Delete entries in T588B
PA00 Initial PA Master Data Menu
PA03 Maintain Personnel Control Record
PA04 Maintain HR Number Ranges
PA05 Number Range Maintenance: RP_COIFT
PA06 Number Range Maintenance: PD_SEQ_NR
PA07 Maintain Number Range: RP_GARNEM
PA08 Maintain Number Range: RP_GARNSUB
PA09
PA10 Personnel File
PA20 Display HR Master Data
PA30 Maintain HR Master Data
PA40 Personnel Actions
PA41 Correct Actions
PA42 Fast Entry for Actions
PA46 Import from Resumix
PA47 Export to Resumix
PA48 Hiring from non-SAP system
PA51 Display Time Data
PA53 Display Time Data
PA61 Maintain Time Data
PA62 List Entry of Additional Data
PA63 Maintain Time Data
PA64 Calendar Entry
PA70 Fast Entry
PA71 Fast Entry of Time Data
PA88 Benefits
PA97 Matrix Maintenance
PA98 Compensation Administration
PA99 Compensation Admin. - Release Report
PAAH Call Ad-Hoc Query
PACA HR-CH: PF administration
PACB HR-CH: PF account maintenance
PACC HR-CH: PF calculator
PACE HR-CH: Pension fund : Postings
PACK HR-CH: Pension fund
PACN Number range maint: HRCHPKONTO
PACP HR-CH: Pension fund, interface
PACT PC parameter maintenance
PAJP Call reporting tree - Japan
PAL1 Create Sales Representative
PAL2 Display Sales Representative
PAL3 Maintain Sales Representative
PAL4 Create Buyer
PAL5 Maintain Buyer
PAL6 Display Buyer
PAR1 Flexible employee data
PAR2 Employee list
PAT1 Personnel Administration infosystem
PAW1 Who is who
PB00 Recruitment
PB04 Number Range Maintenance: RP_PAPL
PB10 Init.entry of applicant master data
PB20 Display applicant master data
PB30 Maintain applicant master data
PB40 Applicant actions
PB50 Display Applicant Activities
PB60 Maintain Applicant Activities
PB80 Evaluate vacancies
PBA0 Evaluate advertisements
PBA1 Applicant index
PBA2 List of applications
PBA3 Applicant vacancy assignment list
PBA4 Receipt of application
PBA5 Recurring tasks: Print letters
PBA6 Recurring tasks: Print letters
PBA7 Recurring tasks: Data transfer
PBA8 Recurring tasks: Transfer data
PBA9 List of planned actions
PBAA Evaluate recruitment instrument
PBAB Maintain vacancy assignments
PBAC Applicant statistics
PBAD Recurring tasks: Print letters
PBAE Applicant pool
PBAF Vacancy assignment list
PBAG Screening
PBAH Decision
PBAI All applicants via qualifications
PBAJ Recruitment info system
PBAK Recurring Tasks: Print Labels
PBAL Bulk processing
PBAM Variable Applicant List
PBAN Ad Hoc Query
PBAO ABAP Query
PBAP Internal Applicants Via Quals
PBAQ External Applicants Via Quals
PBAT Choose SAPscript or WinWord
PBAU Maintain T750C
PBAV Display T750C
PBAW Maintain T750B
PBAX Display T750B
PBAY Maintain T750X
PBAZ Display T750X
PBCX Cust. Account Assign. Reference (MM) -
Difference in provide statment
Hi Gurus,
Plz let me know difference in following statement
rp_provide_from_last p2010 space pn-begda pn-endda.
AND
PROVIDE pernr subty anzhl betrg FROM p2010
BETWEEN pn-begda AND pn-endda.
ENDPROVIDE.
Regards
RajeshHi,
PROVIDE pernr subty anzhl betrg FROM p2010
BETWEEN pn-begda AND pn-endda.
ENDPROVIDE.
Retrieves the contents of the specified fields from the internal tables (P2010) and places them in the table header lines within the required range. Also executes the processing block enclosed by the PROVIDE and ENDPROVIDE statements for each range.
For P2010 only tables with header lines are allowed.
But
rp_provide_from_last p2010 space pn-begda pn-endda.
It is a macro.
You use macro RP_PROVIDE_FROM_LAST in programs for the logical databases PNP and PAP where the last data record for a period (can be a subtype) is read from an infotype table. The infotype table has been filled earlier (for example, with GET PERNR or RP_READ_INFOTYPE). This macro is only helpful if the infotype (or subtype) has time constraint 1 or
2.
Prerequisites:
1) The validity begin date of the time period must be before or the same as the validity end date.
2) Validity start and end dates are correct (preferably of the type DATE).
3) The infotype table is sorted in ascending order. Otherwise, you would receive the last fitting table entry that might not necessarily correspond to the last time entry.
Hope it will help you.
Regards,
Sujit -
I can easily read PCL2 data by using "IMPORT blah blah.... FROM DATABASE PCL2(RU)".
Somehow, someway, SAP takes what is strored in PCL2-CLUSTD and converts it into meaningful variables via the "IMPORT ... FROM DATABASE" syntax.
[[I want to see the code SAP uses to do this]]
Actually, what I really want is to take normal data say, employee name and say payroll dollars for a given period and then convert it back into PCL2-CLUSTD without updating PCL2.
IDEAS?hi goldstein,
pls refer the below liks once.u may get clear idea about wat u want.
sap.ionelburlacu.ro/abap/sap2/SAP_Reports.html - 26k
www.experts-exchange.com/Database/Software/HR_HCM/SAP/Q_23189513.html - 112k -
www.sap-img.com/hr021.htm - 8k -
www.sapbrainsonline.com/REFERENCES/StandardReports/SAP_standard_reports_list.html - 39k
Best PDF file to learn HR Programming
http://www.melayu.plus.com/SAP%20HR%20Programming.pdf
HR deals with the INFOTYPES which are similar to Tables in General ABAP.
There are different ways of fetching data from these infotypes.
There are different areas in HR LIKE Personal Admn, Orgn Management, Benefits, Time amangement, Event Management, Payroll etc
Infotypes for these areas are different from one another area.
storing of records data in each type of area is different
LDBS like PNP are used in HR programing.
Instead of Select.. we use some ROUTINES and PROVIDE..ENDPROVIDE.. etc
and in the case of Pay roll we use Clusters and we Import and Export them for data fetching.
On the whole Normal ABAP is different from HR abap.
For Personal Admn the Infotypes start with PA0000 to PA1999
Time Related Infotypes start with PA2000 to PA2999.
Orgn related Infotypes start with HRP1000 to HRP1999.
All custom developed infotypes stsrat with PA9000 onwards.
In payroll processing we use Clusters like PCL1,2,3 and 4.
Instead of Select query we use PROVIDE and ENDPROVIDE..
You have to assign a Logical Database in the attributes PNP.
Go through the SAp doc for HR programming and start doing.
http://www.sapdevelopment.co.uk/hr/hrhome.htm
See:
http://help.sap.com/saphelp_46c/helpdata/en/4f/d5268a575e11d189270000e8322f96/content.htm
sites regarding hr-abap:
http://www.sapdevelopment.co.uk/hr/hrhome.htm
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
http://www.atomhr.com/training/Technical_Topics_in_HR.htm
http://www.planetsap.com/hr_abap_main_page.htm
You can see some Standard Program examples in this one ...
http://www.sapdevelopment.co.uk/programs/programshr.htm
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
http://www.erpgenie.com/faq/hr.htm.
http://www.planetsap.com/hr_abap_main_page.htm
http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
These are the FAQ's that might helps you as well.
http://www.sap-img.com/human/hr-faq.htm
http://www.sapgenie.com/faq/hr.htm
http://www.planetsap.com/hr_abap_main_page.htm
http://www.atomhr.com/library_full.htm
HR Long texts Upload
Look at the below link
HR
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
http://www.atomhr.com/training/Technical_Topics_in_HR.htm
http://www.planetsap.com/hr_abap_main_page.htm
you can see some Standard Program examples in this one..
http://www.sapdevelopment.co.uk/programs/programshr.htm
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
These are the FAQ's that might helps you
http://www.sap-img.com/human/hr-faq.htm
http://www.sapgenie.com/faq/hr.htm
http://www.erpgenie.com/faq/hr.htm.
www.sap-img.com
http://www.planetsap.com/hr_abap_main_page.htm
http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
http://www.sapfans.com/forums/viewtopic.php?p=498530&sid=d7ec5866e3fb26880da129de45ce79de
http://www.sapcookbook.com/preview_hr_questions.htm
http://www.atomhr.com/library_full.htm
http://www.sapdevelopment.co.uk/hr/hrhome.htm
http://www.planetsap.com/hr_abap_main_page.htm
http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci983590,00.html
http://www.allsaplinks.com/HRmaterial.html
http://www.allsaplinks.com/timemanagement.html
http://www.allsaplinks.com/payrollcompletefunctional.html
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/HRINF/HRINF.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYXXFORM/PYINT_FORMBUILDER.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCBMTWFMPA/BCBMTWFMPA.pdfhttp://help.sap.com/printdocu/core/Print46c/en/data/pdf/MYSAP/SR_HR.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
http://www.planetsap.com/hr_abap_main_page.htm
Regards,
karthik
<REMOVED BY MODERATOR>
Few notes are below:
InfoSets in the HR Application
You can use SAP Query in HR to report on HR data. Queries are maintained as described in Creating Queries. The special features of queries created for HR are described in Maintaining Queries in the Human Resources Application. The maintenance procedure for HR InfoSets differs from the described procedure inasmuch as HR data fields are grouped together in infotypes.
InfoSet management in SAP Query is also used for InfoSet Query. For further information, see Functions for Managing InfoSets.
If you want to create InfoSets for HR, you can use logical databases PNP, PNPCE, PAP, and PCH (see HR Logical Databases). The database you must use to create your InfoSet depends on the component in which the data you want to report on is stored.
The reports you can execute using InfoSets based on logical databases PNP (or PNPCE) or PCH are similar, but differ in that they can select different objects. The following table describes the connection between the logical database, and the infotypes you can include in an InfoSet. It also provides you with one or two examples of reports that you can execute using the appropriate InfoSets.
Logical database PNP/PNPCE* PCH PAP
Selection of Persons Objects from Personnel Planning Applicants
Infotypes that can be included in the InfoSet Infotypes for· Personnel Administration (0000-0999) · Time Management (2000-2999) · Payroll infotypes · Infotypes for Personnel Planning objects that can be related to persons If the object type is specified:· Infotypes for the object type · Infotypes for objects that can be related to the specified object typeIf the object type is not specified:· All infotypes · Infotypes for Recruitment (4000-4999)· Some infotypes for Personnel Administration (such as 0001 and 0002)
· Customer infotypes
Reporting examples · Selection of all persons who participated in a specific business event, output of prices for reserved business events · Selection of all persons assigned to a specific personnel area, output of qualifications held by these persons · Selection of all business events held in London in March, output of all persons who participated in these business events · Selection of all positions assigned to a specific organizational unit, output of all persons assigned to the positions · Selection of all applicants hired last year to work on special projects, output of addresses for the applicants selected
Logical database PNPCE (PNP Concurrent Employment) functions just like logical database PNP. The procedure for creating InfoSets is also the same. It only becomes significant if you work with Concurrent Employment.
Creating InfoSets
The maintenance procedure for HR InfoSets differs from the procedure described so far in this section inasmuch as HR data fields are grouped together in infotypes. To set up an InfoSet for the HR application, proceed as follows:
1. On the initial screen for maintaining InfoSets, enter a name for the InfoSet and choose Create.
2. On the next screen, enter a name for the InfoSet and select one of the HR logical databases in accordance with your reporting requirements.
Customer infotypes can be created on all HR logical databases. In each individual case, therefore, you must decide which database to select so that you can report on customer infotypes.
This screen enables you to enter an authorization group. All of the queries that are subsequently created using this InfoSet can only be executed by persons who have this authorization group.
3. Choose .
This takes you to the Infotype Selection for InfoSet .
Fill data object
Export record
EXPORT TABLE1 TO DATABASE PCLn (xy) ID xy-KEY.
IF SY-SUBRC EQ 0.
WRITE: / 'Update successful'.
ENDIF.
Export Cluster data using the macro
. Export data using macro RP-EXP-Cn-xy.
When data records are exported using macro, they are not written to the database but to a main memory buffer.
To save data, use the PREPARE_UPDATE routine with the USING parameter 'V'.
REPORT ZHREXPRT.
*Buffer definition
INCLUDE RPPPXD00. INCLUDE RPPPXM00. "Buffer management
DATA: BEGIN OF COMMON PART 'BUFFER'.
INCLUDE RPPPXD10.
DATA: END OF COMMON PART 'BUFFER'.
RP-EXP-Cn-xy.
IF SY-SUBRC EQ 0.
PERFORM PREPARE_UPDATE USING V.
ENDIF.
Importing Cluster Data using standard include
The IMPORT command causes data objects with the specified key values to be read from PCLn.
If the import is successful, SY-SUBRC is 0; if not, it is 4.
REPORT RPIMPORT.
TABLES: PCLn.
INCLUDE RPCnxxy0. "Cluster definition
Fill cluster Key
Import record
IMPORT TABLE1 FROM DATABASE PCLn (xy) ID xy-KEY.
IF SY-SUBRC EQ 0.
Display data object
ENDIF.
Importing Cluster data using Macro
Import data using macro RP-IMP-Cn-xy.
Check return code SY-SUBRC. If 0, it is successful. If 4, error.
Need include buffer management routines RPPPXM00
Example
REPORT RPIMPORT.
*Buffer definition
INCLUDE RPPPXD00.
DATA: BEGIN OF COMMON PART 'BUFFER'.
INCLUDE RPPPXD10.
DATA: END OF COMMON PART 'BUFFER'.
*Import data to buffer
RP-IMP-Cn-xy.
*Buffer management routines
INCLUDE RPPPXM00.
Cluster Authorization
Simple EXPORT/IMPORT statement does not check for cluster authorization.
Use EXPORT/IMPORT via buffer, the buffer management routines check for cluster
authorization.
How to read the Payroll Results
Payroll results are stored in cluster Rn of PCL2 as field string and internal tables.
n - Country identifier.
Standard reports read the results from cluster Rn. Report RPCLSTRn lists all payroll results;
Report RPCEDTn0 lists the results on a payroll form.
The cluster definition of payroll results is stored in two INLCUDE reports:
include: rpc2rx09. "Definition Cluster Ru (I)
include: rpc2ruu0.Definition Cluster Ru (II)
o This first INCLUDE defines the country-independent part; the second
INCLUDE defines the country-specific part (US).
o The cluster key is stored in the field string RX-KEY.
All the field string and internal tables stored in PCL2 are defined in the ABAP/4 dictionary. This allows you to use the same structures in different definitions and nonetheless maintain data consistency.
The structures for cluster definition comply with the name convention PCnnn
Unfortunately 'nnn' can be any set of alphanumeric characters.
*Key definition
DATA: BEGIN OF RX-KEY.
INCLUDE STRUCTURE PC200.
DATA: END OF RX-KEY.
*Payroll directory
DATA: BEGIN OF RGDIR OCCURS 100.
INCLUDE STRUCTURE PC261.
DATA: END OF RGDIR.
How to retrieve Payroll results
o To read payroll results, you need two keys: pernr and seqno
o You can get SEQNO by importing the cluster directory (CD) first.
Example
REPORT ZHRIMPRT.
TABLES: PERNR, PCL1, PCL2.
INLCUDE: rpc2cd09. "Definition cluster CD
PARAMETERS: PERSON LIKE PERNR-PERNR.
RP-INIT-BUFFER.
*Import cluster Directory
CD-KEY-PERNR = PERNR-PERNR.
RP-IMP-C2-CU.
CHECK SY-SUBRC = 0.
LOOP AT RGDIR.
RX-KEY-PERNR = PERSON.
UNPACK RGDIR-SEQNR TO RX-KEY-SEQNO.
*Import data from PCL2
RP-IMP-C2-RU.
ENDLOOP.
o Reading records from the Payroll directory
after importing the payroll directory, which record to read is up to the programmer
o Each payroll result has a status.
'P' - previous result
'A' - current (actual) result
'O' - old result
o Function module CD_EVALUATION_PERIODS will restore the payroll result status for a period when that payroll is initially run. It also will select all the relevant periods to be evaluated.
Example
Call function 'CD_EVALUATION_PERIODS'
exporting
bonus_date = ref_periods-bondt
inper_modif = pn-permo
inper = ref_periods-inper
pay_type = ref_periods-payty
pay_ident = ref_periods-payid
tables
rgdir = rgdir
evpdir = evp
iabkrs = pnpabkrs
exceptions
no_record_found = 1.
Authorization Check
Authorization for Persons
In the authorization check for persons, the system determines whether the user has the authorizations required for the organizational features of the employees selected with GET PERNR.
Recruits for which the user has no authorization are skipped and appear in a list at the end of the report.
Authorization object: 'HR: Master data'
Authorization for Data
In the authorization check for data, the system determines whether the user is authorized to read the infotypes specified in the report.
If the authorization for a particular infotype is missing, the evaluation is terminated and an error message is displayed.
Deactivating the Authorization Check
In certain reports, it may be useful to deactivate the authorization check in order to improve performance. (E.g. when running payroll)
You can store this information in the object 'HR: Reporting'.
2.1.6 Concepts of Macros (Import/Export etc.)
Macros:
Introduction
Programs that process the cluster data (for example, RX) do not access the cluster independently. The data is accessed using a defined interface created with macros.
Macro contains some part of source code, which it will be useful for number of applications. Macro is module, which is stored
Naming Conventions of Macro:
RP-aaa-bb-cc
aaa is the type of Macro. It takes two values
o IMP Import Macro
o EXP Export Macro
bb is the Database table where the data is saved:
o C1 Database object PCL1
o C2 Database object PCL2
o C3 Database object PCL3
o C4 Database object PCL4
Cc is the cluster, it may take
o RX Cluster object RX
o RD Cluster object RD
o B2 Cluster object B2 and so on.
Defining and Calling the Macros
Defining:
There are two options for defining the Macros
Macros are defined using the ABAP Commands DEFINE . END-OF-DEFINITION. A macro can be used within a report or within include. If a macro is used in a report, and the macro is defined in include with the DEFINE command, include must be integrated.
Macros can also be defined as RMAC macros. The source code of these modules is stored in the function section of the control table TRMAC. The coding is grouped under a specific name in the table key.
According to conventions, the first two letters of the name must stand for the application. The rest of the name is freely definable.
Difference between the two methods is:
If a macro is changed, each report using this macro is automatically regenerated when it is executed.
When you change a RMAC macro in the table TRMAC, the reports that use this macro are not regenerated automatically. You must regenerate them manually.
Standard HR Macros
o The macro RP-PROVIDE-FROM-FRST retrieves the first (start) data record, which is valid in the data selection period.
o The macro RP-PROVIDE-FROM-LAST retrieves the last (latest) data record, which is valid in the data selection period.
o The macro RP-READ-INFOTYPE retrieves the data record(s), which is valid in the data selection period.
How to check whether the macro operation is successful or not
For every macro, whether the operation was successful or not will be checked with
PNP-SW-FOUND.
If PNP-SW-FOUND = 1, then the operation is successful.
Where exactly the Macrocode is stored
The program code pertaining to this macro is stored in the control table RMAC
Guidelines for how and when to use the Standard Macros
o RP_PROVIDE_FROM_FRST
Use macro RP_PROVIDE_FROM_FRST in programs for the logical databases PNP and PAP where the first data record for a period (can be a subtype) is read from an infotype table. The infotype table has been filled earlier (for example, with GET PERNR or RP_READ_INFOTYPE). This macro is only helpful if the infotype has time constraint 1 or 2.
Prerequisites
The validity begin date of the time period must be before or the same as the validity end date.
Validity start and end dates are correct (preferably of the type DATE).
The infotype table is sorted in ascending order. Otherwise, you would receive the first fitting table entry that might not necessarily correspond to the first time entry.
Features
The first entry for a specified period is placed in the table header entry from an internal infotype table.
Parameters
RP_PROVIDE_FROM_FRST inftytab subty beg end
IN: 1) Name of the internal table
2) Subtype required or SPACE if no subtype is being specified
3) Validity start date of the time interval
4) Validity end date of the time interval
OUT: 1) PNP-SW-FOUND: has the value 0 if there is no matching entry in the infotype table in the given time period. Otherwise it has the value 1.
2) The matching table header entry if PNP-SW-FOUND = 1 or
the initial table header entry if PNP-SW-FOUND = 0
Example
(RP_PROVIDE_FROM_FRST inftytab subty beg end)
RP_PROVIDE_FROM_FIRST P0021 '1' PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND EQ '1'.
ENDIF.
or
RP_PROVIDE_FROM_FRST P0001 SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND EQ '0'.
WRITE: / 'Error: Org. assignment is missing' REJECT.
ENDIF.
o RP_PROVIDE_FROM_LAST
You use macro RP_PROVIDE_FROM_LAST in programs for the logical databases PNP and PAP where the last data record for a period (can be a subtype) is read from an infotype table. The infotype table has been filled earlier (for example, with GET PERNR or RP_READ_INFOTYPE). This macro is only helpful if the infotype (or subtype) has time constraint 1 or 2.
Prerequisites
The validity begin date of the time period must be before or the same as the validity end date.
Validity start and end dates are correct (preferably of the type DATE).
The infotype table is sorted in ascending order. Otherwise, you would receive the last fitting table entry that might not necessarily correspond to the last time entry.
Features
The macro RP_PROVIDE_FROM_LAST makes sure that the last entry for a specified period is placed in the table header entry of the report output list.
Parameters
RP_PROVIDE_FROM_LAST inftytab subty beg end
IN: 1) Name of the internal table
2) Subtype required or SPACE if no subtype is being specified
3) Validity begin date of the time interval
4) Validity end date of the time interval
OUT: 1) PNP-SW-FOUND: has the value 0 if there is no matching entry in the infotype table in the given time period. Otherwise it has the value 1.
2) The matching table header entry if PNP-SW-FOUND = 1 or
the cleared table header entry if PNP-SW-FOUND = 0
Example:
RP_PROVIDE_FROM_LAST P0021 '1' PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND EQ '1'.
ENDIF.
OR
RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND EQ '0'.
WRITE: / 'Error: Org. assignment is missing'. REJECT.
ENDIF.
RP_READ_INFOTYPE
You can use the macro in all programs at any point. You can also use it in function modules. In database PNP, an infotype is usually read with GET PERNR. Using macro RP_READ_INFOTYPE is an exception.
You can also use the function module HR_READ_INFOTYPE. For information on how to use the function module, see the documentation on Function Modules.
Prerequisites
The validity begin date of the time period must be before or the same as the validity end date.
Validity begin and end are correct date specifications (preferably of the type DATE).
The infotype table must match the infotype number.
The program using the macro must contain the include DBPNPMAC.
Features
The macro RP_READ_INFOTYPE makes sure that all data records for a person for the specified period are placed in an internal infotype table.
Parameters
RP_READ_INFOTYPE pernr infty inftytab beg end
IN: 1) Personnel number of the person requested
2) Infotype number of the required infotype
3) Name of the internal infotype table
4) Validity start date of the time interval
5) Validity end date of the time interval
OUT: 1) PNP-SW-FOUND = 0, if there is no matching record in the dataset
PNP-SW-FOUND = 1, if there is no matching record in the dataset
2) PNP-SW-AUTH-SKIPPED-RECORD = 0, if the HR authorization check has not retained any records due to incorrect authorizations.
PNP-SW-AUTH-SKIPPED-RECORD = 1 , if the HR authorization check has retained at least one record due to lack of authorization
3) Internal infotype table, containing all matching records for which the user is authorized (this table can also be empty).
Example
(RP_READ_INFOTYPE pernr infty inftytab beg end)
INFOTYPES: 0001.
RP-LOWDATE-HIGHDATE.
DATA: PERNR LIKE P0001-PERNR.
DATA: BEGDA LIKE P0001-BEGDA, ENDDA LIKE P0001-ENDDA.
PERNR = '12345678'.
BEGDA = LOW-DATE + 15
ENDDA = HIGH-DATE - 5.
RP-READ-INFOTYPE PERNR 0001 P0001 BEGDA ENDDA.
IF PNP-SW-AUT-SKIPPED-RECORD EQ '1'.
WRITE: / 'Insufficient authorization'. STOP.
ENDIF.
IF PNP-SW-FOUND EQ '0'.
WRITE: / 'Infotype 0001 missing'. STOP.
ENDIF.
2.1.7 Retrieval of data using LDBs (PNP/PAP/APP/PCH) without LDBs.
Logical database
A logical database is a special ABAP/4 program which combines the contents of certain database tables. Using logical databases facilitates the process of reading database tables.
HR Logical Database is PNP
Main Functions of the logical database PNP:
Standard Selection screen
Data Retrieval
Authorization check
To use logical database PNP in your program, specify in your program attributes.
Standard Selection Screen
Date selection
Date selection delimits the time period for which data is evaluated. GET PERNR retrieves all records of the relevant infotypes from the database. When you enter a date selection period, the PROVIDE loop retrieves the infotype records whose validity period overlaps with at least one day of this period.
Person selection
Person selection is the 'true' selection of choosing a group of employees for whom the report is to run.
Sorting Data
The standard sort sequence lists personnel numbers in ascending order.
SORT function allows you to sort the report data otherwise. All the sorting fields are from infotype 0001.
Report Class
You can suppress input fields, which are not used on the selection screen by assigning a report class to your program.
If SAP standard delivered report classes do not satisfy your requirements, you can create your own report class through the IMG.
Data Retrieval from LDB
1. Create data structures for infotypes.
INFOTYPES: 0001, "ORG ASSIGNMENT
0002, "PERSONAL DATA
0008. "BASIC PAY
2. Fill data structures with the infotype records.
Start-of-selection.
GET PERNR.
End-0f-selection.
Read Master Data
Infotype structures (after GET PERNR) are internal tables loaded with data.
The infotype records (selected within the period) are processed sequentially by the PROVIDE - ENDPROVIDE loop.
GET PERNR.
PROVIDE * FROM Pnnnn BETWEEN PN/BEGDA AND PN/ENDDA
If Pnnnn-XXXX = ' '. write:/ Pnnnn-XXXX. Endif.
ENDPROVIDE.
Period-Related Data
All infotype records are time stamped.
IT0006 (Address infotype)
01/01/1990 12/31/9999 present
Which record to be read depends on the date selection period specified on the
selection screen. PN/BEGDA PN/ENDDA.
Current Data
IT0006 Address - 01/01/1990 12/31/9999 present
RP-PROVIDE-FROM-LAST retrieves the record, which is valid in the data selection period.
For example, pn/begda = '19990931' pn/endda = '99991231'
IT0006 subtype 1 is resident address
RP-PROVIDE-FROM-LAST P0006 1 PN/BEGDA PN/ENDDA.
2.2 Personnel Administration (PA)
PA involves administrating employee data, commonly referred to Master Data. Master Data contains all employee data used in HR processing. Master Data includes Personal (E.g. address), Organizational (Position description), Benefits (Insurance, Pension), Time & Payroll.
Master Data is stored in Infotypes. Infotypes are tables (for user Data entry screen) that contain logically related employee data. Data can be stored for specific periods, which includes current and historical.
Components of PA:
Personnel Area: represents a division of a company code into subunits. It is an organizational entity representing an area within an organization defined by specific aspects of personnel administration, time management and payroll. Personnel areas are subdivided into personnel subareas. Personnel area is specific to HR and is a four character alphanumeric identification. E.g. Personnel area 100 is for employees in Karnataka, 200 is for Chennai.
Personnel Subarea: is a further subdivision of Personnel area. It may represent geographical locations. Functions include:
1. Set groupings for Time Management, so that work schedules, substitution and absence and leave types can be setup for individual personnel subareas.
2. Generate default pay scale type and area for an employee's basic pay.
3. Define public holiday calendar.
Employee Groups: divides or groups employees into various categories. E.g. Active employees, Retired employees, Contractors Employee groups are used to generate default values for payroll accounting area and basic pay.
Employee Subgroups: are further differentiated within the employee group. E.g. Salaried employees, Hourly employees, unionized employees, Executives The employee subgroup grouping for the payroll rule allows you to define different payroll procedures for different employee subgroups. For e.g. you can specify whether an employee's pay should be determined on hourly or monthly basis. The employee subgroup grouping for the work schedule defines the validity of work schedule, and the attendance or absence quota type determines the validity of time quotas.
Here a Data Model
2.2.1 Importance of Dates and periods in payroll
Here is a simple ABAP example of reading DATE types stored in infotype 0041.
There can be a maximum of 12 dates stored in this infotype. Here is an example of an infotype 0041 record:
The date types are stored in PA0041-DAR01, PA0041-DAR02, etc.
In the example above, PA0041-DAR01 is 01, PA0041-DAR02 is 09.
The dates themselves are stored in PA0041-DAT01, PA0041-DAT02, etc
To read through this in ABAP, the easiest way is to use the DO VARYING statement. Here is a simple demonstration ABAP:
Note: to print the text of the date type, e.g. Leave year entry select from table T548T.
REPORT ZDATES1.
TABLES: PERNR.
DATA: BEGIN OF MYDATES,
DAR LIKE P0041-DAR01,
DAT LIKE P0041-DAT01,
END OF MYDATES.
INFOTYPES 0041.
GET PERNR.
WRITE: PERNR-PERNR, PERNR-ENAME. "Show employee number and name
RP-PROVIDE-FROM-LAST P0041 SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
DO 12 TIMES VARYING MYDATES
FROM P0041-DAR01
NEXT P0041-DAR02.
If mydates-dar ne space.
WRITE: /, MYDATES-DAR, MYDATES-DAT.
Endif.
ENDDO.
ENDIF.
2.2.2 Overview of date fields and period-Ex. for period/in-period/ payroll
FOR-PERIOD: Payroll period (start and end date of a period) for which a payroll result is created or generated.
IN-PERIOD: The payroll period (start and end date of a period) in which a payroll result is created or generated.
Example: For every employee payroll should be run, it may be bi-weekly, monthly, or quarterly. Say it is monthly, then for an employee a payroll should be run for this month and it is run next month then. For-period start date is 01/9/2003 and end date is 30 and in-period end date will be the date it is run 15/10/2003.
In-Period View
An in-period view is a selection of payroll results from the payroll directory (for example, RPCLSTRD Payroll Result for Germany,) for a number of in-periods. The payroll results that were generated for the required number of payroll periods in the selected period are selected.
Payroll Result
For-Period View
A for-period view is a selection of payroll results from the payroll directory (for example, RPCLSTRC Payroll Result for Switzerland) for a number of for-periods. The payroll results that were generated in the required number of payroll periods for the selected period are selected.
Example: For-Period View / In-Period View
Payroll
result For-period
view Start date
for-per. view End date
for-per. view In-period
view End date
in-per. view
1 01/1997 01.01.1997. 31.01.1997 02/1997 28.02.1997
2 02/1997 01.02.1997 28.02.1997 02/1997 28.02.1997
Explanation
The payroll result 1 for the payroll period (for-period) 01/1997 has the start date 01.01.1997 and the end date 31.01.1997. This payroll result was generated in the payroll period (in-period) 02/1997.
2.2.3 Repetitive Structures processing
In many master data infotypes the data is stored in the form of repetitive structures. For example infotype 0008, the structure wage type line is available for 20 times, that is an employee is eligible for having 20 different wage types based on his benefits. When evaluating repeat structures, you must ensure that all fields are entered. In the case of the Basic Pay infotype, 20 * 5 = 100 fields are queried.
To use this method of evaluation, define a field string whose structure corresponds to the fields in one line of the repetitive structure.
Example for understanding the repetitive Structure
Say, for an employee you want to know that for what all wage types an employee is eligible for the latest period you mentioned on the selection screen.
Using LDB (PNP)
Program:
Report zhk_repstru.
Tables Pernr.
Infotypes 0008.
You have to declare a structure same as repetitive structure in the 0008 infotype
Data: begin of s_wagetypes,
Wagetype type p0008-lga01,
Amount type p0008-bet01,
Hours type p0008-anz01,
Unit type p0008-ein01,
Ind type p0008-opk01,
End of s_wagetypes,
Selecting data from the Data base Get pernr
Getting the latest record based on the selection period.
RP_PROVIDE_FROM_LAST P0008 SPACE PN-BEGDA PN-ENDDA.
Now knowing for what all wage types the employee is eligible.
Do 20 times varying s_wagetypes from p0008-lga01 next p0008-lga02. If s_wagetypes-wagetype is initial.
o Here the data is stored sequentially, i.e., if the employee is eligible for 5 wage types then all the 5 wage types are stored sequentially in lga01 to lga05 respectively. So, if say the lga05 is initial then it is understood that, employee is eligible for only 4 wage types and from lga05 to lga20 structures will be empty so, we need not process further
Exit.
Else.
Write: / s_wagetypes-wagetype,
S_wagetypes-amount.
Endif.
Enddo.
2.2.4 Guidelines to retrieve Payroll data (Mainly US/UK/Ireland)
Before directly going into the Guidelines to retrieve Payroll Data let us look in to the basic concepts of the Payroll.
Introduction to Payroll
To calculate the remuneration for work done for each employee
Payroll does not just involve the calculation of remuneration, but consists of a variety of processes that are becoming increasingly important due to the employers increased obligation to supply benefits and medical welfare. These benefits are products of:
Labor law
Tax law
Contribution law
Benefits law
Civil law
Reporting law
Information law
Statistics law
Payroll in the SAP System: In the SAP Human Resources Management System, payroll accounting is executed using the Payroll driver.
Process Flow:
When you access Payroll, the payroll driver calls the accompanying payroll schema, which consists of a sequence of functions. For each activity, the individual functions import data from internal tables and payroll relevant files.
Payroll Integration:
Payroll can be integrated in Personnel Administration, Time Management, Incentive Wages and Accounting:
Standardized data retention enables you to use master data and other payroll relevant data from Personnel Administration.
Time data, entered via Time Management, is automatically included in the Payroll and is valuated during the payroll run. Data from the Incentive Wages component is used to calculate piecework wages and premium wages directly in Payroll.
Information on expenses and payables from Payroll is posted for accounting directly in Financial Accounting, and you assign the costs to the appropriate cost center. You can also control the financial system of third-party providers.
Payroll Driver
Payroll driver is a special report for Payroll.
SAP has developed country-specific payroll drivers, which are based on report RPCALCx0.
The country-specific net calculation of pay must be developed explicitly for every country.
Separate country programs, which meet the tax and insurance requirements of the respective country, can be created from the basic report RPCALCx0. Since the payroll driver has a modular structure, you can use the Customizing functions to quickly modify the payroll procedure to meet the particular requirements of your enterprise.
Integration
Calculation rules and other reports are stored in an accompanying schema, which also contains the activities carried out by the payroll driver during payroll. All data is stored in internal tables and saved in files with a cluster structure.
When you access Payroll, the payroll driver calls the accompanying payroll schema, which consists of a sequence of functions. For each activity, the individual functions import data from internal tables and payroll relevant files.
Payroll Schema:
It contains calculation rules to be used by the payroll driver during payroll.
SAP has developed country-specific schemas, which are based on schema X000.
With country-specific reports, the first character in the name refers to the country indicator.
For example,
D for Germany
F for France
U for USA
Schema Structure A schema consists of the following parts:
1. Initialization
Where system performs the following steps:
Updates the databases
Imports required infotypes
2. Gross calculation of pay
Where system performs the following steps:
Processes basic data and time data
Reads payroll account of the last period accounted
Processes time data and calculate the individual gross values
Performs factoring
3. Net calculation of pay
where system performs the following steps:
Calculates net remuneration
Performs bank transfers
Example:
The classic example is the payroll for salaried employees at the end of the month in contrast to the wage accounting of hourly workers in the middle of the following month.
Enter the organizational assignment of employees to a payroll accounting area (ABKRS) in Infotype 0001. Payroll accounting area also determines the two functions necessary for payroll accounting:
The summarization of personnel numbers to be accounted and
The determination of the exact payroll period.
Select Personnel Numbers:
Personnel numbers are selected for payroll accounting by specifying a payroll area in the payroll driver. Infotype 0001 Organizational Assignment enables you to assign an employee to the appropriate payroll area.
These Pernrs are locked during Payroll Run.
Determine Payroll Period:
On the Selection screen, you can give Payroll Period Parameter as per the requirement else you can give Payroll Area, by which system calculates the payroll period.
Finding Payroll Results for a Specific Query:
Payroll results are stored in cluster Rx of the PCL2. The cluster key is not mnemonic; it contains only the PERNR (personnel number) and SEQNO (sequential number) fields.
The internal table RGDIR (PC261 - Cluster Directory for Export and Import of Payroll Results) contains a directory entry for each payroll result.
This entry is a sequential number (RGDIR-SEQNR), which uniquely identifies the payroll result.
Payroll results can only be imported if the payroll cluster key (PC200) contains the personnel number and sequential number.
Function Modules for Selecting Payroll Results
You will probably always have the same queries when importing payroll records. For example, "Which payroll results (original and retroactively accounted records) were written for a specific payroll run (defined by IN payroll category, IN payroll area, IN period)"? To save programmers from having to write their own reports for this functionality, standard modules are available for the most important queries. The employee's payroll directory is always transferred to the function modules using the table RGDIR (PC261). The modules then transfer the payroll records, which satisfy the specified selection criteria using a table whose type corresponds to that of the RGDIR (PC261) but which has a different name.
Exporting Pernr Personal Number
Importing Molga Country
Tables Rgdir Payroll Results Directory
This Function Module populates payroll results of all employees with PERNR & SEQNR as key.
Macro Modules:
We have populated Results Directory & retrieved Sequential Number, we need to call an import macro module for retrieving the required payroll results. For this we need to pass the unique identification of an Employee payroll Result i.e. rx-key-pernr = v_pernr.
rx-key-seqno = v_seqnr.
To that import macro.
Calling Import Module: RP-imp-c2-RU.
This Macro populates all the cluster tables required for Payroll, by importing from PCL2 Cluster Directory. After that we can loop through these cluster tables for required fields.
Guideline to write a program, which retrieves the data for, specified country
Use Logical Database As per the Requirement.
Include Payroll Driver with reference to Country- Specific modules which inturn includes Country-specific Schemas etc.
Get the PERNRs for which you want to obtain payroll results.
Populate Results Directory RGDIR with PERNR & Molga (Country) calling FM CU_READ_RGDIR.
Get the Unique Sequential Number with PERNR, From Date & Last Date calling CD_READ_LAST.
Pass these KEY Field (PERNR, SEQNR) to IMPORT MACRO
RP-IMP-C2- RU to import all the relevant field entries from PCL2
DIRECTORY to all the cluster tables
Get the required fields by looping through cluster tables.
Integration
All data is stored in internal tables and saved in files with a cluster structure.
Internal Tables: Internal tables store data during payroll.
The system imports data to these tables and used them to calculate new data. This data is then also saved in internal tables.
At the start of the payroll run, the system reads the values from the results tables to the old results table (ORT). Data from the previous period is, therefore, available in the current payroll period.
The most important internal tables are:
Input table (IT)
Table IT contains data that can be edited. The table exists only during processing.
Output table (OT)
Table OT contains the results of an activity. These results are written to the input table for further processing. The table exists only during processing.
Results table (RT)
Table RT contains the results of the period for which payroll has been run. The system saves this data in the PCL2 file in cluster RX.
Interaction of IT, OT and RT:
The necessary data for the respective processing step is loaded into the input table and is thus available for various processing procedures. The results of a processing step are stored either in the output table or the results table. At the end of a processing step, the data from the OT is loaded back into the IT, where it is available for further processing steps. The IT and OT are only temporarily filled, whereas the RT is stored on the database. In one of the first processing steps, the RT of the last payroll accounting period is imported into the old results table (ORT) and can consequently be used for further processing.
Payroll Relevant Files:
Payroll files contain data for payroll and payroll results.
Structure
The system requires the following files for payroll:
Pnnnn (nnnn = number of the infotype)
The Pnnnn files contain data that has been entered in the respective infotypes for an employee.
Example
P0000 - Actions Infotype
P0008 - Basic Pay Infotype
PCL1
The PCL1 file contains primary information, in other words, data from the master data and time recording systems.
PCL2
The PCL2 file contains secondary information, in other words, derived data and all generated schemas
Integration
When you start payroll, the system imports the relevant master data from the Pnnnn files (for example, basic pay and tax class) and imports the time data from the PCL1 file to the IT table.
The system imports the payroll results from the previous month from table ORT (for example, to form averages).
The system processes this data and saves the payroll results and generated schemas in the PCL2 file.
Payroll Control
Edited by: Alvaro Tejada Galindo on Apr 8, 2008 5:09 PM -
Problem in Using Logical Database PNP
Hi Guru's,
I am using PNP logical database and rp_provide_from_last
macros statements to fetch data from PA Tables.
When i am doing extended syntax check it is showing more
than 60 error's in ECC 6.0 for below statements:
1) Tables: Pernr
2) Infotypes: 0001,0002. and
3) RP_PROVIDE_FROM_LAST statements.
Could any please provide soloution how to clear all these.
Its very urgent.
Thanks in advance.
Regards,
SunilHi Ramesh,
These are the type of error messages in exetnded syntax check:
The current ABAP command is obsolete
In the OO context either an INTO or an ASSIGNING specification or the addition
"TRANSPORTING NO FIELDS" must be used . be used. be used. be used. be used. be
used.
Internal Message Code: READ 018
(The message cannot be hidden using pseudo-comment "#EC .., bzw. durch SET
EXTENDED CHECK OFF/ON)
Program: Z_INT_I_PY_BONUSPAYMENT Include: Z_PY_F01_BONUSPAYMENT Row: 279
The current ABAP command is obsolete
At "LOOP AT itab" one of the additions "INTO", "ASSIGNING" or "TRANSPORTING NO
FIELDS" is required in the OO context . .
Internal Message Code: LOOP 012
(The message cannot be hidden using pseudo-comment "#EC .., bzw. durch SET
EXTENDED CHECK OFF/ON)
Program: Z_INT_I_PY_BONUSPAYMENT Include: Z_PY_F01_BONUSPAYMENT Row: 282
The current ABAP command is obsolete
In the OO context either an INTO or an ASSIGNING specification or the addition
"TRANSPORTING NO FIELDS" must be used . be used. be used. be used. be used. be
used.
Internal Message Code: READ 018
(The message cannot be hidden using pseudo-comment "#EC .., bzw. durch SET
EXTENDED CHECK OFF/ON)
Program: Z_INT_I_PY_BONUSPAYMENT Include: Z_PY_F01_BONUSPAYMENT Row: 282
The current ABAP command is obsolete
At "LOOP AT itab" one of the additions "INTO", "ASSIGNING" or "TRANSPORTING NO
FIELDS" is required in the OO context . .
Internal Message Code: LOOP 012
(The message cannot be hidden using pseudo-comment "#EC .., bzw. durch SET
EXTENDED CHECK OFF/ON)
Please suggest me some way to clear these if it is possible. -
Rp_provide_from_last dynamic table
Hi,
I have a report which uses logical database PNPCE to fetch employee data and macros like rp_provide_from_last to read infotypes.
INFOTYPES: 0001 name gtab1,
002 name gtab2.
rp_provide_from_last gtab1 space pn-begda pn-endda
rp_provide_from_last gtab2 space pn-begda pn-endda.
I want to use a dynamic fieldname instead of gtab1 / gtab2. Basically i want to use this above macro statement to check if the infotype exists for a employee. So if there are 50 infotypes to be checked, i donot want to write this macro 50 times with 50 tables, is there a way to use a dynamic table name in the macro statement ?
Thanks
SubhaYour requirement can be met by modelling the program based on the below source code. This program will list all infotypes that have been maintained for a PERNR. This proram excludes certain infotypes like PD infotypes. The source code can be changed to include all desired infotypes.
*& Report ZTEST_CHECK_INFY
REPORT ZTEST_CHECK_INFY.
tables: t777d.
DATA SUBRC LIKE SY-SUBRC.
DATA PAR1 LIKE SY-MSGV1.
DATA: BEGIN OF SELTAB OCCURS 5.
INCLUDE STRUCTURE PRELP AS prelp. "UC
DATA: OPERA(1).
DATA: END OF SELTAB.
data: it_777d like t777d occurs 0.
data: wa_777d type t777d.
data: ls_index(4) type n.
select-options: so_infty for t777d-infty.
select-options: so_inft1 for t777d-infty no intervals.
Initialization.
so_infty-sign = 'I'.
so_infty-option = 'BT'.
so_infty-low = '0000'.
so_infty-high = '9999'.
append so_infty.
select * from t777d into corresponding fields of table it_777d where infty in so_infty.
loop at it_777d into wa_777d.
so_inft1-sign = 'I'.
so_inft1-option = 'EQ'.
so_inft1-low = wa_777d-infty.
append so_inft1.
endloop.
start-of-selection.
CALL FUNCTION 'HR_INITIALIZE_BUFFER'
EXPORTING
TCLAS = 'A'
PERNR = '40101017'
EXCEPTIONS
OTHERS = 1.
Loop at so_inft1 where not low between '1000' and '8999'.
REFRESH SELTAB.
CLEAR SELTAB.
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
TCLAS = 'A'
PERNR = '40101017'
INFTY = so_INFT1-low
BEGDA = '19000101'
ENDDA = '99991231'
IMPORTING
SUBRC = SUBRC
TABLES
INFTY_TAB = SELTAB
EXCEPTIONS
INFTY_NOT_FOUND = 1
OTHERS = 2.
if subrc eq 0.
write:/ so_inft1-low, 'has been maintained for employee: ', '40101017'.
endif.
endloop. -
Regarding using of LDB PNPCE in sap hr
Can some one please tell me how to disable some of the selection screen fields and blocks of LDB PNPCE selection-screen which are not used in my report selection-screen?
Thanks,
Phanisreedhar.L*: Report: ZP_POSTCODE :
*: Author: www.SAPDev.co.uk :
*: Date : 2004 :
*: Description: Displays report of employees by postcode area, :
*: includes current travelling allowances (i.e. parking :
*: permit or transport card etc..) :
*: Use: Help encourage the use of car sharing and public :
*: transport where appropriate. :
REPORT zp_postcode.
type-pools: slis. "ALV Declarations
NODES: pernr.
INFOTYPES: 0000, 0001, 0002, 0006, 0008, 0014, 0105, 0121.
SELECTION-SCREEN BEGIN OF BLOCK pcode WITH FRAME TITLE text-s01.
SELECT-OPTIONS: so_pcode FOR p0006-pstlz.
SELECTION-SCREEN END OF BLOCK pcode.
TYPES: BEGIN OF t_output,
pernr TYPE p0001-pernr, "personnel name
anredtxt TYPE t522t-atext, "title (based on p0002-anred)
fname TYPE p0002-vorna, "first name
lname TYPE p0002-nachn, "last name
orgtx TYPE t527x-orgtx, "dept
fte TYPE p0008-bsgrd, "fte
parking(20) TYPE c,
payslip TYPE t526-sachn, "payslip address
telno TYPE p0105-usrid_long, "tel number(p0105-usrty = 0020)
email TYPE p0105-usrid_long, "email (p0105-usrty = MAIL)
postcode type p0006-pstlz,
END OF t_output.
DATA: it_output TYPE STANDARD TABLE OF t_output INITIAL SIZE 0,
wa_output TYPE t_output.
*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
gd_tab_group type slis_t_sp_group_alv,
gd_layout type slis_layout_alv,
gd_repid like sy-repid,
gt_events type slis_t_event,
gd_prntparams type slis_print_alv,
gd_count(6) type n,
gd_outtext(70) type c,
gd_lines type i.
*START-OF-SELECTION.
START-OF-SELECTION.
clear: gd_count.
GET pernr.
Infotype 0121 is used to store multiple contracts for personnel.
Field p0121-hpern contains the personnel number for the main contract.
PROVIDE * from p0121 between pn-begda and pn-endda.
Check if main contract
if p0121-pernr ne p0121-hpern.
reject.
endif.
ENDPROVIDE.
add 1 to gd_count.
concatenate 'Processing personnel data'(m10) gd_count into gd_outtext
separated by ' '.
Display indicator for employee count
perform progress_indicator using gd_outtext.
Retrieve datd from infotypes
rp_provide_from_last p0000 space pn-begda pn-endda.
rp_provide_from_last p0001 space pn-begda pn-endda.
rp_provide_from_last p0002 space pn-begda pn-endda.
rp_provide_from_last p0006 space pn-begda pn-endda.
rp_provide_from_last p0008 space pn-begda pn-endda.
rp_provide_from_last p0014 space pn-begda pn-endda.
Check post code
CHECK p0006-pstlz IN so_pcode. "cp
Post code
wa_output-postcode = p0006-pstlz.
Personnel number
wa_output-pernr = pernr-pernr.
Personnel title
SELECT SINGLE atext
FROM t522t
INTO wa_output-anredtxt
WHERE sprsl EQ sy-langu AND
anred EQ p0002-anred.
First name
wa_output-fname = p0002-vorna.
Last name
wa_output-lname = p0002-nachn.
Organizational Unit text (dept)
SELECT SINGLE orgtx
FROM t527x
INTO wa_output-orgtx
WHERE sprsl EQ sy-langu AND
orgeh EQ p0001-orgeh AND
endda GE sy-datum.
FTE
wa_output-fte = p0008-bsgrd.
Parking / travel deducted?
CASE p0014-lgart.
WHEN '7180' OR '7181' OR '7182'.
wa_output-parking = text-002.
WHEN '7183'.
wa_output-parking = text-001.
WHEN '7171' OR '7172' or '7173' or '7174' or
'7175' or '7176' or '7177' or '7178'.
wa_output-parking = text-003.
ENDCASE.
Payslip Address
SELECT SINGLE sachn
FROM t526
INTO wa_output-payslip
WHERE werks EQ p0001-werks AND
sachx EQ p0001-sacha.
PROVIDE * from p0105 between pn-begda and pn-endda.
Telephone numbers
if p0105-usrty = '0020'.
wa_output-telno = p0105-usrid_long.
endif.
Email address
if p0105-usrty = 'MAIL'.
wa_output-email = p0105-usrid_long.
endif.
ENDPROVIDE.
append wa_output to it_output.
clear: wa_output.
*END-OF-SELECTION.
END-OF-SELECTION.
describe table it_output lines gd_lines.
if gd_lines gt 0.
perform build_fieldcatalog.
perform build_layout.
perform display_alv_report.
else.
message i003(zp) with 'No records found'.
endif.
*& Form PROGRESS_INDICATOR
Displays progress indicator on SAP screen
form progress_indicator using p_text.
call function 'SAPGUI_PROGRESS_INDICATOR'
exporting
PERCENTAGE = 0
text = p_text.
endform. " PROGRESS_INDICATOR
*& Form BUILD_FIELDCATALOG
Build Fieldcatalog for ALV Report
form build_fieldcatalog.
fieldcatalog-fieldname = 'PERNR'.
fieldcatalog-seltext_m = 'Personnel No.'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
fieldcatalog-do_sum = 'X'.
fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'ANREDTXT'.
fieldcatalog-seltext_m = 'Title'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'FNAME'.
fieldcatalog-seltext_m = 'First Name'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'LNAME'.
fieldcatalog-seltext_m = 'Last Name'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'ORGTX'.
fieldcatalog-seltext_m = 'Department'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'FTE'.
fieldcatalog-seltext_m = 'FTE'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'PARKING'.
fieldcatalog-seltext_m = 'Parking/Metrocard'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'PAYSLIP'.
fieldcatalog-seltext_m = 'Payslip Add.'.
fieldcatalog-col_pos = 7.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'TELNO'.
fieldcatalog-seltext_m = 'Telephone'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EMAIL'.
fieldcatalog-seltext_m = 'E-mail'.
fieldcatalog-col_pos = 9.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'POSTCODE'.
fieldcatalog-seltext_m = 'Post code'.
fieldcatalog-col_pos = 10.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
Build layout for ALV grid report
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
gd_layout-zebra = 'X'.
endform. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
Display report using ALV grid
form display_alv_report.
gd_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = it_output
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform. " DISPLAY_ALV_REPORT
The following program allows you to retrieve all the individuall sickpay values for a given period and person.This data is then exported to memory using the memory id entered on the selection screen. This thereforeallows you to submit this program from another program and then process the data within the calling programby importing the data from memory. Click here for example .
Report: ZSXP_ABSENCE_DATA ** ** Author: www.SAPdev.co.uk ** ** Date : 12.02.2003 ** ** Description: Retrieve maternaty/Sickness Absence data* ************************************************************************REPORT ZSXP_ABSENCE_DATA LINE-SIZE 100 NO STANDARD PAGE HEADING MESSAGE-ID 5g.TABLES: t554s, pernr, pcl1, pcl2.INCLUDE rpclst00.INCLUDE rpc2rx09. "Payroll results datadefns-Intl.INCLUDE rpc2rxx0. "Payroll results datadefns-Intl.INCLUDE rpc2rgg0. "Payroll results datadefns-GBINCLUDE rpcfdcg0. "Payroll results datadefns-GBINCLUDE rpcdatg0.INCLUDE rpc2cd00. "Cluster Directory defns.INCLUDE rpc2ps00. "Cluster: Generierte SchematasINCLUDE rpc2pt00.INCLUDE rpcfdc10.INCLUDE rpcfdc00.INCLUDE rpppxd00.INCLUDE rpppxd10.INCLUDE rpcfvp09.INCLUDE rpcfvpg0.INCLUDE rpppxm00.INFOTYPES: 0001, "Organisational assignment 0002, "Personal Data 0003, "Payroll Status 0088, "SMP 2001, "Absences 0086. "SSP/SMP ExlclusionsDATA: ssp_weeks TYPE p DECIMALS 2 VALUE 0.DATA: ssp_total TYPE p DECIMALS 2 VALUE 0, total_val TYPE p DECIMALS 2 VALUE 0, smp_weeks TYPE p DECIMALS 2 VALUE 0, smp_value TYPE p DECIMALS 2 VALUE 0, gross LIKE pc207-betrg, dis_gross TYPE p DECIMALS 2 VALUE 0.DATA: gd_begda(10) TYPE c, gd_endda(10) TYPE c.DATA: ld_orgtxt LIKE t527x-orgtx.DATA: name(30).DATA: BEGIN OF itab OCCURS 0, pernr LIKE p0002-pernr, perid LIKE p0002-perid, name LIKE name, END OF itab.TYPES: BEGIN OF t_report, pernr TYPE pernr-pernr, "8 name TYPE name, "30 awart TYPE p2001-awart, "4 begda TYPE p2001-begda, "10 endda TYPE p2001-endda, "10 wkspaid TYPE p DECIMALS 2, "10 amtpaid TYPE p DECIMALS 2, "10 END OF t_report.DATA: it_report TYPE STANDARD TABLE OF t_report INITIAL SIZE 0, wa_report TYPE t_report.DATA: moabw LIKE t001p-moabw.DATA: printheader TYPE i VALUE 1, gd_success TYPE i. NCALE declarationsTYPES : BEGIN OF pfra0_pcale, annee(4) TYPE c. INCLUDE STRUCTURE pcint.TYPES : END OF pfra0_pcale.TYPES : pfra0_tab_pcale TYPE pfra0_pcale OCCURS 0.DATA: it_ncale TYPE STANDARD TABLE OF pcnat INITIAL SIZE 0, wa_ncale TYPE pcnat, it_pcale TYPE pfra0_tab_pcale, pcale TYPE pfra0_tab_pcale.* SMP/SSP absence datadata begin of it_msa occurs 0. include structure pc27j.data end of it_msa.parameters: p_memid type char30.************************************************************************STAR-OF-SELECTIONSTART-OF-SELECTION.gd_begda = pn-begda.gd_endda = pn-endda.gd_begda6(2) = '01'.gd_endda6(2) = '01'.refresh: it_msa.clear: it_msa.GET pernr.* PERFORM IMPORT_PC USING GD_SUCCESs. PERFORM get_rgdir. while gd_begda le gd_endda. PERFORM get_new_rg USING gd_begda. CALL FUNCTION 'CALCULATE_DATE' EXPORTING* DAYS = '0' MONTHS = '1' START_DATE = gd_begda IMPORTING RESULT_DATE = gd_begda. endwhile. msa[] = it_msa[]. EXPORT msa TO MEMORY ID p_memid.&---------------------------------------------------------------------& Form GET_RGDIR&-------------------------------------------------------------------FORM get_rgdir. rp-init-buffer. CLEAR rgdir. REFRESH rgdir. MOVE pernr-pernr(8) TO cd-key-pernr. rp-imp-c2-cd. IF rp-imp-cd-subrc = 0. "rgdir success SORT rgdir BY seqnr ASCENDING. CLEAR rgdir. ENDIF.ENDFORM.-----------------------------------------------------------------** FORM get_new_rg **-----------------------------------------------------------------** ........ **-------------------------------------------------------------------** > search_date **-----------------------------------------------------------------FORM get_new_rg USING search_date. DATA: rg_day TYPE d, rgbeg TYPE d, rgend TYPE d. MOVE: search_date TO rg_day. CLEAR: msa. LOOP AT rgdir WHERE void NE 'V'. MOVE: rgdir-fpbeg TO rgbeg, rgdir-fpend TO rgend. IF ( rgbeg <= rg_day ) AND ( rgend >= rg_day ) AND rgdir-srtza = 'A'. "Must be periods actual set of results EXIT. ENDIF. ENDLOOP. UNPACK rgdir-seqnr TO rx-key-seqno. MOVE pernr-pernr(8) TO rx-key-pernr(8). rp-imp-c2-rg. append lines of msa to it_msa. IF rp-imp-rg-subrc <> 0. rg fail ELSE.* rg success ENDIF.ENDFORM.Text elements------------------------------------------------------* 001 Sickness History for SSP 1* 002 Employee Name.* 003 National Insurance Number.* 004 Payroll Number.* 005 Sickness Start Date* 006 Sickness End Date* 007 Number of weeks paid* 008 system-error:* 009 No SSP / SMP record found* 010 Absence type* 011 No. weeks paid* 012 Amount* 013 Organisation Unit.* T01 Sickness Absence typesSelection texts--------------------------------------------------------* SO_SAP SAP Att./absence types* SO_SMP SMP Att./absence types* SO_SPP SPP Att./absence types* SO_SSP SSP Att./absence types
Uses Logical database 'PNP'(entered in program attributes) to retrieve various personnel data and downloadit to an excel / tab delimited file.
.......................................................................: Report: ZDOWNEMPDATA :: :: Author: www.SAPDev.co.uk :: :: Date : 2004 :: :: Description: Downloads employee data to TAB delimited flat files :: ::.....................................................................:.......................................................................: Report: ZDOWNEMPDATA :: :: Author: www.SAPDev.co.uk :: :: Date : 2004 :: :: Description: Downloads employee data to TAB delimited flat files :: ::.....................................................................:REPORT zdownempdata .INFOTYPES: 0000, 0001, 0007, 0008, 0121, 0615.NODES: pernr.TABLES: t001p.TYPES: BEGIN OF t_employee,* INCLUDE STRUCTURE hrms_biw_io_occupancy. begda TYPE begda, endda TYPE endda, pernr TYPE pernr_d, rfpnr TYPE rfpnr, bukrs TYPE bukrs, werks TYPE persa, btrtl TYPE btrtl, persg TYPE persg, persk TYPE persk, orgeh TYPE orgeh, stell TYPE stell, plans TYPE plans, kokrs TYPE mast_coar, kostl TYPE mast_cctr, abkrs TYPE abkrs, molga TYPE molga, trfar TYPE trfar, trfgb TYPE trfgb, trfkz TYPE trfkz, trfgr TYPE trfgr, trfst TYPE trfst, bsgrd TYPE bsgrd, ansal TYPE ansal_15, ancur TYPE ancur, empct TYPE empct, stat2 TYPE stat2, ncsdate TYPE hiredate, sltyp TYPE p_sltyp, slreg TYPE p_slreg, slgrp TYPE p_slgrp, sllev TYPE p_sllvl, ansvh TYPE ansvh, vdsk1 TYPE vdsk1, sname TYPE smnam, END OF t_employee.DATA: it_employee TYPE STANDARD TABLE OF t_employee INITIAL SIZE 0, wa_employee TYPE t_employee.TYPES: BEGIN OF t_emptexts,* INCLUDE STRUCTURE hrms_bw_txt_employee. DATEFROM TYPE RSDATEFROM, DATETO TYPE RSDATETO, PERNR TYPE PERSNO, TXTMD TYPE EMNAM, END OF t_emptexts.DATA: it_emptexts TYPE STANDARD TABLE OF t_emptexts INITIAL SIZE 0, wa_emptexts TYPE t_emptexts.TYPES: BEGIN OF t_contract,* INCLUDE STRUCTURE pa0615. pernr TYPE p0615-pernr, begda TYPE p0615-begda, endda TYPE p0615-endda, aedtm TYPE p0615-aedtm, ctype TYPE p0615-ctype, cbeg TYPE p0615-cbeg, cend TYPE p0615-cend, END OF t_contract.DATA: it_contract TYPE STANDARD TABLE OF t_contract INITIAL SIZE 0, wa_contract TYPE t_contract.DATA: it_tabemp TYPE filetable, gd_subrcemp TYPE i, it_tabempt TYPE filetable, gd_subrcempt TYPE i, it_tabcont TYPE filetable, gd_subrccont TYPE i.DATA: gd_downfile TYPE string.SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.PARAMETERS: p_emp LIKE rlgrap-filename, p_empt LIKE rlgrap-filename, p_cont LIKE rlgrap-filename.SELECTION-SCREEN END OF BLOCK block1.***********************************************************************at selection-screenAT SELECTION-SCREEN ON VALUE-REQUEST FOR p_emp. REFRESH: it_tabemp. CALL METHOD cl_gui_frontend_services=>file_open_dialog EXPORTING window_title = 'Select File' default_filename = '.xls' initial_directory = 'C:\' multiselection = ' ' "No multiple selection CHANGING file_table = it_tabemp rc = gd_subrcemp. LOOP AT it_tabemp INTO p_emp. ENDLOOP.***********************************************************************at selection-screenAT SELECTION-SCREEN ON VALUE-REQUEST FOR p_empt. REFRESH: it_tabemp. CALL METHOD cl_gui_frontend_services=>file_open_dialog EXPORTING window_title = 'Select File' default_filename = '.xls' initial_directory = 'C:\' multiselection = ' ' "No multiple selection CHANGING file_table = it_tabempt rc = gd_subrcempt. LOOP AT it_tabempt INTO p_empt. ENDLOOP.***********************************************************************at selection-screenAT SELECTION-SCREEN ON VALUE-REQUEST FOR p_cont. REFRESH: it_tabcont. CALL METHOD cl_gui_frontend_services=>file_open_dialog EXPORTING window_title = 'Select File' default_filename = '.xls' initial_directory = 'C:\' multiselection = ' ' "No multiple selection CHANGING file_table = it_tabcont rc = gd_subrccont. LOOP AT it_tabcont INTO p_cont. ENDLOOP.************************************************************************START-OF-SELECTION.START-OF-SELECTION.GET pernr. Selecting the latest infotype record rp_provide_from_last p0000 space pn-begda pn-endda. rp_provide_from_last p0001 space pn-begda pn-endda. rp_provide_from_last p0007 space pn-begda pn-endda. rp_provide_from_last p0008 space pn-begda pn-endda. rp_provide_from_last p0121 space pn-begda pn-endda. rp_provide_from_last p0615 space pn-begda pn-endda. MOVE-CORRESPONDING p0001 TO wa_employee. wa_employee-rfpnr = p0121-rfp01. "????? MOVE-CORRESPONDING p0007 TO wa_employee. MOVE-CORRESPONDING p0008 TO wa_employee. MOVE-CORRESPONDING p0000 TO wa_employee. SELECT SINGLE molga FROM t001p INTO wa_employee-molga WHERE werks EQ p0001-werks AND btrtl EQ p0001-btrtl. SELECT SINGLE trfkz FROM t503 INTO wa_employee-trfkz WHERE persg EQ p0001-persg AND persk EQ p0001-persk. CALL FUNCTION 'HR_ENTRY_DATE' EXPORTING persnr = pernr-pernr* RCLAS =* BEGDA = '18000101'* ENDDA = '99991231'* VARKY = IMPORTING entrydate = wa_employee-ncsdate* TABLES* ENTRY_DATES = EXCEPTIONS ENTRY_DATE_NOT_FOUND = 1 PERNR_NOT_ASSIGNED = 2 OTHERS = 3 . IF sy-subrc <> 0.* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF.* append employee data APPEND wa_employee TO it_employee. CLEAR: wa_employee. wa_emptexts-datefrom = p0001-begda. wa_emptexts-dateto = p0001-endda. wa_emptexts-pernr = p0001-pernr. wa_emptexts-txtmd = p0001-ename.* append employee texts data APPEND wa_emptexts TO it_emptexts. CLEAR: wa_emptexts. MOVE-CORRESPONDING p0615 TO wa_contract.* append employee contract data APPEND wa_contract TO it_contract. CLEAR: wa_contract.************************************************************************END-OF-SELECTION.END-OF-SELECTION. download employee data IF NOT p_emp IS INITIAL. gd_downfile = p_emp. CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING filename = gd_downfile filetype = 'ASC' write_field_separator = 'X' TABLES data_tab = it_employee. IF sy-subrc EQ 0. WRITE:/ 'Employee file downloaded to', gd_downfile. ELSE. WRITE:/ 'There was an error downloading Employee file to', gd_downfile. ENDIF. ENDIF.* download employee texts data IF NOT p_empt IS INITIAL. gd_downfile = p_empt. CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING filename = gd_downfile filetype = 'ASC' write_field_separator = 'X' TABLES data_tab = it_emptexts. IF sy-subrc EQ 0. WRITE:/ 'Employee text file downloaded to', gd_downfile. ELSE. WRITE:/ 'There was an error downloading Employee text file to', gd_downfile. ENDIF. ENDIF.* download contract data IF NOT p_cont IS INITIAL. gd_downfile = p_cont. CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING filename = gd_downfile filetype = 'ASC' write_field_separator = 'X' TABLES data_tab = it_contract. IF sy-subrc EQ 0. WRITE:/ 'Employee contract file downloaded to', gd_downfile. ELSE. WRITE:/ 'There was an error downloading Employee contract file to', gd_downfile. ENDIF. ENDIF. -
Using Provide statement in HR programming
Hi,
Im using the code below;
PROVIDE FROM p2001 BETWEEN pn-begda AND pn-endda
WHERE p2001-subty = '0101'.
ENDPROVIDE.
But the subty = 0101 doesnt seem to be working. When i look at the p2001 table after i execute the code, it does limit within the date range but not the subtype.
Thankshi,
DATA i_2001 TYPE p2001 OCCURS 0 WITH HEADER LINE.
TYPES: BEGIN OF i_output,
v_AWART TYPE p2001-AWART,
END OF i_output.
DATA : it_out TYPE STANDARD TABLE OF i_output INITIAL SIZE 0,
wa_output TYPE i_output.
START-OF-SELECTION.
GET pernr.
rp_provide_from_last p2001 space pn-begda pn-endda.
CHECK p2001-SUBTY = '0101'.
LOOP AT p2001 WHERE begda GE pn-begda
AND begda LE pn-endda.
MOVE-CORRESPONDING p2001 TO i_2001.
APPEND i_2001.
DELETE p2001.
ENDLOOP.
wa_output-v_AWART = i_0000-AWART.
IF p2001-begda GE pn-begda AND p2001-begda LE pn-endda.
APPEND wa_output TO it_out.
ENDIF.
REFRESH i_20001[].
CLEAR i_2001.
REGARDS,
sreelakshmi
Edited by: Sreelakshmi p on Jun 23, 2008 3:02 PM -
Hello Experts,
I'm trying to write a code using GET PERNR statement for every first time but keeps getting the error when try to execute my code. Here is the error (Do not use the GET PERNR event).
Can somebody please help me rectify this error. For reference here is my code.
report zad_hr_test line-size 200.
*Database Table
tables: pernr, " Pernr structure for Logical database
pa0001, " Actions
pa0002. " Personnel Info
*Infotypes
infotypes: 0001, " Actions
0002. " personnel info
*Variable Declaration
data: form_nam like p0001-ename,
v_age(5) type c, "variable for calculating age in days
v_ctr1 type i value 0, "counter
v_ctr2 type i value 0, "counter
var(5) type c , " variable to store btrtl
var1(5) type c . " variable to store werks
*Internal Table Decalartion
data: begin of i_tab1 occurs 0,
werks like pa0001-werks, "personnel area
btrtl like pa0001-btrtl, "personnel sub area
pernr like pa0001-pernr, "employee number
ename like pa0001-ename, "employee name
begda like pa0002-begda, "employee join date
persg like pa0001-persg, "employee group
persk like pa0001-persk, "employee sub-group
plans like pa0001-plans, "position
gbdat like p0002-gbdat, "date of birth
end of i_tab1.
*START-OF-SELECTION
start-of-selection .
get pernr .
i_tab1-pernr = pernr-pernr.
rp_provide_from_last p0001 space pn-begda pn-endda . " Macro for IFT-0001
rp_provide_from_last p0002 space pn-begda pn-endda . " Macro for IFT-0002
**--> Populate internal table
move p0001-werks to i_tab1-werks .
move p0001-btrtl to i_tab1-btrtl .
move p0001-pernr to i_tab1-pernr .
move p0001-ename to i_tab1-ename .
move p0002-begda to i_tab1-begda .
move p0001-persg to i_tab1-persg .
move p0001-persk to i_tab1-persk .
move p0001-plans to i_tab1-plans .
move p0002-gbdat to i_tab1-gbdat .
**--> Append data to internal table
append i_tab1 .
clear i_tab1 .
loop at i_tab1.
write:/ i_tab1-werks,
i_tab1-btrtl,
i_tab1-pernr,
i_tab1-ename,
i_tab1-begda,
i_tab1-persg,
i_tab1-persk,
i_tab1-plans,
i_tab1-gbdat.
endloop.
Many thanks in advance.Hi,
You're asking a different question now, so you should start a new thread...
Anyway, in the 'Attributes' screen of your program you can specify which selection screens you want to display for a logical database.
Alternatively you can hide all (or part) of a selection screen at the 'selection-screen output' event.
For example:
at selection-screen output.
loop at screen.
check screen-name = 'PNPABKRS-HIGH'
or screen-name = 'PNPABKRS-LOW'.
screen-input = '0'.
screen-output = '0'.
screen-invisible = '1'.
screen-active = '0'.
modify screen.
endloop.
cheers
Paul -
Which include i can use instead of PNP LDB
Hi Friends -
Which standard include i can use for PNP LDB ?
am working in abap webdynpro and need to use some macro like rp_provide_from_last but for them we have to use pnp ldb and in abap webdynpro we can't define LDBs so i need the standard Include prog which can fulfill my requirment ..
Pls share your inputs on this.
Regards
MeetaHi Txs for your quick turn,
could you pls tell me what is wrong in my this code ,
include DBPNPMAC .
INFOTYPES 0000.
DATA: pnp-sw-found,
pnp-sy-tabix like sy-tabix.
parameters : p_begda like pa0001-begda,
p_endda like pa0001-endda.
START-OF-SELECTION.
RP_PROVIDE_FROM_LAST p0000 space p_begda p_endda .
if PNP-SW-FOUND = 1 .
write : / p0000-pernr,p0000-begda,p0000-endda.
endif.
end-of-selection.
am not getting any output but if i use LDB pnp and get pernr i will get ..
but i cant use LDB pls suggest me what i shd do ?
Regards
Meeta -
Get data from more than 1 subtype using RP_PROVIDE_FROM LAST
Hi all,
I need to get data from infotype 2013 subtype 90 and subtype 91.
Currently the codes only allow me to use it one time for the same infotype. If I use it again for the same infotype, pnp-sw-found will equal to zero. Anyone have any idea on this?
Example:
Get pernr.
Start of selection.
rp_provide_from_last p2013 0090 pn-begda pn-endda.
IF pnp-sw-found = 1.
**--> Populate internal table
MOVE p2013-ktart TO ls_quota-ktart.
MOVE p2013-aedtm to ls_quota-aedtm.
MOVE p2013-uname to ls_quota-uname.
MOVE p2013-accnu to ls_quota-accnu.
MOVE p2013-accop to ls_quota-accop.
ELSE.
REJECT.
ENDIF.
End of selection.Using RP_PROVIDE_FROM_LAST you can only use for one infotype and one subtype. For reading data for IT2013 with subtypes 90 and 91....you have to use following....
Get pernr.
Start of selection.
rp_provide_from_last p2013 0090 pn-begda pn-endda.
IF pnp-sw-found = 1.
**--> Populate internal table
MOVE:
p2013-ktart TO ls_quota-ktart,
p2013-aedtm to ls_quota-aedtm,
p2013-uname to ls_quota-uname,
p2013-accnu to ls_quota-accnu,
p2013-accop to ls_quota-accop.
ELSE.
rp_provide_from_last p2013 0091 pn-begda pn-endda.
IF pnp-sw-found = 1.
**--> Populate internal table
MOVE:
p2013-ktart TO ls_quota-ktart,
p2013-aedtm to ls_quota-aedtm,
p2013-uname to ls_quota-uname,
p2013-accnu to ls_quota-accnu,
p2013-accop to ls_quota-accop.
ELSE.
REJECT.
ENDIF.
ENDIF.
End of selection.
Hope this answer is helpful -
Regarding rp_provide_from_last
hi experts,
PERNR INFTY SUBTY OBJPS SPRPS ENDDA BEGDA SEQNR PUNCHTIME EMPLOYEECARDNO
00000001|9777 |P20 | | |20080804|20080804|000 |130000 |12345678
00000001|9777 |P20 | | |20080804|20080804|001 |190000 |12345678
here the data in my internal table is in this format i need to pick the last row
for this i use " rp_provide_from_frst P9777 'P20' s_date s_date."but this
macro is picking the first row not the last row which i want..
plz help me to sort out this problem,i want to pick up the last punch out i.e punchtime-190000
i.e P20 for the employees not punchtime-1300000.Have a look at this link. This will describe almost every macro in HR with examples.
http://help.sap.com/saphelp_45b/helpdata/en/60/d8bc0a576311d189270000e8322f96/frameset.htm
The one which is of interest to you is
[RP_PROVIDE_FROM_FRST|http://help.sap.com/saphelp_45b/helpdata/en/60/d8bc0a576311d189270000e8322f96/content.htm]
[RP_PROVIDE_FROM_LAST|http://help.sap.com/saphelp_45b/helpdata/en/60/d8bc17576311d189270000e8322f96/content.htm]
Amandeep
Maybe you are looking for
-
HELP!!! AT THE END OF MY ROPE!!!
I've tried "restore to factory settings" with no avail. I am tempted to "Erase all data and petitions" but will that also mean that the system recovery petition will also be erased? I don't want that but I don't know what else to do!
-
Error: Metadata of component EquipmentShipment is not valid!
Hello all, I have created one webdynpro DC -A which has two DCs as used DC- B & C. Now everything builds & runs fine on local server. but when I activate DC "A" gives build errors, as it does not get reference for DC -B. Here is the error: "Error: Me
-
I tried and tried to compresse from my HD720p out from FCP to 720p for the web. I get awfull results. pixalised images and bigger files. are their presets for the web, or any place where I can find the good settings to get files that look as good as
-
Business place not found for plant?
Hi, I am facing the below mentioned problem with regard to Business Place with reference to Purchase order for Brazil. We are getting error while creating Purchase order."Business place not found for plant 8149" can any one has idea on this.. Thanks
-
Error Message 579024 when trying to purchase App from BB AppWorld
Hello, I am trying to purchase a game from the AppWorld, on my PB. I am able to login with my BBID, and hit "Pay Now", but I get an error : Problem encountered with PayPaul authorization.(Error:579024) Anyone know what this means? Is there a config p