0% found this document useful (0 votes)
998 views

PNPCE Logical Database

The PNPCE logical database supports the evaluation of HR master data. It includes the functions of the PNP logical database and offers additional evaluation options. The new events 'GET PERSON' and 'GET GROUP' as well as an enhanced syntax for the INFOTYPES statement enable you to use the new functionality.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
998 views

PNPCE Logical Database

The PNPCE logical database supports the evaluation of HR master data. It includes the functions of the PNP logical database and offers additional evaluation options. The new events 'GET PERSON' and 'GET GROUP' as well as an enhanced syntax for the INFOTYPES statement enable you to use the new functionality.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

SAPDBPNPCE - PNPCE Logical Database: Database Program

http://www.consolut.com/en/s/sap-ides-access/d/s/doc/D-SAPDBPNPCE TXBHW - Original Tax Base Amount in Local Currency RFUMSV00 - Advance Return for Tax on Sales/Purchases This documentation is copyright by SAP AG.

Purpose
The PNPCE logical database supports the evaluation of HR master data. It includes the functions of thePNP logical database and offers additional evaluation options. Therefore, you should use the PNPCE logical database instead of the PNP logical database for all new developments. The enhanced functionality of PNPCE in comparison to PNP essentially concerns the evaluation of ConcurrentEmployment, that is, the possibility to group evaluate several assignments/personnel numbers of a person.The new events 'GET PERSON' and 'GET GROUP' as well as an enhanced syntax for the INFOTYPES statement(addition AS PERSON TABLE) for the procurement of infotype data enable you to use the new functionality.The use of these new functions is optional. You can run a PNPCE report that does not use the new eventsand the addition for the INFOTYPES statement in a PNP-compatible session. Since the PNPCE also has animproved selection screen, each report benefits from this even if the report does not use the functions for evaluating Concurrent Employment.

Prerequisites
A report that wants to use the PNPCE must enter this in its report attributes under Logical database. In addition, the PERNR structure must be declared in the report using the 'TABLES PERNR' statement.You can only use the PERNR structure again in certain circumstances. The use of the 'GET PERNR' eventis therefore forbidden. Instead, use the 'GET PERAS' event. Except for the PERNR-PERNR component, allother components of the PERNR structure are no longer filled and have initial values. This kind of programming (with the exception of PERNR-PERNR) is therefore not permitted. In addition to the 'GET PERAS' event, you can also use the 'GET PERSON' and 'GET GROUP' events. To beable to use these events, you must declare them using the NODES statement ('NODES PERSON', 'NODES GROUP', or 'NODES PERAS'). Explanation of Terms If the 'GET PERSON' and 'GET GROUP' events and the 'AS PERSON TABLE' addition for the INFOTYPES statementare not used, the report indicates that it does not require the functionality for evaluating ConcurrentEmployment. In this case, the report runs in a PNP-compatible session. This is referred to as PNPmode in the following documentation. On the other hand, if the report uses the functionality for evaluating Concurrent Employment we refer to CE mode.

Features
Process of an Evaluation
The PNPCE selection screen offers you as standard a range of functions that you can use to restrictthe personnel number and person selection. These are discussed in more detail in the following sections.The process is initially as follows regardless of whether the report runs in CE or PNP mode. All availablefunctions and selection conditions leads to the selection of personnel numbers. If you use the sortingfunction, this set of personnel numbers is then sorted according to the sort criteria you selected. In PNP mode, the GET PERAS event is triggered as a result for each personnel number.

