SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software
Development resources, articles, tutorials, code samples, tools and downloads for SAP HANA and ABAP, HANA Database, SQLScript, SAP UI5, Screen Personas, Web Dynpro, Workflow

ATC Check: The database feature "TABLE_LEN_MAX1" is used here


ABAP Test Cockpit (ATC) checks control ABAP code developments regarding database queries for the data platform compability and displays if a database feature like TABLE_LEN_MAX1 is used to provide information to the developer that this feature is not supported by all data platforms. So in case a data platform change like moving from SQL Server to Oracle, or just in the opposite way or among from other vendors, etc some errors might occur due to unsupported database features by the new provider.

S/4HANA: Search for S/4 related syntax errors
Priority 2
Syntax check warning.
The database feature "TABLE_LEN_MAX1" is used here (read the long text).
Internal message code: SELECT 529

When I checked the documentation, I realized that I can resolve the issue by checking the database properties for TABLE_LEN_MAX1 feature before I execute the ABAP Open SQL query.

By the way, TABLE_LEN_MAX1 is pointing to database feature that a table row can have up to 16293 bytes

Here is a section from the Help documentation on the error.

Database features are functional enhancements in Open SQL that are no longer implemented on all databases. This is why this warning is produced.
The class CL_ABAP_DBFEATURES makes it possible to query (at runtime) whether the database of the system supports this feature. The name of the database feature specified in the warning is defined as a constant in the class CL_ABAP_DBFEATURES. These constants and the method USE_FEATURES of the class CL_ABAP_DBFEATURES can be used to query whether the Open SQL command can be executed.

So to check if data platform supports TABLE_LEN_MAX1 feature, ABAP class cl_abap_dbfeatures should be called to read the TABLE_LEN_MAX1 feature of the database that the code is running on.

if cl_abap_dbfeatures=>use_features(
 exporting
  requested_features =
   value #( ( cl_abap_dbfeatures=>table_len_max1 ) )
).

* Open SQL Select command

endif.
Code

Additionally, following pseudo-comment ##DB_FEATURE_MODE[TABLE_LEN_MAX1] could be used right after the database table in SQL SELECT query.

SELECT vbeln, posnr
FROM vbrp ##DB_FEATURE_MODE[TABLE_LEN_MAX1]
INTO TABLE @DATA(lt_vbrp)
FOR ALL ENTRIES IN @lt_vbrk
WHERE vbrp~vbeln = @lt_vbrk-vbeln.
Code

This pseudo-comment informs that you are acknowledged about the issue and possible problems that might occur on a data platform change.


Database Feature TABLE_LEN_MAX1 used with VBPA Table

I got this "The database feature "TABLE_LEN_MAX1" is used here" ATC error on a SELECT command where I use VBPA Sales Document Partner table.
Instead of using VBPA in FROM clause of a SQL SELECT statement in my ABAP program, I preferred using ZCBS1_V_VBPA view as the datasource. Because all the fields I need were already in the ZCBS1_V_VBPA view and the view had far more less fields than VBPA table.
This improvement in code, limiting the selected fields at the data source, is enough to solve the ATC error for VBPA table use.



SAP HANA and ABAP

Install SAP Free
CRM Companies List
Web Based CRM Software


Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.