Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Unable to generate query RSR_BAD_CODING2 without errors

Hello Experts,

I have rescticted more than 1600 accounts for the characterstic 'Old Accounts' in rows.

I am getting follwoing error.



Program RSR_BAD_CODING for query QTEMPDIM could not be generated without errors. More detailed information about the cause of the error cannot be provided.


The generated report was saved with the name RSR_BAD_CODING and must be analyzed.

To identify the cause of the error, edit program RSR_BAD_CODING. Run a syntax check (by choosing 'Check').

Using the type of syntax error returned, you can establish whether you can apply an SAP Note to correct this problem. Otherwise, contact your consultant or notify SAP of the problem.

Display Program RSR_BAD_CODING


Kindly suggest some solution.

Thank you in advance.

Former Member


Normally this error is caused by too complex query definition.

In your case, 1600 values in the restriction is definitely a problem.

You may consider replacing it by using some internal selections or hierarchy.

This is mentioned in OSS note 838443:


A query cannot be generated. Termination Brain A125 occurs. A syntax

check on error code RSR_BAD_CODING returns the following message:

"The length of the current statement exceeds the maximum permitted

length of 28 kilobytes."

Reason and Prerequisites

In a structure item, a very large number of fixed values (more than 900)

are selected directly. The error occurs because all values are finite in

this environment.


You can achieve the same result by creating an external hierarchy and

aggregating the thousand single values in a hierarchy node, which you

can then use as a filter in the structure item or in the global filter.

Alternatively, you can use a navigation attribute.



0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question