In CE mode, the persons belonging to the personnel numbers are determined first for all personnel numbersselected. The GET PERSON event is then triggered for each person. The person ID is specified in theOBJID component of the PERSON structure. PERNR_NUM contains the total number of personnel assignments(= personnel numbers) that this person has and the ALL_PERNRS table, which contains a list of thesepersonnel numbers regardless of whether they were actually selected or not. The SELECTED flag is setto X for the personnel numbers selected. The flag is initial for all personnel numbers that are notselected. The PROCESS flag specifies whether the personnel number should be processed in the rest ofthe process. This flag is set to X by default for the personnel numbers selected. However, the reportcan set or delete this flag at the GET PERSON event for all personnel numbers. In this way, report and logical database communicate with each other which enables the report to control the rest of the process. In the next step, the logical database groups all personnel numbers of a person that are to be processed(that is, all personnel numbers that have the PROCESS flag set). The report can control the type ofgrouping using the PNPCE_GROUPING_FROM_PAYROLL flag (normal or payroll grouping) and using the PNPGPRSN(grouping reason) and PNPGPVAL (grouping value) parameters of the selection screen. The GET GROUP eventis triggered for each group of personnel numbers determined. The GROUPING_REASON and GROUPING_VALUEcomponents contain the grouping reason and grouping value of this group. The number of personnel numbersthat belong to this group and that are processed subsequently is in PERNR_NUM. The included ALL_PERNRtable contains a list of these personnel numbers with additional information. The SELECTED flag specifieswhether the current personnel number was originally selected (flag is set) or was marked by the reportas to be processed. GROUPING_BEGDA and GROUPING_ENDDA contain the validity period that the personnelnumber has for this grouping. The NO_AUTHORITY flag is set if there is insufficient authorization fora personnel number. This personnel number is not processed further. The SORT component defines a standardsort order for the personnel numbers of a group. The report can change this by overwriting the values.In this way, report and logical database communicate with each other, which controls the further processing sequence of the personnel numbers. The GET PERAS event is then triggered for all personnel numbers of the group (with the exception ofthe personnel numbers for which no authorization exists) in the sequence defined by the SORT component(see above). The SELECTED, GROUPING_BEGDA, and GROUPING_ENDDA components have the same meaning hereas with the GET GROUP event. The PROCESSED_BEFORE flag specifies whether the personnel number has alreadybeen processed once before (it is possible that the personnel number belongs to several groupings and has been therefore been processed several times). Sort Order You can sort the list of selected personnel numbers using the Sort function in the application toolbar.You can choose to include up to seven fields from infotype 0001 for the sort. Since several data recordscan exist for infotype 0001 for a personnel number, you also need to specify for period evaluations(not the case for key date evaluations) whether the sort should take place according to the values of the last or of the first data record in the person selection period. In PNP mode, the sorted sequence determines exactly the sequence in which the GET PERAS event is called.In CE mode, the sort determines the sequence in which the GET PERSON event is called. The list of personsis created based on the (sorted) sequence of personnel numbers. If only one person exist for each selectedpersonnel number, the sequence of persons corresponds exactly to the sequence of personnel numbers.However, if several selected personnel numbers lead to the same person, only the first personnel numberdetermines the sort sequence of persons. All other personnel numbers only determine the sequence inwhich the GET PERAS event is subsequently called. Provided that the report does not require the personnelnumbers to be resorted by manipulating the SORT component at the GET GROUP event (see above), the GETPERAS event is called for the personnel numbers of a person in the sequence in which the personnel numbers were (originally) sorted.

Retrieving Infotype Data Records

As well as triggering the GET PERSON, GET GROUP, and GET PERAS events, the logical database also providesthe data records of the infotypes that are requested using the INFOTYPES statement. In the report, youmust specify the INFOTYPES statements where the variable declarations are made. You should do this in any case before the first code is entered. In principle, there are three types of INFOTYPES statements: INFOTYPES nnnn The nnnn infotype is provided with the data records of the current personnel number at the GET PERASevent. Only the data records that are in the evaluation period specified in the selection screen areprovided ( this is different to PNP, which provides all data records by default). Alternatively, thereport can specify which data records are to be provided using the RP_SET_DATA_INTERVAL, RP_SET_DATA_INTERVAL_INFTY, and RP_SET_DATA_INTERVAL_ALL macros. INFOTYPES nnnn AS PERSON TABLE The nnnn infotype is provided at the GET GROUP event with the data records of all personnel numbersthat are in the included ALL_PERNRS table (of the GROUP structure) and for which authorization exists(NO_AUTHORITY flag is not set). Only the data records that are in the evaluation period specified inthe selection screen are provided. Alternatively, the report can specify which data records are to be provided using the RP_SET_DATA_INTERVAL, RP_SET_DATA_INTERVAL_INFTY, and RP_SET_DATA_INTERVAL_ALL macros. INFOTYPES nnnn AS PERSON TABLE MODE P The nnnn infotype is provided at the GET PERSON event with the data records of all personnel numbersthat are in the included ALL_PERNRS table (of the PERSON structure). No authorization check is performedand all existing data records are provided independent of how the evaluation period is defined in theselection screen. The use of the RP_SET_DATA_INTERVAL, RP_SET_DATA_INTERVAL_INFTY, and RP_SET_DATA_INTERVAL_AL macros also has no influence here.

