Skip to content
IT Canvass
SAP ABAP development · Lesson

Structures

Quick answer

Structures can contain other structures and even internal tables (deep structures), useful for representing complex documents (a header structure containing an items table).

Key takeaways

  • A structure bundles related fields (of possibly different types) under one name, for example an order structure with order id…
  • Often you type a structure directly from a dictionary structure or a table’s line type (DATA ls_mara TYPE mara), so it always…
  • Structures and internal tables together are how ABAP models and moves business data.
  • Watch out: Field mismatches from hand-defining instead of dictionary typing.

What a structure is

A structure bundles related fields (of possibly different types) under one name, for example an order structure with order id, customer, date and amount. A single structure holds one record; an internal table of that structure holds many. Structures can mirror dictionary types (e.g. a table’s row type) or be defined locally.

Declaring and using structures

TYPES: BEGIN OF ty_order,
         id       TYPE vbeln,
         customer TYPE kunnr,
         amount   TYPE p LENGTH 9 DECIMALS 2,
       END OF ty_order.
DATA ls_order TYPE ty_order.
ls_order-id = '0000001234'.
ls_order-amount = '150.00'.

Structures and the dictionary

Often you type a structure directly from a dictionary structure or a table’s line type (DATA ls_mara TYPE mara), so it always matches the database definition. This keeps custom code aligned with SAP’s data model and avoids field mismatches.

Nested and deep structures

Structures can contain other structures and even internal tables (deep structures), useful for representing complex documents (a header structure containing an items table). Understanding work areas (a structure used to process one row of a table) is key to looping and reading tables.

Common pitfalls

  • Field mismatches from hand-defining instead of dictionary typing.
  • Confusing a structure (one row) with a table (many).
  • Deep structures misunderstood when moving/among components.

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 Structures?

    • A. SAP skills power some of the most stable, well-paid careers in enterprise IT, because SAP runs the core of…
    • B. A single structure holds one record; an internal table of that structure holds many.
    • C. Calculation views are HANA’s primary, flexible modeling artifact: reusable views that combine, aggregate and…
    Show answer

    B. A single structure holds one record; an internal table of that structure holds many.

    Covered in the “What a structure is” section of this lesson.

  2. Which of these also applies to Structures?

    • A. Goods issue not posted, sale incomplete.
    • B. Structures can mirror dictionary types (e.
    • C. Manual reconciliation instead of automated EBS.
    Show answer

    B. Structures can mirror dictionary types (e.

    Covered in the “What a structure is” section of this lesson.

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

    • A. SAP MM
    • B. SAP HANA
    • C. SAP ABAP development
    Show answer

    C. SAP ABAP development

    This lesson sits in the SAP ABAP development section of the Learn SAP course.

Frequently asked questions

What does the term Structures refer to in SAP?

A structure in ABAP is a composite data type grouping several fields, like a single row of a table. Structures and internal tables together are how ABAP models and moves business data.

What is the practical takeaway on Structures?

Structures can contain other structures and even internal tables (deep structures), useful for representing complex documents (a header structure containing an items table).

What is worth remembering about Structures in practice?

A structure bundles related fields (of possibly different types) under one name, for example an order structure with order id, customer, date and amount.

What tends to go wrong with Structures?

Field mismatches from hand-defining instead of dictionary typing. Confusing a structure (one row) with a table (many). Deep structures misunderstood when moving/among components.
CallWhatsAppEnquire