HR ABAP/4
ABAP stands for Advanced Business Application Programming. ABAP is SAP's fourth generation language. All of R/3's applications and even parts of its basic system are developed in ABAP. ABAP is used for customization and modification of SAP applications.
HR Logical database (LDB)
What is LDB ?:
A logical database (LDB) is a special ABAP/4 program which combines the contents of certain database tables. Using logical databases facilitates the process of reading database tables.
How to activate LDB?:
LDB consists of database driver SAPDBPNP. To activate the database driver you need to maintain in the report attributes logical database 'PN' and application 'P' for HR.
Data processing using LDB:
When you run a report that uses LDB, the driver loads the employee data into the main memory and makes it available for processing. When the next personnel number is selected, the previous employee data is deleted from the memory.
Authorization Check:
LDB driver does authorization check before fetching employee data for processing. It makes sure if the employee has authorization to fetch master data. For e.g: non-paryoll department users are not allowed to view or fetch employees salary for reporting.
LDB used in HR
PAP - for Applicant administration
PNP - for Personnel Management
PNPCE - for Personnel Management.
PCH - for Organisational Management
PTRVP - for Travel Management
<
Example HR/ABAP report 1 USING PROVIDE..ENDPROVIDE:
REPORT TEST1.
TABLES: PERNR.
INFOTYPES: 0001.
GET PERNR.
PROVIDE * FROM P0001 BETWEEN PN/BEGDA AND PN/ENDDA.
WRITE:/ PERNR-PERNR
P0001-STELL
ENDPROVIDE.
Example HR/ABAP report 2 USING PROVIDE..ENDPROVIDE (JOIN two infotypes):
REPORT TEST2.
TABLES: PERNR.
INFOTYPES: 0001, 0002.
GET PERNR.
PROVIDE * FROM P0001.
* FROM P0002 BETWEEN PN/BEGDA AND PN/ENDDA.
WHERE P0006-SUBTY EQ '1'.
WRITE:/ PERNR-PERNR. P0001-STELL, P0002-VORNA.
ENDPROVIDE.
Example HR/ABAP report 3 USING RP-PROVIDE:
REPORT TEST3.
TABLES: PERNR.
INFOTYPES: 0001.
GET PERNR.
RP-PROVIDE-FROM-LAST P0001 SPACE PN/BEGDA AND PN/ENDDA.
IF PNP-SW-FOUND EQ '1'.
WRITE:/ PERNR-PERNR, P0001-STELL, P0001-BEGDA, P0001-ENDDA.
ELSE.
REJECT.
ENDIF.

