ABAP/4   ОКМ   ДМ   экономическая информатика   4GL   Теория и практика обработки информации

Компьютерный язык ABAP/4 - ключевые слова

READ - Read a list line

Variants

1. READ LINE lin.
2. READ LINE lin OF CURRENT PAGE.
3. READ LINE lin OF PAGE pag.
4. READ CURRENT LINE.

Variant 1

READ LINE lin.

Additions




1. ... INDEX idx
2. ... FIELD VALUE f1 INTO g1
...
fm INTO gm

Effect

Reads line no. lin in the list, for instance by line selection ( AT LINE-SELECTION , AT PFxx, AT USER-COMMAND ).
Places the read line in the field SY-LISEL and automatically restores all 'hidden' information (see HIDE ) to the original fields.
Sets the output format of the read line for all subsequent MODIFY LINE and WRITE statements.

The return code value is set as follows:


SY-SUBRC = 0 Line exists
SY-SUBRC <> 0 Line does not exist

Addition 1

... INDEX idx

Effect

With multiple line selection, reads the line from the list generated in level idx (0,1,2,...).

Addition 2

... FIELD VALUE f1 INTO g1
...
fm INTO gm

Effect

Transports the contents of the fields f1 , f2 , ... from the read list line to the fields g1 , g2 , ... . (The field contents stored in the list line always have the type C; type conversion is the same as for MOVE .)

Note

All formatting characters in the list output of f1 , f2 , ... count as field contents. If a field is output several times on the selected line, only the first occurrence is taken into account. If the field (such as f2 ) is not output on the line at all, the field g2 remains unchanged. The addition INTO g2 , for example, can be omitted if the field contents are to be restored to the original field (e.g. f2 ), i.e.
... FIELD VALUE ... f2

has the same effect as
... FIELD VALUE ... f2 INTO f2

Since the return code value in SY-SUBRC is not affected by the addition FIELD VALUE , it depends only on the existence of the selected list line.

Note

The addition FIELD VALUE is especially suitable for processing user input in list fields (see FORMAT , WRITE ) in the program. (Field contents entered by the user cannot be addressed with HIDE .)

Example

You can make a line "selectable" with
DATA MARKFIELD(1) TYPE C. ... WRITE: / MARKFIELD INPUT, 'Text'.

After line selection, you can use
CLEAR MARKFIELD. READ LINE SY-CUROW FIELD VALUE MARKFIELD.

in the program to check whether the user has selected the line or not ( IF MARKFIELD = SPACE ... ).

Variant 2

READ LINE lin OF CURRENT PAGE.

Additions



As with variant READ LINE

Effect

As with variant READ LINE lin . The line number lin refers to the current page (as specified in the system field SY-CPAGE at the beginning of the current event. If the contents of SY-CPAGE is changed by the application program, this does not affect the display.)

Notes

With multiple level line selection, the read operation is always take place in the list where line selection was performed.
When returning from line selection, the system always resets the positioning to the last page displayed. (For scrolling purposes, you can use the SCROLL statement.)

Variant 3

READ LINE lin OF PAGE pag.

Additions


As with variant READ LINE

Effect

As with variant 2, but reads the page pag instead of the current page.

Variant 4

READ CURRENT LINE.

Addition


... FIELD VALUE f1 INTO g1
...
fm INTO gm

Effect

Reads the last line to be read (by line selection or with READ LINE ) once again. You can use this variant, for example, in connection with the addition FIELD VALUE (see below) .u.) if you want to retrieve field contents from the selected line (in cases where you cannot retrieve from the HIDE area).

Addition

... FIELD VALUE f1 INTO g1
...
fm INTO gm

Effect

See addition 2 of the variant READ LINE lin

Index
© SAP AG 1996
ABAP/4   ОКМ   ДМ   экономическая информатика   4GL   Теория и практика обработки информации

НОВОСТИ ФОРУМА

Форум Рыцари теории эфира


Рыцари теории эфира
 10.11.2021 - 12:37: ПЕРСОНАЛИИ - Personalias -> WHO IS WHO - КТО ЕСТЬ КТО - Карим_Хайдаров.
10.11.2021 - 12:36: СОВЕСТЬ - Conscience -> РАСЧЕЛОВЕЧИВАНИЕ ЧЕЛОВЕКА. КОМУ ЭТО НАДО? - Карим_Хайдаров.
10.11.2021 - 12:36: ВОСПИТАНИЕ, ПРОСВЕЩЕНИЕ, ОБРАЗОВАНИЕ - Upbringing, Inlightening, Education -> Просвещение от д.м.н. Александра Алексеевича Редько - Карим_Хайдаров.
10.11.2021 - 12:35: ЭКОЛОГИЯ - Ecology -> Биологическая безопасность населения - Карим_Хайдаров.
10.11.2021 - 12:34: ВОЙНА, ПОЛИТИКА И НАУКА - War, Politics and Science -> Проблема государственного терроризма - Карим_Хайдаров.
10.11.2021 - 12:34: ВОЙНА, ПОЛИТИКА И НАУКА - War, Politics and Science -> ПРАВОСУДИЯ.НЕТ - Карим_Хайдаров.
10.11.2021 - 12:34: ВОСПИТАНИЕ, ПРОСВЕЩЕНИЕ, ОБРАЗОВАНИЕ - Upbringing, Inlightening, Education -> Просвещение от Вадима Глогера, США - Карим_Хайдаров.
10.11.2021 - 09:18: НОВЫЕ ТЕХНОЛОГИИ - New Technologies -> Волновая генетика Петра Гаряева, 5G-контроль и управление - Карим_Хайдаров.
10.11.2021 - 09:18: ЭКОЛОГИЯ - Ecology -> ЭКОЛОГИЯ ДЛЯ ВСЕХ - Карим_Хайдаров.
10.11.2021 - 09:16: ЭКОЛОГИЯ - Ecology -> ПРОБЛЕМЫ МЕДИЦИНЫ - Карим_Хайдаров.
10.11.2021 - 09:15: ВОСПИТАНИЕ, ПРОСВЕЩЕНИЕ, ОБРАЗОВАНИЕ - Upbringing, Inlightening, Education -> Просвещение от Екатерины Коваленко - Карим_Хайдаров.
10.11.2021 - 09:13: ВОСПИТАНИЕ, ПРОСВЕЩЕНИЕ, ОБРАЗОВАНИЕ - Upbringing, Inlightening, Education -> Просвещение от Вильгельма Варкентина - Карим_Хайдаров.
Bourabai Research - Технологии XXI века Bourabai Research Institution