Programming SAP ABAP HR MO infotypes 1000 & 1001
The provided text covers various aspects of SAP HR (Human Resources) and HR programming. It includes information related to infotypes, data structure, HR modules, and programming in the HR module. Here's a summary:
Infotypes and Data Dictionary: The text mentions infotypes, such as P1000 and P1001, and provides a brief description of how they are stored in the data dictionary. It also discusses the concept of transparent, pooled, and cluster tables in the context of SAP HR.
Comparison of Table Types: It briefly explains the major differences between standard tables, pooled tables, and clustered tables in SAP HR.
Programming in HR: The text delves into SAP HR programming, focusing on the use of ABAP. It provides code examples for reading and changing infotypes, as well as accessing HR data in a programmatic manner.
Data Retrieval: It describes the process of retrieving HR data and converting numeric values into human-readable text, such as position and organizational unit names.
Reverse Connection: There is a mention of reverse 1001 connection with delete or insert.
SAP Object Types: A list of SAP object types and their respective codes is provided, including Organizational Unit (O), Job (C), Position (S), and others.
SAP P1001 Structure Fields: It lists the fields within the SAP P1001 infotype, including fields for object type, object ID, infotype, relationship specification, planning status, and more.
Example Program: The text includes an example program with ABAP code for working with infotypes, using loops, and making SAP HR-related function module calls.
Logical Databases: Logical databases are mentioned, and there's a reference to external resources for further learning about SAP HR organizational management.
In summary, the text provides a wide range of information related to SAP HR, from data structures and table types to programming and data retrieval. It also offers insights into the key components and functionalities of SAP HR modules.

