Symptom
When calling the OData service for the CDS view C_TRIALBALANCE_CDS (Trial Balance - Read) the request terminates with the error:
DBSQL_SQL_INTERNAL_DB_ERROR
The OData request processing has been abnormally terminated.
The issue often appears when the $select clause contains many fields or when broad date ranges are requested.
Environment
SAP S/4HANA Public Cloud.
Cause
The Trial Balance - Read API is designed for period-based analytical reporting and is not intended for full-detail or large-volume extraction.
When the request includes:
- A wide $select list (many splitting dimensions), and/or
- Large posting date intervals,
The underlying CDS calculations may generate a very large intermediate dataset.
If internal limits are exceeded, the database raises DBSQL_SQL_INTERNAL_DB_ERROR. This behaviour aligns with the API documentation, which states:
- Full extraction is not supported
- $select must be restricted to the meaningful dimensions
- Excessively detailed result sets can cause internal table overflow
Resolution
To prevent the intermittent database error, apply the following recommendations:
- Reduce the number of dimensions in $select - Request only the fields required for your scenario. Avoid including many organisational dimensions (e.g., segments, profit centers, partner fields) in a single call.
- Limit the posting date range - Call the API per fiscal period or smaller intervals rather than requesting long multi-period ranges.
- Avoid full extraction patterns - The service is not intended to return complete historical data in one call. If larger datasets are needed, retrieve them in multiple smaller, filtered requests.
Applying these restrictions significantly reduces the volume processed by the CDS view and prevents the database overflow that leads to the DBSQL_SQL_INTERNAL_DB_ERROR.
Keywords
C_TRIALBALANCE_CDS, Trial Balance - Read, DBSQL_SQL_INTERNAL_DB_ERROR, OData, CDS view, $select, performance, data volume, internal table overflow, posting date range, analytical CDS, full extraction not supported, period-based balance, S/4HANA Cloud, FI-GL, API error , KBA , FI-FIO-GL-IS-2CL , Reporting Apps (Public Cloud) , Problem
SAP Knowledge Base Article - Public