Skip to end of metadata
Go to start of metadata

Introduction

Database inconsistencies are often difficult to fix once they occur, therefore it's worth being well informed about their causes in order to prevent them. Harmful ABAP code is often behind those database inconsistencies. In this article I will review some of the most common mistakes that may lead to trouble.

Issue 0

First and foremost don't panic beforehand:

Tools that are used to copy employees' productive data to test and development systems may cause inconsistencies in the target system if the whole context is not copied along with the employee's master data.

Therefore first thing to be checked is whether the issue is happening in a productive system or just in a test or development system.

e.g. Employee master data and payroll results are exported from the productive system to the test system. however posting info (Tables PPOIX, PPDIT...) is not copied. 

Issue 1 

Symptom: You are analyzing a posting run / document at transaction PCP0. When you drill down for a G/L Account to see the details (1) by pernr you get the error message: “Data inconsistency” or "Caution! Total ( XX,XX EUR ) unequal to amount in output line ( YY,YY- EUR )".

Cause: Inconsistent payroll results deletion. using programs RPUDEL20 or RPUP2D* can be quick and useful in a test client but harmful of used in a productive system. Transaction PU01 should be used to delete payroll results if needed. If PU01 does not allow to delete payroll results, in most of the cases there is a good reason behind it: Payroll results are not standalone. Here are some dependencies:

Payroll results are already posted. You'll notice because there is an entry in table PCALAC linking seqnr + pernr + posting run is. But also, there are entries in table PPOIX for the same seqnr + pernr + posting run id. PPOIX table contains the details mentioned above (1). By the way, don't delete PCALAC or PPOIX entries out of the standard procedures.

Solution: A posting reversal will allow deleting payroll results.

Issue 2

Symptom: Payroll cluster is unreadable. You get a dump when trying to import payroll results: CONNE_IMPORT_ILL_OBJECT_TYPE /  CX_SY_IMPORT_FORMAT_ERROR / CX_SY_COMPRESSION_ERROR.

Cause: Customer developed ABAP program has updated payroll results in an inconsistent way. e.g. the program fills / changes tables RT, BT, WPBP... then sends them back to PCL2 . But some seqnrs do not correspond to just one entry in PCL2 but of to two or more entries that are differentiated by SRTF2 = 0, 1.... You'll notice it easily displaying table PCL2 in transaction SE16. For the same seqnr the different records have different update times and programs. Of course, not only payroll driver can update payroll cluster but pre DME RPCDTA*0 and others but those post payroll programs will update cluster records in a consistent manner.

Issue 3

Symptom: Same payment is done several times.

Cause: Payroll results already transferred to bank accounts. PU01 will not allow you deleting them but if you manage to do so, you may pay twice to the employee.

Issue 4

Symptom: Cluster directory “CU” at PCL2 is corrupted. A program tries to read payroll results but you get a dump.

Solution: Normally program RPUDIR00 will rebuild cluster directory, but RPUDIR00 itself tries to read cluster “CU” before rebuilding it. If the cluster “CU” is corrupted, normally the dump exception will be catch but if the exception is of a rare type that cannot be catch, RPUDIR00 will end up in dump before being able to rebuild the directory.

A trick: During RPUDIR00 run skip import RGDIR avoiding the dump, then cluster “CU” will be newly and consistently created. You have to use the debugger to skip a piece of code. See http://wiki.sdn.sap.com/wiki/display/ERPHCM/Debugging+the+Payroll+Schema  under section “Skipping blocks of code” as to how to do it.

Issue 5

Symptom: When running the FI posting for payroll we receive the following
message:

Inconsistence in payroll results (tables  C0/RT)
Message no. 3G101

Cause: In your payroll schema you imported last payroll results with split indicators pointing out to WPBP, C0, C1 etc.

Solution: WT's split indicators should be removed when the WTs come from another payroll results. It may happen that last payroll results have 2 WPBPs with APZNR = 01 and 02. You have a WT XXXX with APZNR that is imported to the current payroll period but the current payroll just has 1 WPBP.

Issue 6

After an upgrade, payroll cluster is inconsistent in the new system.

Symptom:

1. If you run transaction PC_PAYRESULT you get the following error message:

H99_DP_MESSAGES 011 "Incorrect structure of payroll result &1/&2"


2. When running other reports you get a dump when importing payroll results.

Runtime Errors: CONNE_IMPORT_WRONG_COMP_TYPE
Except.:CX_SY_IMPORT_MISMATCH_ERROR
Error when attempting to IMPORT object "X"

X is a table from payroll cluster. e.g. WPBP, C1, SV...

Cause:

1. You used to have an append structure in PC* structure.

Example: If the dump says X = WPBP, the append structure was in PC205.

2. The append structure was deleted in the new version.

3. Payroll results are a copy from a production system done by a cloning tool.

Solution:

