SAP Function CD_READ_PREVIOUS - Selects the Last Payroll Result (Regular, Bonus, Correction)

Parameter Reference Type Length Default Optional Text
ALL C C 0 SPACE X
EXACT 0 SPACE X Exact Match
IGNORE_ABKRS C C 0 SPACE X
IN_RECORD PC261 u 156 Specified Record
LAST C C 0 SPACE X

Parameter Reference Length Optional Text
OUT_RGDIR PC261 156 Payroll Results Found
RGDIR PC261 156 Cluster Directory

Exception Text
NO_RECORD_FOUND No Preceding Result Found

Functionality
This function module supplies a payroll result (RGDIR entry) with thepreceding result that matches the transferred entry in the for-view andis the next smallest in the in-view.
If the for-period periods have since been changed (by a retroactivechange of legal person, for example), all of the preceding results arerecovered whose for-period FROM date is within the for-period period ofthe specified record.
If you select the 'exact' option, on the other hand, just one record isrecovered if the for-period FROM date and TO date are an exact match.
Procedure:
In the first step, an RGDIR entry is determined which matches thetransferred record in the for-view and which has a maximum smallersequence number than the transferred record. A check is then performedto see whether there are any more suitable records from the for-viewwith the same in-view as the found record.
Example
Sequence number For-period In-period PayArea FromFP ToFP
00001 01 01 D2 1.1. 15.1.
00002 01 01 D2 15.1. 31.1.
00003 01 02 D2 1.1. 31.1.
00004 02 02 D2 1.2. 28.2.
00005 01 03 D2 1.1. 31.1.
00006 02 03 D2 1.2. 28.2.
00007 03 03 D2 1.3. 31.3.
Record 3 precedes record 5 whereas records 1 and 2 precede record 3. Ifthe 'exact' switch is set, the module for record 3 fails to find apreceding record.