All about Field-symbols..
This blog describes the advantages of using the field-symbols .
Internal table processing is essential part of any ABAP program. Generally, we use the explicit work area to process the internal table like appending & modifying records. We can reduce the time and improve the performance of the program by using the field-symbols
The below program will fetch the data from kna1 table with the field kunnr and name1.
It will modify the name1 field by adding “Mr.” infront of the name1 record.
Whenever we execute the loop at statement, the records from internal table will move to the work area and it will perform the required calculation and then the modified data will be updated to the internal table via modify statement . So this to and fro movement of data from internal table to the work area will take time. If there exists some milion number of records then it will have impact on loading performance.
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 can 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.
If we use the field-symbols,the to and fro movements of the records will not take place instead the records are modified directly in the internal table, as a result if there exists some millions of records then that records are modified directly in the internal table. As a result the loading performance will not have any impact.
In the above program, the modify statement is not present in the loop at statement, because the records are already modified in the internal table as a result the modify statement is not written.
Please debug the above program , you will get a clear idea on it.
Hope u got it,