Error
Error Code:
682
SAP S/4HANA Error 682: SQL Statement Hint Table Empty
Description
Error 682, ERR_SQL_STATEMENT_HINT_TABLE_EMPTY, indicates that a SQL statement within SAP S/4HANA is attempting to use a database hint, but the designated table or configuration storing these hints is empty or inaccessible. This typically occurs during the execution of reports, custom applications, or standard processes that rely on specific SQL optimization directives.
Error Message
ERR_SQL_STATEMENT_HINT_TABLE_EMPTY
Known Causes
3 known causesMissing or Corrupted Hint Table Data
The database table intended to store SQL statement hints is empty, or its contents have been inadvertently deleted or corrupted.
Incorrect Database Configuration
The SAP S/4HANA system or database configuration points to an incorrect or non-existent table for SQL statement hints, resulting in an empty lookup.
Custom Development Issue
A custom report, program, or enhancement is attempting to apply a SQL hint that has not been properly defined or populated in the system's hint table.
Solutions
3 solutions available1. Restart the SAP System easy
A simple restart can often resolve transient issues with SAP system components.
1
Log in to your SAP S/4HANA application server with administrative privileges.
2
Access the SAP transaction code SM50 (Work Process Overview) or SM66 (Global Work Process Overview).
SM50 or SM66
3
Identify the primary SAP instance (often labeled 'starter' or with the instance number).
4
Gracefully shut down the SAP system using the appropriate command (e.g., `stopsap` from the command line or through the SAP Management Console). Ensure all instances are stopped.
5
Start the SAP system again using the appropriate command (e.g., `startsap` from the command line or through the SAP Management Console).
6
Monitor the system startup and check if the error 682 is resolved. This is a good first step for any unexpected SAP errors.
2. Verify and Recreate the SQL Statement Hint Table medium
The error indicates the absence or corruption of the SQL statement hint table, which needs to be present for certain SQL optimizations.
1
Log in to the SAP S/4HANA system as a user with sufficient authorization (e.g., SAP_ALL profile or equivalent).
SAP GUI
2
Execute transaction code `SE11` (ABAP Dictionary).
3
Enter the table name `SQLSTHNT` in the 'Database table' field and click 'Display'.
4
If the table does not exist or is corrupted (e.g., shows errors upon display), you will need to recreate it.
Table: SQLSTHNT
5
To recreate the table, navigate to the 'Utilities' menu in SE11, select 'Table Maintenance Generator'.
SE11 -> Utilities -> Table Maintenance Generator
6
If the Table Maintenance Generator is not found, you might need to regenerate it. If the table itself is missing, you may need to consult SAP Notes or support to obtain the correct definition and potentially recreate it via `SE11` -> 'Create' and then activate it. This is a more advanced step and might require SAP Support.
SE11 -> Create -> Table
7
After ensuring the table `SQLSTHNT` exists and is active, attempt to generate a table maintenance view for it. Then, try to create some entries manually or through a program if the generator doesn't populate it.
8
A more direct approach involves checking the underlying database. Connect to the SAP S/4HANA database (e.g., HANA Studio, SQL Developer for Oracle) and verify the existence and structure of the `SQLSTHNT` table. If it's missing, you'll need to recreate it using the correct DDL from SAP documentation or support.
9
Example SQL to check for table existence (syntax may vary slightly based on the underlying database):
SELECT table_name FROM "SYS"."TABLES" WHERE table_name = 'SQLSTHNT';
10
If the table is missing, consult SAP Note 1747270 for guidance on recreating `SQLSTHNT` or related objects. This note often provides SQL scripts for database-specific recreation.
3. Check and Update SAP Kernel and Support Packages advanced
Outdated SAP kernel or missing support packages can lead to inconsistencies and errors like this one.
1
Consult SAP Note 1909023 ('SAP S/4HANA: Database access and tracing') and related SAP Notes to understand the purpose and dependencies of the SQL statement hint table.
2
Identify the current SAP kernel version and the support package level of your S/4HANA system. This can be found in transaction `SM51` (SAP System Overview) and `SPAM`/`SAINT` (Add-On Installation Tool).
3
Check for any SAP Notes that specifically address error 682 or issues related to `SQLSTHNT` for your current S/4HANA version and kernel level.
4
If a relevant SAP Note recommends updating the kernel or applying specific support packages, plan and execute these updates during a scheduled maintenance window.
Transaction SPAM/SAINT
5
Ensure that the database client libraries are compatible with the SAP kernel version.
6
After the kernel update or support package application, restart the SAP system as described in the 'Restart the SAP System' solution.
7
Verify that the `SQLSTHNT` table is correctly populated and active after the updates.