Selection Options
You can use all the functions and selection options in the selection screen (initially) to select personnelnumbers regardless of whether the report is running in PNP or CE mode. Only in CE mode, the personsbelonging to these personnel numbers are then determined. The functions that PNPCE provides to restrictthe selection are described in the following. The environment in which these functions are actuallyused depends on the report and its report category. You can assign a report category to a report inmaintenance of report attributes (SE38, Attributes, Change button -> HR report category button). The customer can override this assignment. To do so, perform theAssign Report Categories Customizing activity under'Personnel Management' -> 'Human Resources Information System' -> 'Reporting' -> 'Adjusting the Standard Selection Screen'. Follow the same path to define and change report categories in theCreate Report Categories Customizing activity. Sincethe PNP logical database also uses the concept of report categories, ensure that you assign only one report category that is created specially for the PNPCE database to a PNPCE report. Selection Fields of the 0000 and 0001 Infotypes You can use all the standard fields of the 0000 and 0001 infotypes for selection. You can also use additionalselection fields that are the concatenation of two or more of these infotype fields. If possible, donot use these concatenated fields because they do not play a significant role in the selection and canlead to long runtimes in certain circumstances. You can show and hide the required selection fieldsusing the Selection Fields function in the application toolbar. The report category defines a preselection of fields that should be available. Dynamic Selections

The dynamic selections enable you to select according to any infotype fields and, in particular, accordingto customer-specific infotype fields. You can show and hide the dynamic selections using the DynamicSelections function in the application toolbar. The report category controls whether this appears asa dialog box or inplace, that is whether the dynamic selections are supported at all. The basis forthe dynamic selections is a selection view that defines which infotypes and which fields can be usedfor selection. You can define the selection view in the ABAP Workbench. You must choose For any tableas the type of selection view (the For logical database type is not permitted although you may havepresumed differently at first). The report category is used to control which selection view is usedfor the dynamic selections. If you use the dynamic selections, the Restrict by OrgStructure, Search Help, and Selection ID functions are not available. Restrict by OrgStructure You can also select personnel numbers by their position in the organizational structure. To do so, youuse the OrgStructure function in the application toolbar. This button displays the organizational structure.Here you can select the organizational units to which the personnel numbers to be selected should belong.It is insignificant if the personnel numbers are assigned to the selected organizational unit directlyor to one of its subordinate organizational units. If you restrict the selection by organizational structure, the Dynamic Selections, Search Help, and Selection ID functions are not available. Search Help You can use the included search helps of the PREM collective search help by clicking Search Help functionin the application toolbar. You can also add customer-specific search helps here. For a description of how to do this, see the Customizing for Personnel Management -> Personnel Administration -> Basic Settings ->Maintain Search Helps. If you use a search help, the Dynamic Selections, Restrict by OrgStructure, and Selection ID functions are not available. Selection ID You can also restrict the number of personnel numbers to be selected using a predefined selection method called a Selection ID. For information on how to use and create selection IDs, see theDefine Selection IDs Customizing activity under 'Personnel Management' -> 'Human Resources Information System' ->Define Selection IDs. How youSpecify Groupings of selection IDs is also describedhere. The selection IDs whose grouping is stored in the report category are available to you for selectionon the PNPCE selection screen. When you select a selection ID, it is always performed. This happenseither explicitly when you press the button (behind the selected selection ID), or implicitly when outputstarts (F8). If you use a selection ID, the Dynamic Selections, Restrict by OrgStructure, and Search Help functions are not available. Evaluation Period The PNPCE (and the PNP) differentiates between the data selection periodand the person selection period. Both these periods are summarizedin the term evaluation period. Whereas the person selection periodaffects the selection of personnel numbers, the data selection period controls the retrieval of datarequested by the INFOTYPES statement. You can configure both separately on the selection screen by selectingan appropriate entry in each list box. Alternatively, you can set up both selection periods at the sametime using a common list box. You can control which entries are in the list boxes (that is which evaluationintervals are supported) using the report category. The person selection period you have set up is takeninto consideration when the personnel numbers are selected. Only the personnel numbers are selectedthat fulfill the selection conditions on at least one (key) date in the specified person selection period.All data records of the requested infotypes that are valid on at least one (key) date in the specifieddata selection period are retrieved by default for these personnel numbers. You can set up a differentprocedure using the RP_SET_DATA_INTERVAL, RP_SET_DATA_INTERVAL_INFTY, and RP_SET_DATA_INTERVAL_ALL macros.Retrieving data records for infotypes that were defined by the AS PERSON TABLE MODE P addition is an exception. In this case, all data records are retrieved independent of the data selection period.

