DATA - RANGE OF

来源:互联网 发布:c 编程主要应用 编辑:程序博客网 时间:2024/05/22 14:34

DATA -RANGE OF

Syntax

DATA rtab {TYPE RANGE OF type}|{LIKE RANGE OF dobj}
           [INITIAL SIZE n]
           [WITH HEADER LINE]
          [VALUE IS INITIAL]
          [READ-ONLY].

Effect

This statement defines a ranges tablertab with the table type described in the section TYPES -RANGE OF. The table type defined here, however, is not independent, but exists as a propertyof the data objectrtab.

The WITH HEADER LINE addition, which is not allowed withinABAP objects, declares an additionalheader line , as in the declaration of arbitrary internal tables in the section DATA -TABLE OF.

In the definition of a ranges table prior to Release 6.40, no start value could be specified with the addition VALUE. Since Release 6.40,IS INITIAL can be specified as a start value.

Note

The declaration of a ranges table with the statement RANGES is obsolete.

Example

In this example, a ranges table is declared, filled, and evaluated in the WHERE conditionof a SELECT statement.

DATA: spfli_wa TYPE spfli,
       r_carrid TYPE RANGE OF spfli-carrid,
       r_carrid_line LIKE LINE OF r_carrid.

r_carrid_line-sign   = 'I'.
r_carrid_line-option = 'BT'.
r_carrid_line-low     = 'AA'.
r_carrid_line-high   = 'LH'.
APPEND r_carrid_line TO r_carrid.

SELECT *
       FROM spfli
       INTO spfli_wa
       WHERE carrid IN r_carrid.
   ...
ENDSELECT.

原创粉丝点击