Of course the best choice would be always to leave structures free of append
structures but as the append structure was customer specific, you have
to build your own conversion program. For that I would recommend you
to base it on a standard one that was created for the same purpose.

What the conversion tool has to do is read the cluster data, remove
the non standard info and write it back to the cluster.

e.g. program RPU600BT_CONV_SINGLE_CL

[...]
 CALL FUNCTION 'IMPORT_PCLX_TO_BUFFER'
[...]
PERFORM standard_conversion
[...]
CALL FUNCTION 'EXPORT_PCLX_FROM_BUFFER'
[...]

  
See note 763880 for additional info. 

If payroll results have been cloned by an employee cloning tool, please contact your software provider.

Issue 7

Symptom: You run RPCIPE* for one pernr. Later on, going to the posting run generated and to the corresponding posting documents you realize that several other pernrs are included in the posting run.

Cause: Payroll control record (PA03) was repeatedly deleted and newly created with a higher or lower period than before. e.g. payroll data was created, in one case up to period 17/2011, however, it is back now on period 10/2011 for correction. You have generated payroll data far into the future, and later set the record to the starting point.

Info: Never manipulate control record this way in a productive system. If you do so in a test system, you can expect inconsistencies.

Issue 8

Symptom 1:

Upon executing an out-of-sequence reversal, you get an error stating Adjustment of posting index for out-of-sequence has failed. Message no. 3G 447

Symptom 2:

When trying to display an already posted document you get the following error at the bottom of the document:

Caution! Total ( XX,XX EUR ) unequal to amount in output line ( YY,YY- EUR )

Symptom 3:

Enhancement EXIT_RPCIPE00_002 for RPCIPE00 is not processing some WTs for retro periods.

Cause:

RPCIPE00 processes retrocalculated periods from table PPOIX then EXIT_RPCIPE00_002 tries not match PPOIX with table RT. Field PPOIX-RTLINE will match originally with the number of line that PPOIX-LGART occupies in table RT in payroll cluster. This is what happens in the original posting and this is what should happen when a retrocalculation period is processed by RPCIPE00... unless... you deleted an already posted payroll result and calculated again the same payroll period. This new payroll calculation creates a different RT table where Wage types are placed in lines that are not the original ones. PPOIX and RT tables are mismatched.

You may send a break point here:

METHOD CALL_EXIT_TWO => CL_HRPAY99_POSTING_ENGINE_PP

READ TABLE ir_par->inter-rt INTO ls_rt INDEX <is_ppoix>-rtline.

If the WT retrieved from table RT does not correspond to the WT in PPOIX, you have an inconsistency.

Issue 9

The following dump occurs while running payroll:

Runtime Errors         SAPSQL_ARRAY_INSERT_DUPREC
Exception              CX_SY_OPEN_SQL_DB
Date and Time          30.09.2011 17:32:37

 Short text
     The ABAP/4 Open SQL array insert results in duplicate database records.
 What happened?
     Error in the ABAP Application Program

     The current ABAP program "SAPLHRPAY99_RGDIR_WPBP" had to be terminated because it has come across a statement that unfortunately cannot be executed.

 

Take a look at SAP Note 393820.

https://service.sap.com/sap/support/notes/393820

In many cases you can solve the problem by running program RPUDIR00.

Also take a look at the following note where the issue is described:

https://service.sap.com/sap/support/notes/321305

Issue 10

Mid-month payroll area changes may cause inconsistencies in the future.

Example: an employee belongs to payroll area A until 14.04.2011. Payroll area is changed to B as of 15.04.2011.

Payroll results are split in April:

So far so good. Now, in a future period e.g. 06.2011, retro is forced to date 15.04.2011.

But payroll area A is not released for payroll , unlike payroll area B. Therefore the first split (Payroll area A) will not be retrocalculated:



Leaving the payroll results inconsistent.

If you realize this after payroll for 06.2011 is closed, it will be too late to fix it.

To avoid inconsistencies due to mid-month payroll area changes, try to avoid mid-month payroll area changes. You can changes payroll area at the beginning of the following month.

What is more, if both payroll area are monthly, and the payment and payroll process is done at the same time, you should use just one payroll area. Remember that payroll area is not intended to be taken into account in payroll calculation.

Issue 11

Looking at payroll results for an employee you get the error:

No data exists for sequence number XXXXX
Message no. H99_DP_MESSAGES004

Cause 1:

Due to lack of authorization, when transaction PU01 was executed to delete payroll results, the entries in cluster RX (or RE, RU etc... it depends on the country) were deleted, however, the entries in the cluster CU (Directory) that correspond to the first screen you see in transaction PC_PAYRESULTS), were not deleted.

When you try to execute the transaction PU01 again you get the error message but when you go to the PC_PAYRESULTS transaction you still see the deleted records.

Solution 1:

Fix your authorization profile and rebuild cluster CU using program RPUDIR00.

Cause 2:

