Avoid SELECT * Queries
WarningPerformance & Database#EC SELECT_STARRemote Enabled
Overview
Select performance (Avoid SELECT * and SELECT ... ENDSELECT).
ATC Finding Messages:
Avoid SELECT *; specify required columns explicitlyAvoid SELECT ... ENDSELECT loop; use array fetch INTO TABLE
Rationale
SELECT * reads every column even when only a few fields are used, increasing network traffic and memory consumption. It also prevents efficient covering-index access and makes the code break when the table structure changes. List the required columns explicitly so the query stays stable and efficient.
Non-Compliant
abap
SELECT * FROM /dmo/customer WHERE country = 'DE' INTO TABLE @lt_customers.Compliant
abap
SELECT customer_id, first_name, last_name
FROM /dmo/customer
WHERE country = 'DE'
INTO TABLE @lt_customers.Configuration & Thresholds
This check can be fine-tuned directly in the ATC Check Variant Editor (CHKV) in Eclipse ADT:
| Parameter Name | Data Type | Default Value |
|---|---|---|
CHECK_SELECT_STAR | Boolean | true |
CHECK_ENDSELECT | Boolean | true |
Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
abap
" Standard pseudo-comment:
... "#EC SELECT_STAR
" SAP CI_ prefix format:
... "#EC CI_SELECT_STARTechnical Details
- Native ATC Class:
ZCL_SKYLINT_NO_SELECT_STAR - Implementation File: zcl_skylint_no_select_star.clas.abap