Phani Puttabakula - Mar 11, 2026

Part 3: Using ABAPer for Code Review and Analysis โ€“ Draft Structure

Part of ABAPer Series

Summary

ABAPer turns code review from a manual, time-consuming process into an AI-assisted workflow. This article covers prompts for structured code review, performance analysis, security checks, S/4HANA compatibility, and refactoring suggestions.

The Problem

Code reviews in ABAP projects are often inconsistent. Senior developers are bottlenecks. Review checklists exist but aren’t enforced. Performance issues slip through. S/4HANA incompatibilities hide in legacy code until migration time.

Why This Matters

ABAPer provides automated, repeatable code analysis that catches what humans miss โ€” and does it in seconds. It doesn’t replace human judgment, but it gives reviewers a structured starting point.


Step-by-Step Tutorial

Section 1: Running a Code Review

Quick Action: Click the Review button in the AI panel with any ABAP file open.

PROMPT:

Review this ABAP code. Check for:
1. Code quality and readability
2. ABAP best practices violations
3. Performance concerns
4. Error handling gaps
5. Security issues

Present findings as a table: Issue | Severity | Line | Recommendation

EXPECTED OUTPUT:

Issue Severity Line Recommendation
SELECT * used Medium 23 Select only required fields
No WHERE clause on BSEG High 45 Add company code filter โ€” BSEG is a cluster table
Missing authority check High 12 Add AUTHORITY-CHECK before data access
Nested SELECT in LOOP High 67 Use FOR ALL ENTRIES or JOIN
Hard-coded value ‘100’ Low 89 Use constant or configuration table
No exception handling on BAPI call Medium 112 Check RETURN table for errors

Screenshot Image


Section 2: S/4HANA Compatibility Analysis

ABAPer has built-in S/4HANA remediation analysis powered by the analyze-s4-remediation MCP tool. This detects:

  • Obsolete ALV function modules (e.g., REUSE_ALV_LIST_DISPLAY โ†’ CL_SALV_TABLE)
  • Removed pooled/cluster tables (e.g., BSEG, KONV โ†’ ACDOCA, CDS views)
  • Deprecated index tables (e.g., BSIS/BSAS โ†’ I_UniversalJournal CDS view)

Quick Action: Click the S/4HANA Check button.

PROMPT (alternative):

Analyze this program for S/4HANA compatibility. List all
deprecated tables, function modules, and obsolete patterns.
Provide the S/4HANA replacement for each.

EXPECTED OUTPUT:

S/4HANA Compatibility Report

Critical Issues (3)

  1. BSEG direct access (Line 45)

    • Issue: BSEG is a cluster table removed in S/4HANA
    • Replacement: Use ACDOCA (Universal Journal) or CDS view I_JournalEntry
  2. REUSE_ALV_LIST_DISPLAY (Line 134)

    • Issue: Obsolete ALV function module
    • Replacement: CL_SALV_TABLE or CL_GUI_ALV_GRID
  3. BSIS/BSAS secondary index access (Line 78)

    • Issue: BSIS/BSAS are removed in S/4HANA
    • Replacement: CDS view I_UniversalJournalEntry with appropriate filters

Warnings (1)

  1. READ TABLE with SY-TABIX (Line 98)
    • Issue: Non-performant pattern in new ABAP
    • Suggestion: Use READ TABLE … ASSIGNING FIELD-SYMBOL() or table expressions

[Screenshot placeholder: S/4HANA analysis results with severity badges]


Section 3: Performance Analysis

PROMPT:

Analyze this program for performance issues. Focus on:
- Database access patterns (SELECT in LOOPs, missing indexes)
- Internal table operations (nested LOOPs, linear searches)
- Memory consumption (large internal tables, unnecessary copies)

Rate each issue: Critical, High, Medium, Low

EXPECTED OUTPUT: [Include example showing: nested SELECT in LOOP โ†’ FOR ALL ENTRIES, READ TABLE linear scan โ†’ SORTED/HASHED table, SELECT * โ†’ explicit field list, missing buffer for repeated reads]


Section 4: Security Review

PROMPT:

Review this code for security vulnerabilities:
- Missing authority checks
- SQL injection risks in dynamic WHERE clauses
- Hard-coded credentials
- Missing input validation
- Cross-client data access

EXPECTED OUTPUT: [Include example showing: missing AUTHORITY-CHECK OBJECT, dynamic WHERE clause built from user input without sanitization, hard-coded RFC destination]


Section 5: Anti-Pattern Detection

PROMPT:

Identify ABAP anti-patterns in this code:
- Using obsolete statements
- God classes or methods over 100 lines
- Global variables instead of parameters
- WRITE instead of ALV
- String manipulation with CONCATENATE instead of string templates

EXPECTED OUTPUT: [Include example showing: MOVE vs inline assignment, CREATE OBJECT vs NEW, CONCATENATE vs string templates |{ }|, obsolete HEADER LINE tables]


Section 6: Modern ABAP Syntax Suggestions

PROMPT:

Suggest modern ABAP syntax replacements for this code.
Show the original line and the modern equivalent side by side.
Only suggest changes that are functionally equivalent.

EXPECTED OUTPUT: [Include table showing:

  • DATA lv_text TYPE string. + lv_text = 'Hello'. โ†’ DATA(lv_text) = 'Hello'.
  • CREATE OBJECT lo_obj TYPE zcl_class. โ†’ DATA(lo_obj) = NEW zcl_class( ).
  • LOOP AT lt_tab INTO ls_tab. ... ENDLOOP. โ†’ LOOP AT lt_tab ASSIGNING FIELD-SYMBOL(<fs>). ... ENDLOOP.
  • CALL METHOD lo_obj->process( ). โ†’ lo_obj->process( ).
  • READ TABLE lt_tab WITH KEY field = lv_val INTO ls_result. โ†’ DATA(ls_result) = lt_tab[ field = lv_val ]. ]

Best Practices

  1. Run S/4HANA check on every program you touch. Even if migration isn’t planned yet, flagging issues now saves time later.
  2. Use Review as a pre-review step. Run it before submitting code for human review โ€” it catches the obvious issues so the reviewer can focus on architecture and business logic.
  3. Combine Explain + Review. First understand the code, then review it. This gives better context for evaluating findings.
  4. Don’t blindly accept all suggestions. The AI may suggest changes that conflict with your team’s coding standards or have side effects. Always validate.
  5. Save recurring review prompts. If your team has specific review criteria, create a standard prompt template and reuse it.

Troubleshooting

S/4HANA check returns no issues

  • The code may already be S/4HANA compatible
  • The analysis covers known pattern categories โ€” very obscure compatibility issues may not be detected
  • Check that the file is an ABAP source (not a CDS view or table definition)

Review suggestions seem contradictory

  • AI may suggest both “extract this method” and “reduce method count” โ€” use judgment based on your codebase
  • Specify your priority: “Focus only on performance” or “Focus only on security”

Performance analysis misses obvious issues

  • Provide more context: “This program processes 500,000 records daily”
  • Select the specific code block instead of analyzing the entire program

Conclusion

[Summarize: code review, S/4HANA checks, performance analysis, security review, anti-pattern detection, and modern syntax suggestions โ€” all from the AI panel]

Next Article

Part 4: Writing ABAP Code with ABAPer โ€” generating programs, classes, CDS views, and unit tests with AI assistance.

Share this article
LinkedIn