Skip to content
IT Canvass
SAP HANA · Lesson

Procedures

Quick answer

ABAP can call HANA procedures (via AMDP, ABAP-managed database procedures) to push heavy logic down.

Key takeaways

  • A stored procedure is reusable SQLScript logic stored in HANA and callable by name.
  • Prefer views (calculation/CDS) for read/query models, they are optimised and reusable.
  • Input/output parameters and table parameters.
  • Watch out: Row loops in SQLScript instead of set operations.

What procedures are for

A stored procedure is reusable SQLScript logic stored in HANA and callable by name. Procedures are used when logic is too complex for a single view or must run in steps, complex calculations, data transformations, or operations that update data, all executed close to the data for performance.

SQLScript features

  • Input/output parameters and table parameters.
  • Local variables and table variables.
  • Control flow (IF, loops) alongside set-based SQL.
  • Read-only vs read-write procedures.

When to use a procedure vs a view

Prefer views (calculation/CDS) for read/query models, they are optimised and reusable. Use procedures when you need procedural steps, side effects (writes), or logic that does not fit a declarative view. Favour set-based operations inside procedures over row loops for performance.

In SAP applications

ABAP can call HANA procedures (via AMDP, ABAP-managed database procedures) to push heavy logic down. AMDP lets developers write SQLScript within ABAP classes, combining ABAP lifecycle with HANA-side execution.

Common pitfalls

  • Row loops in SQLScript instead of set operations.
  • Procedures where a view would do (less reusable).
  • Heavy logic in ABAP that should be pushed down (AMDP).

Want to learn this properly?

Our live, instructor-led SAP Training covers this hands-on, with real projects and a certification path.

Check your understanding

  1. Which statement is true of Procedures?

    • A. A client is a self-contained tenant within an SAP system, with its own master data, transaction data and…
    • B. Working with IDocs in ABAP means generating, processing and enhancing the intermediate documents SAP uses for…
    • C. Procedures are used when logic is too complex for a single view or must run in steps, complex calculations…
    Show answer

    C. Procedures are used when logic is too complex for a single view or must run in steps, complex calculations…

    Covered in the “What procedures are for” section of this lesson.

  2. Which of these also applies to Procedures?

    • A. Basic auth over HTTP, credentials exposed.
    • B. Prefer views (calculation/CDS) for read/query models, they are optimised and reusable.
    • C. Skipping the discipline under delivery pressure.
    Show answer

    B. Prefer views (calculation/CDS) for read/query models, they are optimised and reusable.

    Covered in the “When to use a procedure vs a view” section of this lesson.

  3. Which part of the Learn SAP curriculum covers Procedures?

    • A. SAP labs
    • B. Getting started
    • C. SAP HANA
    Show answer

    C. SAP HANA

    This lesson sits in the SAP HANA section of the Learn SAP course.

Frequently asked questions

What does the term Procedures refer to in SAP?

Stored procedures in HANA (written in SQLScript) encapsulate database-side logic, calculations, complex transformations, multi-step operations, that run inside the database for speed. They are a key tool in the code-to-data toolkit.

What is another point to note about Procedures?

ABAP can call HANA procedures (via AMDP, ABAP-managed database procedures) to push heavy logic down.

What else is worth knowing about Procedures?

A stored procedure is reusable SQLScript logic stored in HANA and callable by name.

What tends to go wrong with Procedures?

Row loops in SQLScript instead of set operations. Procedures where a view would do (less reusable). Heavy logic in ABAP that should be pushed down (AMDP).
CallWhatsAppEnquire