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

Difference between a structure and a field symbol?

Former Member
0 Likes
1,627

Hi,

What is the difference between:

LOOP AT itab INTO itab_structure

or

LOOP AT itab ASSIGNING <fs_lineof_itab>

what is the difference between a structure and a field symbol?

regards

Baran

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
914

HI,

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

The central definition of structures that are used more than once makes it possible for them to be changed centrally. The active ABAP Dictionary then makes this change wherever required. ABAP programs or screen templates that use a structure are automatically adjusted when the structure is changed.

There are Flat, nested and deep structures. A flag structure only references elementary types. A nested structure references at least one further structure, but not a table type. A deep structure references at least one table type.

Field symbols: are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol cam point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.

Whenever you address a field symbol in a program, you are addressing the field that is assigned to the field symbol. After successful assignment, there is no difference in ABAP whether you reference the field symbol or the field itself. You must assign a field to each field symbol before you can address the latter in programs.

Regards,

Laxmi.

Hi,

What is the difference between:

LOOP AT itab INTO itab_structure

or

LOOP AT itab ASSIGNING <fs_lineof_itab>

what is the difference between a structure and a field symbol?

regards

Baran

2 REPLIES 2
Read only

Former Member
0 Likes
914

field symbol is like pointer pointing to that data , or place holders or symbolic names to other fields.

structure is a record where it will store one physical record.

Read only

Former Member
0 Likes
915

HI,

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

The central definition of structures that are used more than once makes it possible for them to be changed centrally. The active ABAP Dictionary then makes this change wherever required. ABAP programs or screen templates that use a structure are automatically adjusted when the structure is changed.

There are Flat, nested and deep structures. A flag structure only references elementary types. A nested structure references at least one further structure, but not a table type. A deep structure references at least one table type.

Field symbols: are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol cam point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.

Whenever you address a field symbol in a program, you are addressing the field that is assigned to the field symbol. After successful assignment, there is no difference in ABAP whether you reference the field symbol or the field itself. You must assign a field to each field symbol before you can address the latter in programs.

Regards,

Laxmi.