This action might not be possible to undo. Are you sure you want to continue?
thing specific/different to HRABAP. So when I write statement INCLUDE or TABLE, I will not explain the meaning of it, rather I will more concentrate on the syntax uncommon to ABAP but required in HR-ABAP. Logical database PNP can be activated/used by specifying it in program attributes in SE38. We use logical database in HR ABAP to retrieve data. It fulfill three main function: 1. Logical database take care of the relation between the infotypes and retrieve correct information for you for each employee. You don’t have to worry about the primary key and foreign key extra. 2. It provides you a consistent selection screen and automatic screening of data based on the input by user on selection screen. 3. Last but not the least is implicit authorization check. Authorization issue is taken care by logical database centrally. This how a selection screen will look when you use logical database PNP (by default).
Consider following piece of code…
The INFOTYPE nnnn statement creates an internal table with the name Pnnnn for each declared infotype. When the GET event occurs, the tabke of declared infotypes are filled with all of the record that exist for personnel number. The field PERNR-PERNE contains the personnel number. When the GET event occurs, all internal infotype tables are filled. Therefore, only declare the infotypes you wish to process. PROVIDE..ENDPROVIDE statement loops at all records of P0002 whose validity period overlaps the period selected in selection-screen. Selection-screen period is stored in PN-BEGDA and PN-ENDDA. PN Structure is defines in include DBDPNPCOM.
For example, if you choose current year in selection-screen, PN-BEGDA contains the first day of the year and PN-ENDDA contains the last day of the year. If you do not enter any data for the period in selection screen , PN-BEGDA contains the low date (01-01-1800) and PN-ENNDA contains the high date (31-129999) . PROVIDE.. ENDPROVIDE can be replaced by LOOP.. ENLOOP statement, however PROVIDE.. ENDPROVIDE offer a wide variety of options.
For example, if the infotype you are processing contains subtype then you must include WHERE option in PROVIDE..ENDPROVIDE. In below example, processing of the infotype Address (0006) is restricted to subtype 1 (Permanent Address).
Frequently, you only want to display employees with data of specific infotype. In this case use the CHECK LINES(Pnnnn) statement to determine the number of filled line of an infotype table. See screen-shot below.
PROVIDE..ENDPROVIDE provides data for a specific period, that is according to the data selection period. In case more than one data exist for a specific period, only most recent or olderstinfotype record is required from the selected period, rather than all of the records. The RP_PROVIDE_FROM_LAST and RP_PROVIDE_FROM_FRST macro can be used in such situation. Once again consider the selection-screen of a typical HR-ABAP report.
Selection-screen is divided in two parts namely period and personal selection. Person selection is used to determine a group of employees for whom an evaluation takes place. For example, all of the monthly wage earners in a particular personnel subarea. The selection screen enables you to change the sort sequence for HR records. The data from the start and end dates of the data selection period is transferred to fields PN-BEGDA and PN-ENDDA. If you use a data selection period, infotype data records are entered in the PROVIDE loop of their validity periods overlap with the period selected by at least one day. The start and end dated of the person selection period that are entered by the use are available in the field PN-BEGPS and PN-ENDPS. This interval is the criterion used for selecting personnel number to be processed. All personnel numbers that fulfill the selection criteria specified at any given time in the person selection period entered by the user are used in processing. If the period is specified using radio button, the fields PN-BEGDA/ENDDA and PN-BEGPS/ENDPS contains the same period. All the selection-screen parameters define in report will appear after these two blocks. All the fields are defined in include DBPNPSEL; as usual initial values can be set in INITIALIZATION event.