The payroll period should be considered as a special feature for the evaluation period. You can selecteither the current payroll period or another payroll period. You must enter the payroll area in bothcases. The evaluation period is calculated from these specifications. This interval is used as evaluation period (as person selection period and as data selection period) for the further (internal) processing. The report can query the evaluation period used via the PN structure. The BEGDA and ENDDA contain thedata selection period whereas BEGPS and ENDPS contain the person selection period. Inversely, the reportcan also set the data and person selection period explicitly. The report must also fill the relevantcomponents of the PN structure at the START-OF-SELECTION event. This is only meaningful if the manual maintenance of the evaluation period was hidden using the report category.

Communication Between Report and PNPCE


The DBPNPCECOM include is an element of the PNPCE logical database. This is automatically included ineach report that is based on PNPCE. The common part defined in this include means that the report andPNPCE have a common data area. This data area enables the data exchange for communication between thereport and PNPCE. All switches that can be used by the report to control the process of PNPCE are definedhere. The DBPNPCECOM include also contains a number of macros that PNPCE uses to make additional functionsavailable to the report. Most of these macros were adopted by PNP and defined there in the DBPNPMACinclude. Additional macros still exist in the TRMAC table, which has in the meanwhile become obsolete.Do not use these macros for any purpose. You can find all the macros defined in PNP that affect thefunctionality of the logical database in the DBPNPCECOM include. They have a slightly different spelling;underscore_ instead of hyphen-, for example RP_PROVIDE_FROM_LAST instead of PROVIDEFROM-LAST. Someof the TRMAC macros in the DBPNPCECOM include were redefined with the same spelling but without the functionality so that any incorrect use (of the TRMAC macros) leads to a syntax error and is therefore excluded. The following describes the functions made available by the switches and macros defined in the DBPNPCECOMinclude. For information about the exact syntax for calling a macro in view of its parameters and type specifications, see the definition of the macro in the DBPNPCECOM include. Evaluation Period in the PN Structure The PN structure contains information about the evaluation period for which the evaluation is startedregardless of how this is specified on the selection screen. A report should access the fields of thePN structure only if it requires this information and should not access the PNPBEGDA, PNPENDDA, and other selection fields of the selection screen. The PN-BEGPS and PN-ENDPS fields contain the person selection period for which the personnel numberselection was performed. The PN-BEGDA and PN-ENDDA fields contain the data selection period. If youhave specified the evaluation period using a payroll period, PN-PABRP contains the payroll period, PNPABRJ the payroll year, and PN-PERMO the period parameters. The payroll period and payroll year are also in PN-PAPER. The report can also fill the PN-BEGDA, PN-ENDDA, PN-BEGPS, and PN-ENDPS fields with values at the START-OF-SELECTIONevent and in doing so, specifies the evaluation period. In cases like this, it is not meaningful tohave this setting option on the selection screen and it should therefore be hidden using the reportcategory. In addition, the report must ensure that the values specified are valid since there is no longer a validation of these values. Setting the Data Selection Period: RP_SET_DATA_INTERVAL, RP_SET_DATA_INTERVAL_INFTY, RP_SET_DATA_INTERVAL_ALL The report uses the INFOTYPES statement to request infotype data records that are read and made availableby PNPCE. The report can specify that it only requires data records that are valid in the specifiedperiod using the 'VALID FROM .. TO ..' addition. Unfortunately, you cannot use the 'VALID FROM .. TO..' addition in most

