ABAP Keyword Documentation → ABAP - Reference → Obsolete Language Elements → Obsolete Processing of External Data → Logical Databases (Obsolete) → Logical Databases - Components → Logical Databases - Further Elements
Logical Databases - Field Selections
The statement SELECTION-SCREEN
FIELD SELECTION FOR NODE|TABLE node specifies a node
node of a
logical database in the selection include for field selections. This means that individual columns can
be named in the
SELECT clause in the
of the corresponding subroutine
put_node, instead of just all columns with
*. This option is used to keep the amount of data passed from the database low and gives better performance than always reading the data from all columns in a database table.
The columns read for each node specified for field selections can be specified using the
addition of the statement
GET in the associated executable program or in
the parameter FIELD_SELECTION of the function module LDB_PROCESS. The database program of the logical
database has access to the names of the columns in the data object
This data object is generated automatically in the logical database program with reference to the type
rsfs_fields of the type group RSFS. The data object can also be used in every application program associated with the logical database program.
select_fields is a deep internal table with the components
fields. In each row, the column
contains the name of a node reserved for field selections. For each of these nodes, the table-like
fields contains the columns specified in the
statements of the application program. The table
fields is defined so that it can be used directly to specify columns dynamically in a
7.31 | 7.40 | 7.54
The database table SCARR is the root node of the logical database DEMO and the table SPFLI is the only successor. The selection include DBDEMOSEL contains the following lines:
SELECT-OPTIONS s_carrid FOR scarr-carrid.
SELECT-OPTIONS s_connid FOR spfli-connid.
SELECTION-SCREEN FIELD SELECTION FOR TABLE spfli.
put_spfli of the database program SAPDBDEMO uses the field selections as follows:
STATICS: fieldlists TYPE rsfs_tab_fields,
flag_read TYPE abap_bool.
IF flag_read = abap_false.
fieldlists-tablename = 'SPFLI'.
READ TABLE select_fields WITH KEY fieldlists-tablename
flag_read = abap_true.
INTO CORRESPONDING FIELDS OF spfli
WHERE carrid = scarr-carrid
AND connid IN s_connid.
The row of the internal table
select_fields for which the column
contains the value "SCARR" is read to the local helper structure
STATICS statements and the field
make sure that the table
select_fields only needs to be read once each time
the program is executed. The table
fieldlists-fields is used in the dynamic
SELECT clause. An executable program associated with the logical database can now contain the following lines:
GET spfli FIELDS cityfrom cityto.
FIELDS addition of the statement
which fields of the database table (except the primary key) are to be read by the logical database.
Internally, the runtime environment fills
select_fields with the appropriate values. These values can be checked in ABAP Debugger.