Error
Error Code: 1338

SAP S/4HANA Error 1338: Missing CE_CONVERSION Table

📦 SAP S/4HANA
📋

Description

This error indicates that a specified table, essential for a Calculation Engine (CE) conversion operation within SQLScript, cannot be located. It typically arises when a HANA view or stored procedure attempts to reference a table that does not exist or is inaccessible in the current schema or system.
💬

Error Message

ERR_SQLSCRIPT_CE_CONVERSION_CUSTOM_TAB_MISSING
🔍

Known Causes

4 known causes
⚠️
Referenced Table Missing
The table specified in the CE_CONVERSION function or underlying SQLScript does not exist in the database.
⚠️
Incorrect Schema Reference
The CE_CONVERSION function is searching for the table in a schema where it does not reside, or the user lacks permissions for the correct schema.
⚠️
Typographical Error
The table name referenced in the CE_CONVERSION function or related SQLScript contains a typo, preventing its discovery.
⚠️
Inconsistent Database Object
The database object (e.g., calculation view, stored procedure) calling CE_CONVERSION is referencing an outdated or invalid table definition.
🛠️

Solutions

3 solutions available

1. Recreate CE_CONVERSION Table from Standard Schema medium

This solution involves copying the standard CE_CONVERSION table definition and data from a working SAP S/4HANA system to the affected system.

1
Identify a source SAP S/4HANA system that is not experiencing this error. This system should ideally have the same or a very similar version and support package level as the affected system.
2
On the source system, connect to the SAP HANA database and export the definition and data of the `CE_CONVERSION` table. You can use SAP HANA Studio or `hdbsql` for this. The following SQL statement can be used to generate the `CREATE TABLE` statement and `INSERT` statements for the data.
-- On the source system, execute this to get the CREATE TABLE statement:
SELECT CREATE_TABLE_STATEMENT FROM TABLES WHERE SCHEMA_NAME = '<target_schema>' AND TABLE_NAME = 'CE_CONVERSION';

