SAP Knowledge Base Article - Public

2301752 - GR/IR Clearing Run Jobs Failing/Cancelled - The Internal Session Was Terminated With a Runtime Error (See ST22)


You have executed a GR/IR Clearing Run that is presenting status In Process and processing status Information.
Upon checking the Run Jobs you see that a job failed with an error description: 'Cancelled manually or by the system'.
Checking the Job Log you see the messages: 'The internal session was terminated with a runtime error and: 'The Job is cancelled'.


SAP Business ByDesign

Reproducing the Issue

1. Go to the Inventory Valuation workcenter.
2. Go to the Periodic Tasks and GR/IR Clearing view.
3. Select the row for the respective Run ID and press View Jobs button.
4. Show Run Jobs: You can see a Failed job with the error description 'Cancelled manually or by the system'.
5. Click View Job Log button.

The steps look like below:

Job started
Step 001 started (program SAP_MDRI_REPORT, variant , user ID XYZ, where XYZ means the User ID executing the run.)
MDRO: FIA_GRIR_CLEARING_RUN (57, ABC where ABC stands for the GR/IR Clearing Run ID)
The internal session was terminated with a runtime error (see ST22): Job cancelled


The message 'The internal session was terminated with a runtime error (see ST22)' appearing in the Job Log indicates that a backend error occurred upon the execution of the respective job.
Such backend errors are usually caused by a memory issue which, in turn, was caused by a too large dataset selected for the run. In the run's parameters, you need to check if you have left blank Purchasing Document from/to ID and flagged the Recalculate All Items checkbox.
If both conditions are met, all the POs are being reprocessed and the dataset can become excessively large.


When creating the GR/IR Clearing Run, in the Data Selection section, you should select only the Purchase Order or range of Purchase Orders that are intended to be processed. This will create a smaller dataset and this memory issue should not occur. The selection could be restricted to one Set of Books at a time. This would restrict data amount and data complexity as well.

Another solution would be to schedule the GR/IR Clearing Run to be executed out of the business hours.


GR, IR, run, status, stuck, in process, didn't finish , KBA , SRD-FIN-INV , Inventory , How To


SAP Business ByDesign all versions