Thursday 14 December 2017

How to Use FIELD SYMBOLS in ABAP PROGRAM


INTRODUCTION : A field symbol (in SAP) is a mechanism in which applications are created with flexibility.
 As placeholders that do not reserve physical data field space but direct and point to its contents,Field symbols are similar to dereferenced pointers in C (that is, pointers to which the content operator * is applied).
Internal table processing is essential part of any ABAP program.
Generally, we use the explicit work area to process the internal table like append & modifying records.
We can reduce the time and improve the performance of the program by using the field-symbols.

In programs, field symbols are identified by angle brackets, which are part of the field symbol syntax.
Field symbols may be created with or without type specifications.
If the type is not declared, the field symbol inherits all technical characteristics of the assigned field.
If the type is specified, the field symbol and data object type compatibility is checked in the ASSIGN statement.

EXAMPLE :


OUTPUT:

Assigning Components of Structures to a Field Symbol:
SYNTAX:
ASSIGN COMPONENT compo OF STRUCTURE struct TO <fs>.

EXAMPLE :

OUTPUT:



Advantages of Field Symbols :


When you read from an internal table, there are no overheads for copying the table line to the work area.
When you change an internal table with the MODIFY statement, you must first fill a work area with values,
and then assign them to the internal table. If you work with field symbols instead, you do not have this overhead.

This can improve performance if you have large or complex internal tables. It also makes it easier to process nested internal tables.




No comments:

Post a Comment

In this post we use some basics Events  and Control Break Statements for Generating Classical Report Based On single Table. If You want so...