Opening Statement

The opinions expressed in the following text are completely based on my own experiences dealing with various SAP clients over the years. Take my advice as a starting point, but remember that the outcome ultimately depends on the SAP ECC or S/4HANA environment in which you are working.


While working as a SAP Finance consultant for many years, I came across numerous instances of erroneous or ineffective usage of the SAP automated clearing process, whether in ECC using transaction F.13 or in S/4HANA utilising the software “Schedule General Ledger Jobs,” job template “Automatic Clearing.”

I will focus on the GR/IR clearing account in this blog article, but you can also use these tips for other open-item managed accounts. I will share with you my experiences using less often used clearing software options to successfully clear a significant backlog of clearable, open items.

The screenshots in this document will use the SAP GUI, however the concepts are the same for the corresponding Fiori apps as well.

I was able to successfully close off more than 218,000,000 open items in the GR/IR account for a single company code using these techniques in a work scenario.

Figure 1 – SAP GUI Transaction F.13 – Automatic Clearing

Figure 2 – SAP Fiori App Schedule General Ledger Jobs, template Automatic Clearing

Target Audience

Do you, as the end-user in charge of the GR/IR account’s administration, observe a monthly increase in the number of open items? Are you having trouble finding and addressing GR/IR inconsistencies with your suppliers as a result? The blog post is relevant to you if that is the case. To check the automatic cleaning configuration on your behalf, you might need some help from a member of your support staff.

Do you work on a project team that is tasked with preparing a system for a migration to S/4HANA or are you a support team member? It will be important to you if this is the case.

The Problem To Be Addressed

For whatever reason, some clients wind up with substantial amounts of clearable, open items on their GR/IR account. It frequently results in the clearing process terminating with the following runtime error when attempting to clear these open items using the automated clearing software, whether with foreground execution or background execution:

Figure 3 – Clearing program runtime error

Inability to resolve this issue eventually causes the volume of open items to increase to an untenable level, which can have other negative effects including slow system performance and the inability to complete a landscape conversion from ECC to S/4HANA within a reasonable amount of time.

Please take note that any further errors that may have occurred during the clearing procedure, such as those brought on by custom validations, will still exist and require separate attention.


Referring to SAP note 546410, which can be found at, the configured GR/IR account should be given sort key 014 (see Figure 4 – Sort key assignment in the GR/IR clearing GL account), which populates the concatenation of EBELN and EBELP (Purchase order and Purchase order item) into ZUONR (Assignment).

Figure 4 – Sort key assignment in the GR/IR clearing GL account

The Assignment field is automatically populated based on the concatenation of the Purchase order and Purchase order item, as can be seen in Figure 5 – Population of the Assignment field (ZUONR) in accordance with the Sort Key given in the GL master record. This is the ideal situation for starting the clearing process for the GR/IR account.

Figure 5 – Population of the Assignment field (ZUONR) in accordance with the Sort Key specified in the GL master record

The GR/IR account should be set to only clear on ZUONR in the customising activity “Prepare Automatic Clearing” if the sort key has been correctly set in the GR/IR GL account as 014.

Figure 6 – Automatic Clearing Parameters for the GR/IR account

If the sort key allocated to the GR/IR GL account is not 014, then the criteria for automatic clearing should instead be defined for both EBELN and EBELP (Purchase order and Purchase order item) as criterion 1 & criterion 2 accordingly.

Clearing Program Parameters

Let us now take a moment to explore some key parameters that can be used to improve the efficiency of the automatic clearing program, namely:

  • GR/IR Account Special Processing
  • Maximum Number of Groups
  • Minimum Number or Line Items
  • Output Control

Figure 7 – Clearing program parameters for efficient processing

GR/IR account special process

As per the reasons documented in SAP note 546410 (, this indicator does not need to be selected. EBELN and EBELP are stored in the assignment field ZUONR (provided sort key 014 has been used), and this alone is enough for clearing of the GR/IR account.

Maximum Number of Groups

The use of this input parameter can be helpful as a way to restrict the quantity of data that the clearing programme chooses for processing if the GR/IR account has such a high volume of data that it is creating the runtime error as illustrated in Figure 3 – Clearing programme runtime error.

A group is regarded as one or more line items for the purposes of this input parameter if they include a special combination of the clearing characteristics listed in customising view V TF123, “Prepare Automatic Clearing.” Observe the automatic clearing parameters for the GR/IR account in Figure 6.

As per the example below, three groups are formed, based on the values of ZUONR.

Figure 8 – Formation of Clearing Groups

Once the parameter’s maximum number of groups has been reached, no new groups are generated, and those that can be cleaned are sent to the clearing interface for further action.

When this parameter is initialised, that is, left empty, all line items that have been picked in accordance with the general selections are processed, which frequently results in the runtime error

For this parameter to be set appropriately, there are no hard and fast rules. A acceptable value is frequently found after a number of unsuccessful attempts. I would advise starting with a cautious number, like 50,000, then adjusting as necessary. The best value can be chosen by analysing runtime resource use in collaboration with your project Basis consultant.

It is crucial to realise that while utilising this parameter, the automatic clearing programme will need to run numerous times, up until a point where the volume of open items in the residual queue is low enough that the parameter is no longer necessary.

Refer to the field help for further insights on the usage of this input parameter.

Minimum Number of Line Items

Every group designated for clearing will have a clearing document prepared if this option is set to initial. In the example below, two distinct clearing documents will be posted because group ids. 2 and 3 can be cleared because each group’s net balance is zero.

Figure 9 – Minimum number of line items in the clearing document

Think about a scenario where hundreds of clearing documents must be posted. This results in a runtime processing cost because the posting interface to create the clearing posting is repeatedly called for each clearing group, which not only wastes the applicable document number range but also consumes it unnecessarily.

When this parameter is utilised, the computer software accumulates things that need to be cleaned into a table inside itself until the required minimum count is reached. The items to be cleaned are only moved to the posting interface and cleared as a single document once this minimum count has been attained.

Using a parameter value of 500, I’ve had luck. The field help offers insightful advice on how to use this parameter. Once more, determining the ideal value can be aided by working with your project Basis consultant and studying runtime resource use.

Output Control

The contents of the report that is generated when the report is successfully executed are determined by these three checkboxes.

The first two checkboxes’ report detail adds no use outside of testing or troubleshooting and just adds to the load on the system’s resources by producing big spool files.

The following brief list, which provides the total number of open items studied and the number of cleared items, is generated with all three output control checkboxes deselected.

Figure 10 – Runtime Statistics

As a result, I advise leaving the first two selections, “Documents that may be cleared” and “Documents that cannot be cleared,” empty.

The final checkbox, labelled “Error Messages,” needs to be selected. This displays alerts about closed profit centres or other problems hindering clearing.

Figure 11 – Error Messages