cases because it does not accept dynamic date specification. It only accepts constants.If you do not use the 'VALID FROM .. TO ..' addition, PNPCE returns all data records that are in thespecified data selection period on the selection screen by default. If this is not required, the reportcan call the RP_SET_DATA_INTERVAL, RP_SET_DATA_INTERVAL_INFTY, and RP_SET_DATA_INTERVAL_ALL macros torestrict the infotype data records to a different validity period. The RP_SET_DATA_INTERVAL macro setsthe validity period for an individual infotype whose name you specify in the first parameter. Do notconfuse the name of the infotype, P0001 or PP0001 for example, with the number of the infotype 0001.You specify the validity period in the second and third parameters. You should use the RP_SET_DATA_INTERVAL_INFTYmacro in the same way but instead of entering the name in the first parameter, enter the number of theinfotype. Since the same infotype can be used several times (under different names) when you use theINFOTYPES additions 'AS PERSON TABLE' or 'NAME ...', this macro sets the validity period for all infotypesof the same number. In contrast, the RP_SET_DATA_INTERVAL_ALL macro only has the validity period as a parameter and sets this for all infotypes used. Setting the Mode of an Infotype: PNP_SET_INFTY_MODE_BY_NAME, PNP_SET_INFTY_MODE_BY_NUMBER The INFOTYPES statement can use the MODE addition to control whether the infotype should be processedand how this should proceed. If the addition is not used, this corresponds to a MODE Y and the PNPCElogical database reads the infotype and places it in the internal infotype table. MODE N enables theinternal infotype table to be declared but no infotype data records are read by the PNPCE logical database.MODE P can only be used together with the 'AS PERSON TABLE' addition and causes all infotype data recordsof all personnel numbers of a person to be read at the GET PERSON event without authorization checkor period restriction. The report can use the PNP_SET_INFTY_MODE_BY_NAME and PNP_SET_INFTY_MODE_BY_NUMBERmacros to change the MODE specified by the INFOTYPES statement (dynamically) at runtime. The macrosmust be called at the INITIALIZATION or START-OFSELECTION events. The PNP_SET_INFTY_MODE_BY_NAME macrosets the MODE for an individual infotype whose name you specify in the first parameter. Do not confusethe name of the infotype, P0001 or PP0001 for example, with the number of the infotype 0001 You shoulduse the RP_SET_INFTY_MODE_BY_NUMBER macro in the same way but instead of entering the name in the firstparameter, enter the number of the infotype. Since the same infotype can be used several times (underdifferent names) when you use the INFOTYPES additions 'AS PERSON TABLE' or 'NAME ...', this macro sets the MODE for all infotypes of the same number. Reading Time Management Infotypes: RP_READ_ALL_TIME_ITY, RP_READ_ALL_PERSON_TIME_ITY Time management infotypes (2000-2999) often contain a large number of data records, particularly ifpositive recording is implemented. If a dataset that is too large is requested using the INFOTYPES statements,this can lead to performance problems or in an extreme case, to memory overflow. For this reason, thereare the RP_READ_ALL_TIME_ITY and RP_READ_ALL_PERSON_TIME_ITY macros, which can be used to read timemanagement data in a targeted manner. The time management infotypes are defined by the INFOTYPES statementwith the MODE N addition. This enables the internal infotype table to be declared but no data is read(at the moment) by the PNPCE logical database. The report can then decide at the GET GROUP and GET PERASevents whether it wants to read the time management data and for which period. At the GET GROUP event,the report can call the RP_READ_ALL_PERSON_TIME_ITY macro to read all time management data on the personnelnumbers of a person that should be processed. In other words, the time management data that is in theincluded ALL_PERNRS table of the GROUP structure. The data is then written to the infotypes that were declared by the INFOTYPES statement with the AS PERSON TABLE addition. However, at the GET PERAS event, the report can call the RP_READ_ALL_TIME_ITY macro to read the timemanagement data on the current personnel number. In both cases, you must specify the period in whichthe data records should be valid when the macro is called. The PNP-SW-IGNORELOCKEDRECORDS switch isalso taken account of in both cases and controls whether locked data records are read or not. In addition,an authorization check is performed for all data records. If no authorization exists for a data record,this data record is rejected (that is, it is not placed in the infotype table). If data records arerejected because of missing

