This action might not be possible to undo. Are you sure you want to continue?
Generally in ABAP the following are done: 1) Table development 2) Date Processing 3) Report developing 4) BAPIs /RFC s 5) Data base update 6) Screens development/enhancement 7) Scripts and smart forms. 8) Function Building 9) Java connectors etc.
The following concepts are defined in ABAP HR which is different with other modules. 1) Use of Infotypes 2) The use of Logical Database 3) Use of Macros and Provide statement 4) Storage and Access of data 5) Authorization checks There is nothing much difference between abap and hr abap. The way we retrieve the data from data base is deferent. In general ABAP data is stored in Tables, but coming to HR ABAP employee data is sorted through Infotypes. The way we retrieve the data from infotypes is deferent in hr abap. In general ABAP we use Logical data base very rare, as in HR ABAP most of the programs use Logical data base to select data from Infotypes by using Get event. In ABAP we use read statement to read particular record, still in HR ABAP we do use read statement apart from that we have Macros and provide statement. Macro is pre defined code (like function module) which reads data from internal table (internal infotype) based on dates. Provide statement is like Select statement but selects data from internal table Storage and access of data in hr abap is completely deferent in hr abap comparing with ABAP. We use transaction code PA20 and PA30 to maintain data in infotypes. PA20 is display mode and PA30 is change mode. We can create, change, display, copy, and delete in Infotypes with PA30 transaction.
fieldname02. Here. like fieldname01.6C). A loop offers a more streamlined method of evaluation. LGA01 BET01 ANZ01 EIN01 OPK01 LGA02 BET02 ANZ02 EIN02 OPK02 Till LGA40 BET40 ANZ40 EIN40 OPK40 wage type40 wage type amount Number Time/Measurement Unit Operation Indicator for Wage Types wage type1 wage type Amount Number Time/Measurement Unit Operation Indicator for Wage Types wage type2 wage type amount Number Time/Measurement Unit Operation Indicator for Wage Types . one line of the repeat structure is evaluated each time the loop is executed As SAP consultant you might know the structures. allows you to enter up to forty different wage types and their amounts. The structure of the wage type line is stored in the Infotype structure P0008. But what is the repetitive structures?. Evaluating Repetitive Structures in SAP HR ABAP Programming In many master data Infotypes. The sentence it self explains that in a structure. By scrolling. and the individual fields are numbered from one to forty. fieldname03 etc For example In Master data Infotypes we have: Infotype 0008 (Basic Pay) Infotype 0025 (Appraisals) Infotype 0041 (Date Specifications) Infotype 0052 (Wage Maintenance) If we look at Infotype 0008 below fields are getting repeated 40 times (Lower versions of SAP only 20 times like 4.For Infotypes authorizations can be maintained infotype and subtype (field) level as HR data is more sensitive and secrete. data is entered in table form. you can enter up to forty wage types. some fields are available multiple times with the sequence number change. for example. This means that each field of the wage type table is defined. This.
My answer is No. Viz. will have internal table (we call as internal Infotype) with header with the structure of associated Infotype. LGA05. For example we need to select basic wage from Infotype 0008 and display in report. LGA02. LGA07.For the above scenario we have multiple wage types for one Personnel number for one particular period. salary non exempt (All these are wage types). Infotypes: when we declare tables at the runtime of program will have work area the same way. the return code PNP-SW-FOUND = 1 is returned. use one of the following statements: RP_PROVIDE_FROM_LAST Pnnnn SPACE PN-BEGDA PN-ENDDA. For the above scenario wage types are stored in LGA01. BET06. LGA04. If the infotype has subtypes. Fields LGART and BETRG are required to read the repetitive structures. replace the SPACE parameter by the appropriate subtype number. We are not sure in which field the basic wage is going to be stored like it might be in LGA01 or LGA02 or LGA03 or LGA04.. are we going to check 40 time IF condition for each field (LGA01 to LGA40). BET04. LGA06. When a record has been successfully read. These statements make the most recent or earliest record in the PN/BEGDA to PN/ENDDA data selection period available in the structure Pnnnn for infotype nnnn. Basic Pay. The example determines the wage type and its amount for particular period. Data declarations: The required data declarations are first made at the beginning of the Report. BET02. and its amount correspondingly BET01. Now as a technical consultant your job starts. House rent allowance. How do you read the data form repetitive structure Infotypes. . conveyance. car allowance. BET05. BET03.. Declare Tables: PERNR and press F8 you will get standard selection screen. We have syntax in ABAP by using that we can achieve out target very easily. when we declare Infotypes. salary exempt. Before going forward if you are new to ABAP HR. special allowance. This is the brief overview about repetitive structures in SAP. not all Infotype records. In this case. Tables: PERNR is used to get the standard selection screen as well work area. LGA03. Here my question is. BET07. Macros: You often only require the most recent or earliest Infotype record. please go through the below Link: SAP ABAP HR Program code using LDB PNP The following Report shows you how to access these data fields.
The logical database and the program check that the input is correct and complete. The sequence in which the data is supplied to the program is determined by a tree structure. In other words. importing files). some fields are made ready for input again. so that the user can make the necessary correction(s).) are performed for the selection screen by the logical database and the program. but also that the user has the appropriate authorizations. etc. . The selection screen is displayed and the user enters data in the input fields. If an error occurs. the ABAP program performs any preliminary work (for ex. Logical databases when generating an ABAP program The selection screen generated contains the selections (SELECT-OPTIONS AND PARAMETERS) of both the logical database and the program.g. How are logical database used 1. In the event START-OF-SELECTION. calculating default values such as key date. The LDB usually consists of the following components: Structure Selections Database programs Logical databases have a tree structure. A logical database can contain a maximum of 300 tables SAPDBPNP is the name of the database program for the logical database PNP. the system processes the events in the program and in the logical database in the following order Before displaying the selection screen. a LDB is a method by which ABAP programs read and process the data. certain initializations (e.What is Logical Database? Logical database in SAP The LDB is special type of ABAP program that combines the contents of certain related database tables and retrieve some related data and make it available to application programs. The only database-specific selections displayed on the selection screen are those needed by the program for data retrieval purposes 2. Logical databases at run-time of an ABAP program At run-time.
g. Any program-specific selections appear after the database selections. If the attributes of a program include the number of its own selection screen. the ABAP program performs any concluding operations (for example.g.. Hourly wage earners in a particular personnel sub area. Screening: Employees can be selected according to the organizational criteria entered on the selection screen. Authorization check: This ensures that the person starting the evaluation Is authorized to access the report data.Active or inactive. The system automatically generates such a screen for each program that does not have its own selection screen entered in the attributes. E. E. Monthly wage earners in a specific personnel sub-area. Person selection defines those employees for whom a report is to be run. In the event END-OF-SELECTION. You cannot delete database selections Functions of LDB: Data retrieval : The personnel data of each employee is loaded into the main memory where it can be accessed for processing. calculating totals.g.. There are two types of screening. E.. When you enter the data selection period. The flow logic for such screens is also generated automatically and therefore cannot be modified. each on a new line. The data selection period delimits the time period for which data is evaluated.The logical database reads the selected data and the program processes it within the GET events according to the sequence specified by the structure.. Features of org. E. Employee status. You can define your own selection screens for any logical database . the provide loop retrieves the infotype records whose validity period overlaps with at least one day of this period. Personnel number range E. exporting files). Assignment Employees who assigned to certain cost center. Designing the selection screens The standard selection screen of a logical database has a standard layout where SELECT-OPTIONS and PARAMETERS appear in the sequence they are declared.g. 3. the system uses this screen as a model when generating.g.Person selection and data selection period.. Logical Data bases in HR ABAP: .
Personnel area is specific to HR and is a four character alphanumeric identification. E. 3. Personnel area 100 is for employees in Karnataka.g. The employee subgroup grouping for the work schedule defines the validity of work schedule. Employee Subgroups: are further differentiated within the employee group. Generate default pay scale type and area for an employee s basic pay. Retired employees. Pension). Personnel areas are subdivided into personnel subareas. Components of PA: Personnel Area: represents a division of a company code into subunits.PNP PNPCE PAP PCH Personnel Administration (PA): PA involves administrating employee data.g. Master Data contains all employee data used in HR processing. Infotypes are tables (for user Data entry screen) that contain logically related employee data. unionized employees. It may represent geographical locations. Data can be stored for specific periods. Contractors. Employee Groups: divides or groups employees into various categories. address).g. so that work schedules. Functions include: 1. 2. commonly referred to Master Data. Employee groups are used to generate default values for payroll accounting area and basic pay. Define public holiday calendar. The employee subgroup grouping for the payroll rule allows you to define different payroll procedures for different employee subgroups. It is an organizational entity representing an area within an organization defined by specific aspects of personnel administration. Organizational (Position description). Eg. substitution and absence and leave types can be setup for individual personnel subareas. 200 is for Chennai. Executives. and the attendance or absence quota type determines the validity of time quotas. Hourly employees. Master Data includes Personal (Eg. . Benefits (Insurance. Salaried employees. E. you can specify whether an employee s pay should be determined on hourly or monthly basis. Master Data is stored in Infotypes. which includes current and historical. Personnel Subarea: is a further subdivision of Personnel area. Set groupings for Time Management. Active employees. For e. Time & Payroll. time management and payroll.
If PNP-SW-FOUND = 1 .Macros in HR-ABAP programming Most commonly used Macros in ABAP-HR ? Macro contains some part of source code which it will be useful for number of applications. The macro RP-PROVIDE-FROM-FRST retrieves the first(start)data record which is valid in the data selection period. It is not necessary to include logical database PNP/PNPCE in your program when you are using the macro like RP-READ-INFOTYPE A B C D E . All the Macros are stored in table TRMAC Whenever you are using the macros like RP-PROVIDE-FROM-LAST or RP-PROVIDE-FROM-FRST. check whether you have included logical database PNP in program attributes. ENDIF. then the operation is successful. then the process is successful. . The macro RP-PROVIDE-FROM-LAST retrieves the last(latest) data record which is valid in the data selection period. IF PN-SW-FOUND = 1. WRITE YOUR CONDITION.( Like function modules ) Generally we use two macros in ABAP-HR or SAP-HR RP-PROVIDE-FROM-LAST RP-PROVIDE-FROM-FRST Ex: RP-PROVIDE-FROM-LAST P0000 SPACE PN-BEGDA PN-ENDDA. where A corresponds to PERNR which describes for which personnel number you require records. For every macro. ( same as sy-subrc but the value is in reverse case) The macro RP-READ-INFOTYPE retrieves all the data record(s) which is valid in the data selection period. whether the operation was successful or not will be checked with PNP-SW-FOUND. If SY-SUBRC = 0 .
D corresponds to Start date.B corresponds to INFOTYPE which describes from which infotype you require records. E corresponds to End date. . C corresponds to data structure of the declared infotype (internal table like P0000 for infotype 0000) where all the records of the particular personnel number will be stored.
This action might not be possible to undo. Are you sure you want to continue?