Difference between Work area, global structure and internal table in SAP ABAP

SAPABAP

Internal tables let you read data from a fixed structure and stores it in-memory (working memory) in ABAP. The data is stored in a sequential manner in memory. They are basically equivalent to arrays but dynamic in nature. Since they are dynamic in nature, memory management is already taken care by ABAP. Usually, data read from database tables are stored in the internal table to exactly replicate the database tables.

Work Area refers to a single row of a fixed structure. It is basically used for storing temporary data. It is commonly used while iterating over a loop.

For ex. If you need to loop over an internal table, you can store the current record in a work area.

---------------
LOOP AT INTAB INTO WORKAREA.
ENDLOOP.
--------------

Here INTAB refers to an internal table and WORKAREA refers to a work area.

Global Structure as the name reflects is global in nature. It is a structure which is created for an info provider and then can be reused across all queries for the same info provider.

Published on 28-Dec-2017 13:20:53