-- On the source system, execute this to get the data:
SELECT * FROM "<target_schema>"."CE_CONVERSION";
3
Copy the generated `CREATE TABLE` statement and all the `INSERT` statements for the data from the source system.
4
On the affected SAP S/4HANA system, connect to the SAP HANA database. Ensure you are connected to the correct schema where S/4HANA tables reside (usually `SAP<SID>`).
5
Execute the copied `CREATE TABLE` statement for `CE_CONVERSION` in the affected system's database.
-- Replace <target_schema> with your S/4HANA schema (e.g., SAPS4HDB)
CREATE COLUMN TABLE "<target_schema>"."CE_CONVERSION" (
    "CLIENT" NVARCHAR(3) NOT NULL COMMENT 'Client',
    "VALDT" VARCHAR(8) NOT NULL COMMENT 'Date',
    "CONVTYP" NVARCHAR(4) NOT NULL COMMENT 'Conversion Type',
    "FROMUNIT" NVARCHAR(3) NOT NULL COMMENT 'From Unit',
    "TOUNIT" NVARCHAR(3) NOT NULL COMMENT 'To Unit',
    "FACTOR" DECIMAL(23, 8) COMMENT 'Conversion Factor',
    "CALC_FACTOR" DECIMAL(23, 8) COMMENT 'Calculated Conversion Factor',
    "EXACT" NVARCHAR(1) COMMENT 'Rounding Rule',
    "CONV_FACTOR_INV" DECIMAL(23, 8) COMMENT 'Inverse Conversion Factor',
    "CONV_FACTOR_INV_EX" DECIMAL(23, 8) COMMENT 'Inverse Conversion Factor with Exponent',
    "CONV_FACTOR_EXP" DECIMAL(23, 8) COMMENT 'Conversion Factor with Exponent',
    "IS_ACTIVE" NVARCHAR(1) COMMENT 'Active Flag',
    "VALID_FROM" VARCHAR(8) COMMENT 'Valid From Date',
    "VALID_TO" VARCHAR(8) COMMENT 'Valid To Date',
    "USER_ID" VARCHAR(12) COMMENT 'User ID',
    "TIMESTAMP" TIMESTAMP COMMENT 'Timestamp',
    "VERSION" INTEGER COMMENT 'Version',
    "LAST_MODIFIED" VARCHAR(8) COMMENT 'Last Modified Date',
    "MODIFIED_BY" VARCHAR(12) COMMENT 'Modified By User',
    "MODIFIED_TS" TIMESTAMP COMMENT 'Modification Timestamp',
    "EXTERNAL_REF" NVARCHAR(40) COMMENT 'External Reference',
    "IS_DEFAULT" NVARCHAR(1) COMMENT 'Default Flag',
    "CUSTOM_FIELD_1" NVARCHAR(60) COMMENT 'Custom Field 1',
    "CUSTOM_FIELD_2" NVARCHAR(60) COMMENT 'Custom Field 2',
    "CUSTOM_FIELD_3" NVARCHAR(60) COMMENT 'Custom Field 3',
    "CUSTOM_FIELD_4" NVARCHAR(60) COMMENT 'Custom Field 4',
    "CUSTOM_FIELD_5" NVARCHAR(60) COMMENT 'Custom Field 5',
    "CUSTOM_FIELD_6" NVARCHAR(60) COMMENT 'Custom Field 6',
    "CUSTOM_FIELD_7" NVARCHAR(60) COMMENT 'Custom Field 7',
    "CUSTOM_FIELD_8" NVARCHAR(60) COMMENT 'Custom Field 8',
    "CUSTOM_FIELD_9" NVARCHAR(60) COMMENT 'Custom Field 9',
    "CUSTOM_FIELD_10" NVARCHAR(60) COMMENT 'Custom Field 10',
    "CUSTOM_FIELD_11" NVARCHAR(60) COMMENT 'Custom Field 11',
    "CUSTOM_FIELD_12" NVARCHAR(60) COMMENT 'Custom Field 12',
    "CUSTOM_FIELD_13" NVARCHAR(60) COMMENT 'Custom Field 13',
    "CUSTOM_FIELD_14" NVARCHAR(60) COMMENT 'Custom Field 14',
    "CUSTOM_FIELD_15" NVARCHAR(60) COMMENT 'Custom Field 15',
    "CUSTOM_FIELD_16" NVARCHAR(60) COMMENT 'Custom Field 16',
    "CUSTOM_FIELD_17" NVARCHAR(60) COMMENT 'Custom Field 17',
    "CUSTOM_FIELD_18" NVARCHAR(60) COMMENT 'Custom Field 18',
    "CUSTOM_FIELD_19" NVARCHAR(60) COMMENT 'Custom Field 19',
    "CUSTOM_FIELD_20" NVARCHAR(60) COMMENT 'Custom Field 20',
    "CUSTOM_FIELD_21" NVARCHAR(60) COMMENT 'Custom Field 21',
    "CUSTOM_FIELD_22" NVARCHAR(60) COMMENT 'Custom Field 22',
    "CUSTOM_FIELD_23" NVARCHAR(60) COMMENT 'Custom Field 23',
    "CUSTOM_FIELD_24" NVARCHAR(60) COMMENT 'Custom Field 24',
    "CUSTOM_FIELD_25" NVARCHAR(60) COMMENT 'Custom Field 25',
    "CUSTOM_FIELD_26" NVARCHAR(60) COMMENT 'Custom Field 26',
    "CUSTOM_FIELD_27" NVARCHAR(60) COMMENT 'Custom Field 27',
    "CUSTOM_FIELD_28" NVARCHAR(60) COMMENT 'Custom Field 28',
    "CUSTOM_FIELD_29" NVARCHAR(60) COMMENT 'Custom Field 29',
    "CUSTOM_FIELD_30" NVARCHAR(60) COMMENT 'Custom Field 30'
) COMMENT 'Conversion factors for units';
6
Execute the copied `INSERT` statements to populate the `CE_CONVERSION` table with data. Be cautious if the source system has a very large amount of data; consider a phased insertion or selective data transfer if necessary.
-- Example INSERT statement (adjust as per your exported data):
INSERT INTO "<target_schema>"."CE_CONVERSION" (CLIENT, VALDT, CONVTYP, FROMUNIT, TOUNIT, FACTOR, CALC_FACTOR, EXACT, CONV_FACTOR_INV, CONV_FACTOR_INV_EX, CONV_FACTOR_EXP, IS_ACTIVE, VALID_FROM, VALID_TO, USER_ID, TIMESTAMP, VERSION, LAST_MODIFIED, MODIFIED_BY, MODIFIED_TS, EXTERNAL_REF, IS_DEFAULT, CUSTOM_FIELD_1, CUSTOM_FIELD_2, CUSTOM_FIELD_3, CUSTOM_FIELD_4, CUSTOM_FIELD_5, CUSTOM_FIELD_6, CUSTOM_FIELD_7, CUSTOM_FIELD_8, CUSTOM_FIELD_9, CUSTOM_FIELD_10, CUSTOM_FIELD_11, CUSTOM_FIELD_12, CUSTOM_FIELD_13, CUSTOM_FIELD_14, CUSTOM_FIELD_15, CUSTOM_FIELD_16, CUSTOM_FIELD_17, CUSTOM_FIELD_18, CUSTOM_FIELD_19, CUSTOM_FIELD_20, CUSTOM_FIELD_21, CUSTOM_FIELD_22, CUSTOM_FIELD_23, CUSTOM_FIELD_24, CUSTOM_FIELD_25, CUSTOM_FIELD_26, CUSTOM_FIELD_27, CUSTOM_FIELD_28, CUSTOM_FIELD_29, CUSTOM_FIELD_30)
VALUES ('100', '20230101', 'CURR', 'USD', 'EUR', 0.92345678, 0.92345678, 'R', NULL, NULL, NULL, 'X', '20230101', NULL, 'BATCHJOB', CURRENT_TIMESTAMP, 1, '20230101', 'BATCHJOB', CURRENT_TIMESTAMP, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
7
After recreating and populating the table, restart the SAP S/4HANA application server(s) to ensure the changes are picked up by the system.

2. Run SAP S/4HANA System Health Check and Repair medium

This solution involves utilizing SAP's built-in tools to check and potentially repair inconsistencies within the S/4HANA system, including missing tables.

1
Access the SAP S/4HANA system through SAP GUI.
2
Execute transaction code `SICK` (System Check). This transaction provides a comprehensive health check for various SAP components, including database objects.
3
Within `SICK`, navigate to the relevant checks that pertain to database objects and consistency. Look for options related to data dictionary objects, table consistency, or specific checks for core S/4HANA tables.
4
Initiate the checks. If the `CE_CONVERSION` table is identified as missing or inconsistent, `SICK` may offer an option to repair or recreate the object. Follow the prompts carefully.
5
If `SICK` does not directly resolve the issue, consider running SAP Note 2359730 (SAP S/4HANA: Database consistency checks and repair) or similar SAP Notes that provide tools for database consistency checks. These notes often involve specific programs or reports that can be executed.
6
After running the health check and any repair actions, restart the SAP S/4HANA application server(s).

3. Reinstall or Reapply SAP S/4HANA Support Packages/Updates advanced

This is a more drastic but thorough solution if the table is missing due to a corrupted or incomplete installation/update process.

1
Consult SAP Notes and the SAP S/4HANA Installation/Upgrade Guide for the specific version and support package level of your system.
2
Identify the support package or update that is suspected to have caused the issue. If it's a recent update, consider temporarily rolling it back if feasible and supported.
3
If rolling back is not an option, plan for a reapplication of the problematic support package or update. This process typically involves using tools like SUM (Software Update Manager) or SAPCAR for extracting archives.
4
Execute the reinstallation or reapplication process following SAP's official documentation. This will ensure that all required database objects, including `CE_CONVERSION`, are correctly created and populated.
5
After the support package application is complete, perform a full system restart. Verify that the `CE_CONVERSION` table exists and is populated.
🔗

Related Errors

5 related errors