authorization, the PNP-SW-AUTH-SKIPPED-RECORD global switch is set to 1. This switch is otherwise set to 0. Locked Data Records: PNP-SW-IGNORELOCKEDRECORDS In HR master data maintenance, you can lock individual infotype data records. These data records arenormally ignored during evaluations using PNPCE. If you set the PNP-SW-IGNORELOCKEDRECORDS switch toN (at the INITIALIZATION or START-OF-SELECTION events), the report can however instruct PNPCE to read locked data records too. Authorization Check: PNP_SW_SKIP_PERNR, PNP_GET_AUTH_SKIPPED_PERNRS The PNPCE logical database performs an authorization check for all infotype data records that are requestedby the report using the INFOTYPES statement. If no authorization exists for even one individual datarecord of one of the infotypes used, processing of the personnel numbers is terminated by default. InPNP mode, this means that the GET PERAS event (for the personnel number) is skipped. The report is onlyaware of this if it then (if possible at the END-OF-SELECTION event) calls the PNP_GET_AUTH_SKIPPED_PERNRS macro, which returns a list of the skipped personnel numbers. In CE mode, the NO_AUTHORITY flag is set in the included ALL_PERNRS table at the GET GROUP event, whichindicates to the report that no authorization exists. The following event, GET PERAS, is also not executedfor this personnel number. As in PNP mode, the report can get a list of the personnel numbers for which no authorization exists using the PNP_GET_AUTH_SKIPPED_PERNRS macro. You can enter different settings using the PNP_SW_SKIP_PERNR switch. If you set this switch (at theINITIALIZATION or START-OF-SELECTION events) to N, no more personnel numbers (without authorization)are skipped. Only the data records for which no authorization exists are rejected (that is, not made available). The report has no way of knowing that data records are being withheld from it. Mass Access By Array-Fetch: PNPCE_ARRAY_FETCH_SIZE The infotype data records are not read for each personnel number individually but in a mass access forseveral personnel numbers simultaneously. This reduces the number of database accesses and performancecan be considerably improved. You cannot read the infotype data records of all personnel numbers atonce since this can lead to problems with memory space depending on the number of selected personnelnumbers and existing data records. For this reason, the personnel numbers are segmented into blocksof a fixed size and the personnel numbers of a block are always read together. The size of the blockis set to 100 by default (this means that the personnel numbers from 100 persons are processed at thesame time). The report can change this setting using the PNPCE_ARRAY_FETCH_SIZE switch at the INITIALIZATIONor START-OF-SELECTION event. Be very careful if you change this value. If the value is set too high,it can lead to a memory overflow. If the value is too low, performance is affected. You must choose a suitable value based on the number of requested infotypes and their expected datasets. Locking Persons/Personnel Numbers By default, the logical database does not lock any personnel numbers or persons. However, the reportcan request this. In CE mode, the report must set the PNPCE_ENQUEUE_PERSONS switch to X. This enablesthe LDB to set locks for all personnel numbers of a person. The person is regarded as locked and isprocessed further only if all personnel numbers have been successfully locked. Otherwise, they are skipped.It is the reports task to remove this lock. To do so, the report calls the PNPCE_DEQUEUE_PERSON macroby specifying the person ID. Persons that could not be locked and were skipped are logged by the logicaldatabase. After processing has finished, the report can query this list using the PNPCE_GET_ENQ_FAILED_PERSONSmacro. However, not all persons are logged, only the first N persons. The report can find out how manythis is exactly using the PNPCE_LOG_ENQ_FAILED_PERSONS switch. 1 means that all persons should be logged.If the report calls the PNPCE_GET_ENQ_FAILED_PERSONS macro, the total number of skipped persons is returned with the first N logged persons.

In PNP mode, individual personnel numbers can be locked. The report (and PNP) must set the PNP-SWENQUEUPERNRswitch to Y to enable this. The report is here also responsible for unlocking the personnel numbersand can call the PNP_DEQUEUE_PERNR macro for this by specifying the personnel number. The report canget a list of the personnel numbers that could not be locked by calling the PNP_GET_ENQ_FAILED_PERNRSmacro. Only the first N personnel numbers and the total number of skipped personnel numbers are returned.The number of personnel numbers that should be logged can be specified using the PNP_LOG_ENQ_FAILED_PERNRS switch. 1 means that all personnel numbers should be logged. Determining the First Data Record in the Period: RP_PROVIDE_FROM_FRST The RP_PROVIDE_FROM_FRST macro analyzes the infotype data records that were transferred in an internaltable to the macro with regard to the specified period. It places the first data record that is validin the specified period (the data record with the lowest ENDDA) in the header of the internal table.If no data record exists in the specified period, the PNP-SW-FOUND global switch is set to 0. Otherwiseit has the value 1. If the infotype contains subtypes, you also need to specify the subtype for whichthe last valid data record should be determined. If you do not specify the subtype, the result is undefined.In addition, the data records of the internal table must be sorted according to primary key. The datarecords are sorted if the data records were determined by PNPCE logical database using the INFOTYPESstatement. Analyze the implementation of the macro if the exact functions of the macro are unclear. If in doubt, do not use the macro. Instead implement a suitable solution for the report in question. Determining the Last Data Record in the Period: RP_PROVIDE_FROM_LAST The RP_PROVIDE_FROM_LAST macro analyzes the infotype data records that were transferred in an internaltable to the macro with regard to the specified period. It places the last data record that is validin the specified period (the data record with the highest ENDDA) in the header of the internal table.If no data record exists in the specified period, the PNP-SW-FOUND global switch is set to 0. Otherwiseit has the value 1. If the infotype contains subtypes, you also need to specify the subtype for whichthe last valid data record should be determined. If you do not specify the subtype, the result is undefined.In addition, the data records of the internal table must be sorted according to primary key. The datarecords are sorted if the data records were determined by PNPCE logical database using the INFOTYPESstatement. A special feature of infotypes with time constraint 3 in this case is that the data recordwith the highest ENDDA is not necessarily returned, but the first data record (if it exists) that isvalid on the end date of the specified period. Analyze the implementation of the macro if the exactfunctions of the macro are unclear. If in doubt, do not use the macro. Instead implement a suitable solution for the report in question. Reading Infotypes: RP_READ_INFOTYPE The RP_READ_INFOTYPE macro reads the data records of an infotype for the specified personnel numbersthat are valid in the specified period, and writes these to the internal table specified. This tablemust be completed correctly. If no data records exist in the specified period, the PNP-SW-FOUND globalswitch is set to 0. Otherwise it has the value 1. In addition, an authorization check is performed forall data records. If no authorization exists for a data record, this data record is rejected (that is,it is not placed in the internal table). If data records are rejected because of missing authorization,the PNP-SW-AUTH-SKIPPED-RECORD global switch is set to 1. This switch is otherwise set to 0. The PNP-SW-IGNORELOCKEDRECORDSswitch is also taken account of when the data records are read and controls whether locked data records are read or not. Normally, infotypes are read using the HR_READ_INFOTYPE function module. The RP_READ_INFOTYPE macrocan improve performance when the data records have already been read by PNPCE and are in the internalbuffer. PNPCE only read the data records that were requested by the report using the INFOTYPES statement.In addition, the buffer is deleted again at the latest after 100 processed personnel numbers. If howeverthe report requests the data records using an INFOTYPES statement, it is not particularly meaningfulto request the data records again for the same personnel number using the RP_READ_INFOTYPE macro. Thebuffer is only useful when the data records are called for a different personnel number if these

