0% found this document useful (0 votes)
163 views2 pages

Field Symbols New Syntax

The document discusses improvements to defining field symbols in ABAP. It notes that previously field symbols had to be defined separately before using them, but as of release 7.4 they can now be defined inline within loop and read statements for improved conciseness and readability of code. Examples are provided showing the old way of separately defining field symbols before a loop or read versus the new inline way within the statement.

Uploaded by

EEE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
163 views2 pages

Field Symbols New Syntax

The document discusses improvements to defining field symbols in ABAP. It notes that previously field symbols had to be defined separately before using them, but as of release 7.4 they can now be defined inline within loop and read statements for improved conciseness and readability of code. Examples are provided showing the old way of separately defining field symbols before a loop or read versus the new inline way within the statement.

Uploaded by

EEE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd

It sounds great, we improved the performance, but we still need to define them, before

using them. :(

1 FIELD-SYMBOLS <fs_flight_schedule> TYPE spfli.


2  
3 LOOP AT flight_schedules ASSIGNING <fs_flight_schedule>.
4   ...
5 ENDLOOP. 

NEW VERSION

From 7.4 SP02, we can define Field Symbols as embedded into the given context (for
example into a LOOP). It means, that our <fs_flight_schedule> field symbol is valid
only inside of the LOOP statement.

1 LOOP AT flight_schedules ASSIGNING FIELD-SYMBOL(<fs_flight_schedule>).


2   ...
3 ENDLOOP.

If we can perform inline field symbol declaration in case of LOOPs, then of course we
can use them in case of READ TABLE statements!

OLD VERSION

Before 7.4, we need to declare a field symbol separately, before using it.

1 FIELD-SYMBOLS <fs_flight> TYPE sflight.

2  
3 READ TABLE flights ASSIGNING <fs_flight> INDEX 1.

4 ...

NEW VERSION

The code speaks for itself!

1
READ TABLE flights ASSIGNING FIELD-SYMBOL(<fs_flight>) INDEX 1.
2

You might also like