Error
Error Code:
1359
SAP S/4HANA Error 1359: SQLScript Member Count Exceeded
Description
Error 1359, ERR_SQLSCRIPT_TOO_MANY_MEMBERS, signifies that an SQLScript operation has surpassed an internal system limit for the number of members it can process. This usually happens during the compilation or execution of complex database procedures, functions, or views within SAP S/4HANA's underlying SAP HANA database when a defined threshold for elements is exceeded.
Error Message
ERR_SQLSCRIPT_TOO_MANY_MEMBERS
Known Causes
3 known causesOverly Complex SQLScript Object
The SQLScript procedure, function, or view being processed contains an excessive number of parameters, variables, or internal logic elements, exceeding system limits.
Excessive Nested Structures
SQLScript objects using deeply nested tables, arrays, or other collection types can inadvertently inflate the member count beyond acceptable thresholds.
Auto-generated Code Complexity
Automatically generated SQLScript code, often from reporting or integration tools, might produce overly complex constructs that hit internal member limits.
Solutions
3 solutions available1. Optimize SQLScript Procedures and Functions advanced
Refactor complex SQLScript objects to reduce the number of internal members or table functions.
1
Identify the SQLScript object (procedure or function) that is causing the error. This usually involves analyzing the SAP application logs (SM21, ST22) or the HANA trace files to pinpoint the exact object and the point of failure.
2
Review the SQLScript code for excessive use of nested table functions, complex joins, or overly granular logic that can be consolidated. Look for opportunities to simplify logic and reduce the number of intermediate table variables or definitions.
Example: If you have multiple sequential table functions creating intermediate results, consider combining them into a single, more efficient table function or a set-based operation.
3
Break down large, monolithic SQLScript procedures into smaller, reusable ones. This can help in managing complexity and adhering to member limits.
4
Test the optimized SQLScript object thoroughly in a development or test environment before deploying to production.
2. Increase SQLScript Member Limit (Temporary/Last Resort) medium
Temporarily increase the SQLScript member limit via HANA configuration. Use with caution as it can mask underlying design issues.
1
Access the SAP HANA system's configuration parameters. This is typically done through the SAP HANA cockpit or by directly querying the `M_CONFIGURATION` system view.
SELECT * FROM M_CONFIGURATION WHERE KEY = 'sqlscript_max_members';
2
Identify the parameter `sqlscript_max_members`. Its default value is usually sufficient, but if it's too low for a specific, complex, yet necessary SQLScript, it might need adjustment.
3
If necessary, increase the value of `sqlscript_max_members`. **Note:** This is a system-wide parameter and should be increased cautiously. Consult SAP notes and your system architect before making such changes. A significant increase might indicate a need to re-evaluate the SQLScript design.
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('sqlscript', 'sqlscript_max_members') = <new_value> WITH RECONFIGURE;
4
The change might require a restart of the HANA service or a reload of the configuration. Verify the new value is active.
3. Review and Refactor SAP Application Logic advanced
Analyze the surrounding ABAP or other application logic that calls the SQLScript to see if the data processing can be shifted or simplified.
1
Examine the ABAP code or other application layer that is invoking the problematic SQLScript. Identify the exact call and the data being passed.
2
Determine if the complexity within the SQLScript can be handled more efficiently in the application layer. This might involve performing some pre-processing or post-processing of data in ABAP that reduces the burden on the SQLScript.
3
Consider if there are alternative SAP standard functionalities or CDS views that can achieve the same business outcome without requiring a custom, complex SQLScript.
4
If significant changes are made to the application logic, ensure thorough regression testing to confirm that business processes are not negatively impacted.