Documente Academic
Documente Profesional
Documente Cultură
Dec-2008
Objectives
Dec-2008
Dec-2008
CHECK
SY-SUBRC
The ABAP SELECTENDSELECT
statement takes data from the specified
table (data source) and places it, one
record at a time, into the work area.
DATA
SOURCE
RECORD # 1
Dec-2008
SELECT *
CHECK
SY-SUBRC
DATA
SOURCE
RECORD # 2
RECORD # 1
No Longer Available
5
Dec-2008
INTERNAL TABLE
RECORD # 1
RECORD # 6
RECORD # 2
LFA1 WORK AREA
RECORD # 3
RECORD # 4
RECORD # 5
APPEND ITAB
Dec-2008
BEFORE
AFTER
RECORD # 3
CLEAR LFA1.
LFA1 WORK AREA
INTERNAL TABLE
RECORD # 1
INTERNAL TABLE
REFRESH ITAB.
RECORD # 2
RECORD # 3
Dec-2008
Demonstration
Using Workareas and Internal tables.
Dec-2008
Practice
Using Workareas and Internal tables.
Dec-2008
Summary
TABLES statement in ABAP creates a workarea for the database table specified.
Workareas can hold only one record during the program execution whereas, an
Internal table can hold multiple records at a time.
For the above reason, when we have to retrieve multiple entries from the
database, we should be using internal tables instead of an workarea. Because
use of workarea will mean we have get the data from database multiple times.
CLEAR statement deletes the content of workarea. It can be used to initialize the
header line of an internal table as well.
REFRESH statement wipes off the contents of the internal table.
10
Dec-2008
Questions
What is the difference between a workarea and an internal table ?
Which of these (workarea vs. Internal table) is better to use in our program when
we need to retrieve multiple records ?
What are the statements to initialize workareas and internal tables ?
11
Dec-2008