Show TOC Start of Content Area

Access Methods to Individual Table Entries  Locate the document in its SAP Library structure

There are three ways to access a single table entry:

Access Using a Work Area

When you access individual table entries using a work area, you are not working directly with the data in the table. Instead, you work with another data object as a work area. The work area is an interface to the entries in the internal table, and must be convertible into the line type of the internal table. The most efficient working method is to use a work area compatible with the line type of the internal table. When you read data from a table record, the data you are reading overwrites the current contents of the work area. You can then use this data in the program. When you write data to the internal table, this must first be placed in the work area. The system then transfers it from the work area to the appropriate table entry. Data transfer follows the rules of assigning data using MOVE.

This graphic is explained in the accompanying text

If the internal table has a header line, you can use it as the work area. The ABAP statements that you use to access individual table entries can use the header line implicitly as a work area.

Access Using Field Symbols

If you access an internal table using a field symbol , you do not need to copy the data into a work area. You can assign a line of an internal table to a field symbol. Ideally, the field symbol will have the same type as the line type of the internal table. Once you have assigned the entry to the field symbol, working with the field symbol has exactly the same effect as accessing the corresponding line directly.

This graphic is explained in the accompanying text

Access via Data References

If you access an internal table using a data reference, you do not need to copy the data into a work area. You can assign a line of an internal table to a data reference. Ideally, the data reference will have the same type as the line type of the internal table. Once you have assigned the entry to the field symbol, working with the dereferenced data reference has exactly the same effect as accessing the corresponding line directly.

This graphic is explained in the accompanying text

 

 

End of Content Area