Structures (SAP Library - BC (2024)

Structures (SAP Library - BC (1)StructuresStructures (SAP Library - BC (2)

A structure(structured type) comprises components (fields). Types are defined for thecomponents A component can refer to an elementary type (via a data element orby directly specifying the data type and length in the structure definition),another structure or a table type. A structure can therefore be nested to anydepth.

Structures are usedto define the data at the interface of module pools and screens and to definethe parameter types of function modules.

Structures (SAP Library - BC (3)

The data formanaging the addresses of persons can be represented as a nested structurePERSON. The structure comprises the components (structures) NAME and ADDRESS.The structure NAME comprises the components (data elements) FIRSTNAME andLASTNAME. The structure ADDRESS comprises the components (structures) STREETand TOWN. The structure STREET comprises the components (data elements)STREETNAME and HOUSENO. The structure TOWN comprises the components (dataelements) ZIP and TOWNNAME.

Structures (SAP Library - BC (4)

The centraldefinition of structures that are used more than once makes it possible forthem to be changed centrally. The active ABAP Dictionary then makes thischange wherever required. ABAP programs or screen templates that use astructure are automatically adjusted when the structure is changed (seeRuntime Objects). This ensures the greatest possible consistency ofthe data definition, also for complex programs.

There are Flat, nested and deep structures. A flat structure onlyreferences elementary types. A nested structure references at least onefurther structure, but not a table type. A deepstructure references at least one table type.

Structures (SAP Library - BC (5)

Structures (SAP Library - BC (6)

In a databasetable, you can only include flat structures as substructures.

See also:

CreatingStructures

As an expert in the field of data modeling and programming, my extensive knowledge in structured types, specifically structures in the context of ABAP (Advanced Business Application Programming), positions me to provide comprehensive insights into the concepts mentioned in the article.

The article discusses the fundamental concepts of structures within the ABAP programming language. Structures, also known as structured types, are entities that comprise components or fields. These components can be elementary types, other structures, or table types. The definition of types is crucial for these components, and they can be nested to any depth, allowing for a hierarchical representation of data.

One critical aspect highlighted in the article is the use of structures in defining data at the interface of module pools and screens, as well as in specifying parameter types for function modules. This emphasizes the role of structures in organizing and encapsulating data in ABAP programming, contributing to modular and efficient code.

The article introduces the concept of nested structures, where a structure can contain other structures as components. This nesting ability allows for a more organized and hierarchical representation of complex data. In the example provided, a nested structure named PERSON is described, comprising substructures NAME and ADDRESS. The NAME structure further includes data elements FIRSTNAME and LASTNAME, while the ADDRESS structure includes substructures STREET and TOWN.

Furthermore, the article discusses the central definition of structures, emphasizing the importance of defining structures that are used more than once centrally. This central definition enables changes to be made consistently throughout the entire program, ensuring data definition consistency. The use of the ABAP Dictionary is mentioned, indicating that changes in structures are automatically reflected in ABAP programs and screen templates, contributing to runtime consistency.

The article categorizes structures into three types: flat, nested, and deep structures. A flat structure references only elementary types. In contrast, a nested structure references at least one further structure but not a table type. A deep structure, on the other hand, references at least one table type. This classification helps in understanding the different ways structures can be organized based on their complexity and relationships with other types.

The article also mentions the limitation of including only flat structures as substructures in a database table. This constraint is essential to consider when designing database tables with associated structures.

In conclusion, the concepts covered in the article provide a solid foundation for understanding structures in ABAP programming, including their types, nesting capabilities, central definition, and impact on program consistency. These concepts are crucial for developers working with ABAP to create robust and maintainable software solutions.

Structures (SAP Library - BC (2024)
Top Articles
Latest Posts
Article information

Author: Arline Emard IV

Last Updated:

Views: 6309

Rating: 4.1 / 5 (52 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Arline Emard IV

Birthday: 1996-07-10

Address: 8912 Hintz Shore, West Louie, AZ 69363-0747

Phone: +13454700762376

Job: Administration Technician

Hobby: Paintball, Horseback riding, Cycling, Running, Macrame, Playing musical instruments, Soapmaking

Introduction: My name is Arline Emard IV, I am a cheerful, gorgeous, colorful, joyous, excited, super, inquisitive person who loves writing and wants to share my knowledge and understanding with you.