personnelnumbers belong to the block of the 100 current buffered personnel numbers. Always weigh up the advantages of this macro against the consequences of its use for performance. Excluding Withdrawn Employees: RP_SEL_EIN_AUS_INIT If this macro is called at the INITIALIZATION event, only personnel numbers are selected that do nothave the status withdrawn in the specified person selection period. From a technical point of view,the select option PNPSTAT2 (STAT2 from infotype 0000) is filled with ' 0' for this. This is a defaultvalue for the selection condition displayed on the selection screen that the user can change or delete at a later date. Progress Indicator: PNPCE_NO_PROGRESS_INDICATOR, PNPCE_PROGRESS_BLOCK_SIZE The PNPCE logical database uses the standard technique of displaying processing progress (process indicator).If the report wants to set up its own progress indicator or does not want to have a progress indicatordisplayed, it can switch this indicator off by setting the PNPCE_NO_PROGRESS_INDICATOR switch to X.The PNPCE_PROGRESS_BLOCK_SIZE switch enables the report to control how often (that is, after how manyprocessed persons) the progress indicator should be updated. If the progress indicator is updated too often, performance suffers. Payroll Grouping: PNPCE_GROUPING_FROM_PAYROLL If you set the switch to X, the grouping of personnel numbers (as returned at the GET GROUP event) should be performed on the basis of payroll data. Personnel Numbers Skipped Due to Error: PNP_GET_ERR_SKIPPED_PERNRS A special logic for determining data records is implemented in PNPCE for certain infotypes. This isperformed using a function module (HR_COST_DISTRIBUTION_GET) for infotypes 0027 and 0266. In the caseof an error, the function module can trigger an exception. PNPCE reacts to an exception by terminatingprocessing of the personnel numbers for which the error occurred (that is, the PUT PERAS event is nottriggered). If the report wants to know which personnel numbers were skipped due to this error, it can call the PNP_GET_ERR_SKIPPED_PERNRS macro.

Comments
Headers of Infotype Tables PNPCE fills the table body with infotypes defined by INFOTYPES. It does not fill headers. These areinitialized. Therefore, it is not permitted to program headers. This is in part different in the PNPlogical database. In certain cases, the header is also filled but in many cases it is not filled. Sincethis depends on various factors, which, in particular, cannot be traced or controlled by the report, you are also not permitted to program headers. Infotype Administration Table $RINFO$ In the $RINFO$ table, infotypes are managed that the report defines using the INFOTYPES statement. Itis defined in the DBPNPCECOM include so that the report also has access to this table. You are forbiddento manually modify this table for the purpose of changing infotype characteristics by the report. Instead,use the macros that enable you to set the infotype characteristics (set the MODE by PNP_SET_INFTY_MODE_BY_NAMEand PNP_SET_INFTY_MODE_BY_NUMBER; set the validity period by RP_SET_DATA_INTERVAL, RP_SET_DATA_INTERVAL_INFTY, and RP_SET_DATA_INTERVAL_ALL). Starting a PNPCE Report Using Preselected Personnel Number Set/Person Set