Intoduction
Here you found some information about programming in HR
module. First check existence infotypes
: PPCI
Look at structure transparent table[footnote]transparent table What is transparent, cluster and pool table? Where and when we use these tables?
- Transparent Table : Exists with the same structure both in dictionary as well as in database exactly with the same data and fields.
- Pooled Table : Pooled tables are logical tables that must be assigned to a table pool when they are defined. Pooled tables are used to store control data. Several pooled tables can be combined in a table pool. The data of these pooled tables are then sorted in a common table in the database.
- Cluster Table : Cluster tables are logical tables that must be assigned to a table cluster when they are defined. Cluster tables can be used to store control data. They can also be used to store temporary data or texts, such as documentation.
Could anyone tell me what is the major difference between Standard tables, Pooled tables and Clustered Tables?
A transparent table
is a table that stores data directly. You can read these tables directly on the database from outside SAP with for instance an SQL statement. Transparent table is a one-to-one relation table, i.e. when you create one transparent table then exactly same table will create in database and if is basically used to store transaction data. A clustered and a pooled table cannot be read from outside SAP because certain data are clustered and pooled in one field. One of the possible reasons is for instance that their content can be variable and build up. Database manipulations in ABAP are limited as well. But pool and cluster table is a many to one relationship table. This means many pool table store in a database table which is now as table pool. All the pool table stored table in table pool does not need to have any foreign key relationship but for cluster table it is must. And pool and cluster table is basically used to store application data. Table pool can contain 10 to 1000 small pool tables which has 10 to 100 records. But cluster table can contain massive but few (1 to 10) cluster table. For pool and cluster table you can create secondary index and you can use select distinct, group for pool and cluster table. You can use native SQL statement for pool and cluster table. A structure is a table without data. It is only filled by program logic at the moment it is needed starting from tables. A view is a way of looking at the contents of tables. It only contains the combination of the tables at the basis and the way the data needs to be represented.
You actually call directly upon the underlying tables. How many tables we will come across in abap?
Ans : 3 types : Pooled , clustered, Transparent How many kinds of internal table are there?
Ans: 5 Types. Standard Table, Sorted Table, Index Table, Hashed Table, Any Table ( Generic type , Rarely used )[/footnote] P1000
and P1001
https://www.sapdatasheet.org/abap/tabl/pannnn.html
Display organization and Staffing Menu→Human Resources→Organizational Management→Organization and Staffing→PPOSE
– Display.
SAP HR Modules
SAP HR Modules covers the following topics
- Personnel Management (
PA
) - Time Management (
PT
) - Recruitment (
PB
) - Organizational Management (
OM
) - Personnel Development (
PD
) - Training & Event Management (
TM
)
SAP R/3 HR Programming Overview
This is the best guide to start HR development with ABAP
.
This SAP HR PDF Guide starts with?
- HR Data Structure,
- Master Data (PA),
- Payroll Result Data (PCL2),
- Payroll Result Data,
- HR Programming – Logical Database,
- HR Programming – LDB – PY,
- HR Programming – Using macros?and
- HR Programming w/o LDB.
HR Programming Introduction
The following ABAP HR
Programming PDF will cover the most important topics in SAP HR
development
It start with a Brief description of modules in SAP-HR
. The second part will cover the Concept of Infotypes
.
Then the Infotype Structures
?
will be explained and how to create infotype
or how to enhance HR infotype.
Use of Provide statement Cluster reading for Payroll results. Finally you will find some examples of PA
letters infotype (Customer defined) SAP
.
HR programming
reading_sample_sappress_1327_Organizational_Management_in_SAP_ERP_HCM_updatedProgram read infotype
Please use HR_INFOTYPE_OPERATION. Refer to these FMs:
- HR_ECM_DELETE_INFOTYPE,
- HR_ECM_FLUSH_INFOTYPE,
- HR_ECM_INSERT_INFOTYPE,
- HR_ECM_MODIFY_INFOTYPE,
- HR_ECM_READ_INFOTYPE,
- HR_ECM_READ_TEXT_INFOTYPE
You can refer to above function module
developed by SAP standard for Compensation and use it for your other info type. Refer to FM code. It is class based but very helpful. you need to use Flush in order to commit data into Data base.
If you have the subtype information HR_READ_SUBTYPE will further reduce your result set. Both use subroutine read_infotype_adapter to get data.
- https://wiki.scn.sap.com/wiki/display/ABAP/HR+Programming+-+Read+Infotype
- https://www.sapdatasheet.org/abap/intf/if_hrbas_plain_infotype_access.html
PROGRAM Z_READ_IF_1000. INFOTYPES: 1000. TABLES: HRP1000. DATA: R_INFO TYPE REF TO CL_HRBAS_PLAIN_INFOTYPE_ACCESS. FIELD-SYMBOLS: TYPE ANY TABLE. FIELD-SYMBOLS: TYPE STANDARD TABLE. DATA: LD_IS_OK TYPE BOOLE_D. DATA: LM_MSG TYPE HRBAS_MSG_HANDLER_IF_REF. DATA: OREF TYPE REF TO CX_ROOT, TEXT TYPE STRING. TRY. CALL METHOD R_INFO->IF_HRBAS_PLAIN_INFOTYPE_ACCESS~READ EXPORTING PLVAR = '01' OTYPE = '9L' OBJID = 00021222 ISTAT = '1' INFTY = '1000' * SUBTY = BEGDA = '20000709' ENDDA = '20200709' NO_AUTH_CHECK = 'X' MESSAGE_HANDLER = LM_MSG IMPORTING PNNNN_TAB = HRTNNNN_TAB = IS_OK = LD_IS_OK. CATCH CX_HRBAS_VIOLATED_ASSERTION INTO OREF. TEXT = OREF->GET_TEXT( ). WRITE:/ text. CATCH CX_SY_REF_IS_INITIAL INTO OREF. TEXT = OREF->GET_TEXT( ). WRITE:/ text. ENDTRY. IF NOT text IS INITIAL. WRITE / text. ENDIF. LOOP AT P1000. WRITE:/ P1000-OTYPE, P1000-OBJID, P1000-INFTY, P1000-SUBTY. ENDLOOP.
Foreign Key
Source Table | Source Column | Foreign Table | Foreign Column | Dependency Factor | Cardinality left | Cardinality right | |
---|---|---|---|---|---|---|---|
1 | HRP1000 | INFTY | T778T | Â INFTY | KEY | 1 | CN |
2 | HRP1000 | ISTAT | T778S | Â ISTAT | KEY | 1 | CN |
3 | HRP1000 | LANGU | T002 | Â SPRAS | KEY | 1 | CN |
4 | HRP1000 | MANDT | T000 | Â MANDT | KEY | 1 | CN |
5 | HRP1000 | OBJID | PLOGI | Â OBJID | KEY | 1 | CN |
6 | HRP1000 | OTYPE | T778O | Â OTYPE | KEY | 1 | CN |
7 | HRP1000 | PLVAR | T778P | Â PLVAR | KEY | 1 | CN |
Tracking access and maintenance of particularly sensitive infotypes is good practice as part of an overall Governance, Risk and Compliance strategy and can be achieved using infotype audit logs and the infotype logging report.
You configure the PA audit log in the following tables:
- HR Documents: Infotypes with Documents (
V_T585A
) - HR Documents: Field Group Definition (
V_T585B
) - HR Documents: Field Group Characteristics (
V_T585C
).
These tables are displayed via program RPUAUD00 which can be executed using either of the following transactions:
S_AHR_61016380
– Logged Changes in Infotype Data
S_ALR_87014081
– Logged Changes in Infotype Data
PD infotype changes can also be logged by configuring the following table:
Activate Change Documents (T77CDOC_CUST
)
The PD audit log can track changes to infotypes 1000
, 1001
, and 1002
. The results are displayed with program RHCDOC_DISPLAY which does not currently have a standard delivered transaction attached.
More information on the infotype logging report is available in the SAP help.
Process Infotypes
- RMAC Modules –
RMAC
module as referred to Macro, is a special construct ofABAP/4
codes. Normally, the program code of these modules is stored in table ‘TRMAC’. The table key combines the program code under a given name. It can also be defined in programs.TheRMAC
defined in theTRMAC
can be used in all Reports. When anRMAC
is changed, the report has to be regenerated manually to reflect the change. - Reading Infotypes – by using
RMAC
(macro)RP-READ-INFOTYPE
REPORT ZHR00001. INFOTYPE: 0002. PARAMETERS: PERNR LIKE P0002-PERNR. RP-READ-INFOTYPE PERNR 0002 P0002 . 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;
Generally, we get the requirement as in where we have to show details as per the employees ,
wherein we should be showing what is the employees position in the organization and to which org/unit he/she belongs to .
So from PA0001
you may be getting these details in the form of PLANS
(Position) and OEGEH
(Org Unit) , so these numeric values are of no used to be shown, so we need to get the texts for the same.
Hence, you need to have those details and you can get this by selecting the data from HRP1000
or HRP1002
etc .
Let us say you are having employee details selected in.gt_pa0001
If gt_pa0001[] is not initial. Select * from HRP1000 into table gt_hrp1000_position for all entries in gt_0001 where plvar = 'XX' and OTYPE = 'S' and OBJID = gt_0001-plans. Select * from HRP1000 into table gt_hrp1000_org_unit for all entries in gt_0001 where plvar = 'XX' and OTYPE = 'O' and OBJID = gt_0001-orgeh. Endif .
Hence, now you are having the details for position and org units.
Now when you are preparing your final output table you can read these tables and use the information.
The other kind of reporting can be from OM
point of view itself, wherein you need to show details according to the org unit or by positions.
Here you first select data from OM
tables and then pull data from other corresponding tables, getting validated from OM
tables.
Reverse 1001 connection with is delete or insert
Standard SAP Object Types
Object Type | Object Type Code |
---|---|
Organizational Unit | O |
Job | C |
Position | S |
Cost Center | K |
Person | P |
Task | T |
Work Center | A |
Qualification | Q |
SAP P1001 Structure fields within data Dictionary
Field |
Component Type
|
Data Type | length (Decimals) | Check table | Description | Conversion Routine |
MANDT | MANDT | CLNT | 3 |
*
|
Client | |
PLVAR | PLVAR | CHAR | 2 | T778P | Plan Version | |
OTYPE | OTYPE | CHAR | 2 | T778O | Object Type | |
OBJID | OBJEKTID | NUMC | 8 | Object ID | ||
INFTY | INFOTYP | CHAR | 4 | T778T | Infotype | |
RSIGN | RSIGN | CHAR | 1 | Relationship Specification | ||
RELAT | RELAT | CHAR | 3 | T778V | Relationship Between Objects | |
ISTAT | ISTAT_D | CHAR | 1 | T778S | Planning Status | |
PRIOX | PRIOX | CHAR | 2 | Priority | ||
BEGDA | BEGDATUM | DATS | 8 | Start Date | ||
ENDDA | ENDDATUM | DATS | 8 | End Date | ||
VARYF | VARYF | CHAR | 10 | Variation Field for File PLOG | ||
SEQNR | SEQNR | NUMC | 3 | Number of Infotype Record with Same Key | ||
AEDTM | AEDTM | DATS | 8 | Changed on | ||
UNAME | USRNAME | CHAR | 12 | User Name | ||
REASN | REASN | CHAR | 2 | Reason | ||
HISTO | HISTO | CHAR | 1 | Historical Record Flag | ||
ITXNR | ITXNR | NUMC | 8 | Text Module for Infotype | ||
.INCLUDE | HRIP1001 | Infotype-Specific Fields of IT1001 | ||||
SCLAS | SCLAS | CHAR | 2 |
*
|
Type of Related Object | |
SOBID | SOBID | CHAR | 45 | ID of Related Object | ||
PROZT | PROZT | DEC | 5(2) | Weighting Percentage | ||
ADATA | ADATA | CHAR | 600 | Additional Relationship Data |
Example program
LOOP AT it_p1001_del INTO ls_wplog. APPEND ls_wplog TO lt_wplog_tmp. ASSIGN ls_wplog TO CASTING. CALL FUNCTION 'RH_TURN_RELATION' EXPORTING otype = -sclas EXCEPTIONS relation_not_reversible = 1 OTHERS = 2. IF sy-subrc = 0. CALL FUNCTION 'RH_INVERT_RELA_INFTY' EXPORTING p1001_imp = IMPORTING p1001_exp = ls_p1001_invers EXCEPTIONS relation_not_reversible = 1 OTHERS = 2. IF sy-subrc = 0. APPEND INITIAL LINE TO lt_wplog_tmp ASSIGNING . ASSIGN TO CASTING. = ls_p1001_invers. ENDIF. ENDIF. ENDLOOP. it_p1001_del = lt_wplog_tmp. CLEAR lt_wplog_tmp.
Example use Open SQL with infotypes
Use Open SQL
to ask about use job (C) by emplayers.