Why focus on the less popular tips
Common ABAP advice (naming, modularization, basic performance rules) is widely available; the techniques below are the ones that often save time in real projects because they are underused or only recently matured in modern ABAP. They help when migrating to S/4HANA, working with ADT, or writing compact, maintainable code.
Developer tooling and workflow hacks
Use ADT expert features for object navigation and refactoring
ABAP Development Tools (ADT) include advanced navigation, quick fixes, and refactoring helpers that many teams underutilize; learning a few ADT shortcuts and views speeds large-codebase changes dramatically.
Leverage code scanners and static checks early
Why: automated scanners catch naming, performance, and security smells before transport. Many open-source and community tools integrate with CI pipelines to enforce rules during pull requests.
Transport sequencing and small commits
Keep transports focused and sequence dependent changes explicitly; this reduces merge conflicts and makes rollbacks feasible in complex landscapes.
Modern ABAP language features you may be ignoring
Table expressions, inline declarations, and functional operators
Newer ABAP syntax (inline DATA, table expressions, REDUCE, FILTER, CORRESPONDING) lets you write concise, readable transformations that used to require verbose loops. Using these reduces bugs and improves intent clarity. Community repositories collect practical examples for S/4HANA syntax.
Prefer database-side processing with AMDP or CDS where appropriate
Pushing logic into the database (CDS views, AMDP) can drastically reduce data transfer and CPU on the application server, but requires careful design to avoid locking or unexpected side effects.
" Example: table expression and CORRESPONDING
DATA(result) = VALUE string_table(
FOR row IN it_source
WHERE ( active = abap_true )
( CORRESPONDING #( row )-fieldname )
).
Performance and database access: non-obvious rules
Rethink FOR ALL ENTRIES vs JOINs
FOR ALL ENTRIES can be convenient but may produce unexpected full-table scans if the input table is empty or not properly filtered; explicit JOINs or CDS-based joins are often safer and more predictable for S/4HANA.
Use proper buffering and cardinality hints
When reading large tables, prefer set-based reads and avoid row-by-row selects. If you must loop, collect keys and fetch in a single SELECT with WHERE IN or use a CDS view with parameters.
Measure before optimizing
Quick check: use SQL trace (ST05) and runtime analysis to find the real hotspots; premature micro-optimizations often add complexity without benefit.
Debugging and testing tricks
Conditional breakpoints and watchpoints
Set breakpoints with conditions or use the new ADT debug views to inspect internal tables without stopping execution for every iteration; this is invaluable for large loops.
Unit tests and test doubles
Write focused ABAP Unit tests and use test doubles for external dependencies; small, fast tests catch regressions early and make refactors safer.
CLASS ltcl_test DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS: setup FOR TESTING,
test_my_logic FOR TESTING.
ENDCLASS.
Advanced runtime patterns
Field-symbols and data references for zero-copy operations
Use FIELD-SYMBOLS and REF TO to avoid copying large internal tables when you only need to inspect or update rows in place.
Dynamic SQL and prepared statements
When building dynamic queries, prefer prepared statements (e.g., cl_sql_statement) to avoid SQL injection and to allow the DB to reuse execution plans.
Practical checklist before shipping a change
- Run static checks — code scanner and ADT quick fixes.
- Add unit tests — cover edge cases and error paths.
- Profile SQL — ST05 or CDS explain plans for heavy queries.
- Keep transports small — one logical change per transport.
- Document non-obvious DB side effects — locking, update semantics, and performance expectations.