You can also start a PNPCE report using an externally predefined personnel number set. You must providethe PNPINDEX parameter with the relevant personnel number when you call the report using SUBMIT. Since,technically speaking, the select option for PNPINDEX is hidden, you must specify the personnel numbersin a RANGE structure that consists of SIGN, OPTION, and LOW. For each personnel number, SIGN must containthe value I, OPTION the value EQ, and LOW the personnel number. For SUBMIT, the range table should be transferred to PNPINDEX by the IN operator. Example: RANGES: pernr_index FOR pernr-pernr. CLEAR pernr_index. pernr_index-sign = 'I'. pernr_index-option = 'EQ'. pernr_index-low = '00000815'. APPEND pernr_index. SUBMIT pnpce_report WITH pnpindex IN pernr_index. If a set of personnel numbers is defined in this way, you cannot use the Dynamic Selections, Restrictby OrgStructure, Search Help, and Selection ID functions to (further) restrict the set of personnel numbers. However, the conditions entered for the selection fields of infotypes 0000 and 0001 are taken into account. Similarly, you can start a PNPCE report with a specified set of persons. You must provide the PNPPERIDparameter with the relevant person IDs when you call the report using SUBMIT. Unlike PNPINDEX, PNPPERID is not a range but is an internal table whose row type is the PERSONID data element. Example: DATA: personid_index TYPE STANDARD TABLE OF personid. APPEND '00000815' TO personid_index. SUBMIT pnpce_rerpot WITH pnpperid = personid_index. If a set of persons is defined in this way, you cannot define a set of personnel numbers (using PNPINDEX)at the same time. Also in this case, you cannot use the Dynamic Selections, Restrict by OrgStructure, Search Help, and Selection ID functions to (further) restrict the set of personnel numbers. Using Several Selection Options Simultaneously In addition to selecting fields of infotypes 0000 and 0001 as described above, PNPCE offers six otheroptions for selecting personnel numbers. They are selection using dynamic selections, using organizationalstructure, using search help, using selection ID, and by explicitly specifying a personnel number setin PNPINDEX or a person set in PNPPERID when you call the report. These six options exclude each other,that is you can only use one of these options at a time. Appropriate queries on the selection screenattempt to ensure this. It can happen in certain cases, however, that more than one of these functionsis used (for example, when you call the PNPCE report by explicitly specifying a personnel number setin PNPINDEX as well as one of the variants to be used in which dynamic selections were also stored).In this case, only one function, which is the first function used, is taken into account with regard to the following sequence: 1. Dynamic Selections

2. 3. 4. 5. 6.

Restrict by OrgStructure Search Help Selection ID Explicit Specification or Personnel Numbers in PNPINDEX Explicit Specification or Persons in PNPPERID

The personnel number set found this way is always restricted further by the selection conditions specified in the 0000 and 0001 infotypes.

Example
PNP Mode (without functions for evaluating concurrent employment) TABLES: PERNR. NODES: PERAS. INFOTYPES: 0006 NAME P0006. GET PERAS. * table P0006 is filled with infotype 0006 data of PERNR * stored in PERAS-PERNR WRITE :/ PERAS-PERNR. ... CE Mode (with function for evaluating concurrent employment) TABLES: PERNR. NODES: PERSON, GROUP, PERAS. INFOTYPES: 0001 NAME ALL_0001 AS PERSON TABLE MODE P. INFOTYPES: 0001 NAME PP0001 AS PERSON TABLE. INFOTYPES: 0006 NAME P0006. GET PERSON. * table ALL_0001 is filled with infotype 0001 data of all PERNRs * stored in PERSON-ALL_PERNRS without authority check !!! WRITE :/ PERSON-OBJID. ... GET GROUP. * table P0001 is filled with infotype 0001 data of all PERNRs * stored in GROUP-ALL_PERNRS

WRITE :/ GROUP-GROUPING_REASON, GROUP-GROUPING_VALUE. ... GET PERAS. * table P0006 is filled with infotype 0006 data of PERNR * stored in PERAS-PERNR WRITE :/ PERAS-PERNR. ...

You might also like