How to remediate: Complex DB logic in ABAP instead of AMDP/CDS
Large aggregation or analytical queries written in ABAP loops instead of CDS/AMDP for HANA pushdown.
Is this issue in your codebase?
A1 scans all 30 rules across your custom ABAP — results in minutes.
What changes in S/4HANA
S/4HANA on HANA: complex ABAP processing of large result sets is a missed performance opportunity.
Before and after: ABAP code example
* ECC: ABAP loop doing aggregation — slow on large datasets
SELECT * FROM acdoca INTO TABLE @DATA(lt_all).
LOOP AT lt_all INTO DATA(ls_line).
ADD ls_line-hsl TO lv_total.
ENDLOOP. * S/4HANA on HANA: push aggregation to database via CDS/AMDP
SELECT SUM( amountincompanycodeloccrcy ) AS total
FROM i_glaccountlineitem
INTO @DATA(lv_total)
WHERE companycode = @lv_bukrs
AND fiscalyear = @lv_gjahr. Effort estimate and common pitfalls
Effort estimate
Estimate is per affected object. Total effort scales with the number of occurrences in your codebase. Use the A1 scan to get an object-level count before estimating the full project.
Common pitfalls
- ! Architectural dependencies that require multiple teams
- ! Data migration requirements alongside code changes
- ! Extended regression and integration test cycles
- ! Potential need for parallel run before cutover
Related rules to check
SELECT * usage
SELECT * reads all columns including new S/4HANA columns, causing unexpected results and performance issues.
Missing FOR ALL ENTRIES guard
FOR ALL ENTRIES IN without an initial-table check returns the full table when the driver table is empty.
Native SQL (EXEC SQL)
EXEC SQL and ADBC bypass ABAP SQL layer and break on S/4HANA HANA database.
Find every instance of this issue in your codebase
The A1 scanner checks all 30 compatibility rules — including Complex DB logic in ABAP instead of AMDP/CDS — across your custom ABAP objects and produces a prioritised remediation backlog.
Scan your codebase for this issue free →SAP, S/4HANA and ABAP are trademarks of SAP SE. s4ready.ai is an independent solution and is not affiliated with, endorsed by, or sponsored by SAP SE.