A customer function or operation is forcing a commit work in the middle of the payroll execution, which in the end prevents from a correct cluster update.

Solution 2:

Do not use FM HR_INFOTYPE_OPERATION or HR_MAINTAIN_MASTERDATA in customer functions and operations.

Issue 12

  • When you start Transaction PU01 ('Delete current payroll result') or report RPUDIR00 ('Restore the payroll results directory'), the system issues message PN331 "There are several results with identical FOR and IN information". 
  • When you run Payroll driver RPCALC*0 / H**CALC0 you get a rejection with the following message: "It is not possible to delete the result during repetition" or "It is not possible to delete the result during repetition". 
  • When you go to Transaction PC_PAYRESULT, the Retro and current period are listed. but if you click on the Retro Period line, the system display error message "No data exists for sequence number XXXXX" (Message no. H99_DP_MESSAGES004). 

Solution:

PU01/RPUDIR00: Double for and in periods

Issue 13

  • Inconsistent payroll results: i.e. When you try to access a given payroll results using PC_PAYRESULT it turns out that it does not exist: 

No data exists for sequence number XXXXX

Message no. H99_DP_MESSAGES004

Cause

You are using Function module HR_MAINTAIN_MASTERDATA or HR_INFOTYPE_OPERATION inside a customer function/operation (Check PCBURZXX0). Once the above function is called, TBUFF is cleared. TBUFF is a global variable containing periods to be updated that should never be manipulated.

Apart from that, please do never use "commit work"  inside customer functions and operations.

10 Comments

  1. Hi  Carlos Martinez Escribano,

    We are facing the same issue like Issue-6 Point 1 i.e. Incorrect Structure of Payroll result .......

    Please tell me the solution for this ASAP.


    Awaiting for your reply.


    Thanks

    Ananda 

    1. Hi Ananda,

      You are experiencing the symptoms described in point 6. Now you have to check if the root cause of the issue is as described in point 6: Append structures of PC* structures where removed in the upgrade. In that case you will need to develop a program to convert the payroll results and make them consistent with the new structures.

      Regards,

      Carlos.

  2. Hi Carlos,

     

    Very Thanks for the quick response. We are using PC_PAYRESULT T-Code and giving employee number. Listed the results. List contains n number of records. But error is coming to only one record after double click on the row. Remaining rows are showing results.

    If issue with table structure it should come for all employees and all payroll result. but it is only specific. 

    As you suggested if the issue PC* structures, which one i need to refer. Is PCL2 cluster is enough or other PC* also.

     

    Thanks

    Ananda

    1. Hi Ananda,

      Try to display the payslip for this pernr or any other payroll reports like h99cwtr0 until you get the dump:

      Runtime Errors: CONNE_IMPORT_WRONG_COMP_TYPE Except.:CX_SY_IMPORT_MISMATCH_ERROR Error when attempting to IMPORT object "X"

      What's the object "X" in your case?. e,g, can be WPBP etc...

      Regards,

      Carlos.

  3. Hi Carlos,

    Sorry, I am new to the payroll. For report : H99CWTR0, I don't know which values i should enter in selection screen. Hence i only gave only PERNR and it is showing "List Contains No data"

    Could you please give the steps to find out exactly. It will be very very helpful for me to replicate the issue.

    Is there any other report we need to check for this?

    Thanks for your time.

     

    Thanks

    Ananda

    1. Hi Ananda,

      Analyzing this kind of issues can be done by the customer but it requires certain degree of expertise and access to the system where the issue occurs.

      You may open an incident to us, SAP, providing connection..

      Regards,

      Carlos.

  4. Hi Carlos,

    Thanks for your suggestion. I will go forward with this.

    Thanks

    Ananda

  5. hi Carlos,

    regards inconcistencies in payroll i'm facing some problem:

    when running off cycle payroll for leaving vacation this warning appears:

    PArea RA is ignored (not for payroll run acc. to T549A)

    PArea RB is ignored (not for payroll run acc. to T549A)

    PArea RC is ignored (not for payroll run acc. to T549A)
    PArea RD is ignored (not for payroll run acc. to T549A)
    PArea RE is ignored (not for payroll run acc. to T549A)
    PArea U1 is ignored (not for payroll run acc. to T549A)
    PArea U2 is ignored (not for payroll run acc. to T549A)

    But the only payroll area I use is M1. So I don't understand this message.

     

    Thanks in advance for your help.

     

    regards.

     

    Rosina Fernandez

     

     

    1. Hi Rosina,

      That's no error but the intended behavior. It happens when you do not set a filter in PNPABKRS select-options in RPCALCX0 / HXXCALC0 PNP screen, because all payroll areas in payroll control record are checked. I normally set a filter in PNPABKRS to avoid having to see this list of messages.

      Cheers,

      Carlos.

      1. Hi Carlos,

         

        thank you, I don´t have this feature customized, I will do that.

         

        Thanks again!

        Regards.

         

        Rosina