Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

reg : structure

Former Member
0 Likes
839

can anybody tell..

what are the types of structure ?

give brief and one example for each type ?

6 REPLIES 6
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
811

In the abap dictionary, a structure is a single object, there are no types of structures.

Regards,

RIch Heilman

Read only

Former Member
0 Likes
811

Hi Selva,

We have two types of structures.

1. Local : Local Structures are the one created in our Programs using SE38.

Ex:

Types: Begin of Rec1,

var1(10) type c,

var2(10) type n,

end of Rec1.

2. Global : Global Structures are the ones created in Dictionary.

Ex:

Data Rec1 like komp.

Hope this helps.

Please reward if useful.

Thanks,

Srinivasa

Read only

Former Member
0 Likes
811

flat structure, deep structure & nested structure.

Flat structure is a structure with elementary data type.

if a structure have internal table,string declaration its Deep structure

if a structure has a structure declaration inside it its nested structure.

data : begin of a,

field(3),

end of a.

Data : begin of b,

field type string,

end of b.

data : begin of c,

field like spfli,

end of c.

Read only

Former Member
0 Likes
811

Hi,

In ABAP, the structure is a single object.

It can be either an internal table, or a database table.

Thanks and regards,

Prerna

Read only

Former Member
0 Likes
811

Hi Selva,

Structures:

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

Structures can also be defined in the Data Dictionary. As you might expect, a structure is a series of fields grouped together under a common name. It is very similar to a table. Like a table, it can be used within a program on the tables statement to define a work area.

The differences between a structure and a table are as follows:

A structure doesn't have an associated database table.

A structure doesn't have a primary key.

A structure doesn't have technical attributes.

Structures follow the same naming conventions as transparent tables, and you cannot have a table and structure of the same name.

You would create a structure in the DDIC if you wanted to define the same work area in multiple programs. For example, if you wanted to write records to a sequential file using one ABAP/4 program and then read them in using another, both programs need to know the layout of those records. You would create a structure in the DDIC that defines the record layout, and then name that structure on the tables statement in both programs. This would create an identical work area in both programs.

The procedure for creating a structure is almost the same as for creating a transparent table. (Please refer to the procedures for creating a transparent table.) The only differences are the following:

Instead of the Tables radio button, choose the Structures radio button.

The Delivery Class and Tab.Maint.Allowed fields do not appear.

Structures do not have a primary key.

No technical attributes can be specified, such as data class, size category, or buffering.

Hope this resolves your query.

Reward all the helpful answers.

Regards

Read only

Former Member
0 Likes
811

Hi Selva,

We have two types of structures.

1. Local : Local Structures

Ex:

Types: Begin of ty_mara,

matnr(10) type c,

makt(10) type c,

end of ty_mara.

2. Global : Global Structures are the ones created in Data Dictionary(Through SE11).

DATA TYPE : GIVE THE STRUCTURE NAME

AND CREATE.....

Thanks,

Purshoth