1. MODIFY
LINE n.
2. MODIFY
LINE n OF CURRENT PAGE.
3.
MODIFY LINE n OF PAGE m.
4. MODIFY CURRENT LINE.
MODIFY LINE n.
1. ... INDEX
idx
2. ...
LINE FORMAT fmt1 ... fmtn
3. ... FIELD FORMAT f1 fmt11 ... fmt1m ... fn fmtn1 ... fmtnm
4. ...
LINE VALUE FROM wa
5. ... FIELD VALUE f1 FROM g1 ... fn FROM gn
Changes the nth ine of the list, usually following a line
selection (
AT LINE-SELECTION, AT
PFxx, AT USER-COMMAND).
The current contents
of the system field SY-LISEL is inserted into the list,
the HIDE area for the line is filled with the current
contents of the fields hidden by HIDE.
The Return Code is set as follows:
In a multi-level line selection, the last list from which a line was chosen is always the one to be
modified (exceptions: with the... INDEX idx and MODIFY CURRENT LINE additions. See below.)
System fields that are useful in interactive reporting are contained in the system fields for lists documentation.
... INDEX idx
Changes the corresponding line in the list at list level idx
(0, 1, 2, ...) where there is more than one list level. (SY-LSIND).
... LINE FORMAT fmt1 ... fmtn
The selected line takes the output format specified in fmt1,
fmt2 ... . For information about permitted format specifications, see FORMAT.
DATA I TYPE I VALUE 2.
WRITE: / 'Intensified' INTENSIFIED,
'Input' INPUT,
'color 1' COLOR 1,
'intensified off' INTENSIFIED OFF.
* Line selection
AT LINE-SELECTION.
MODIFY
CURRENT LINE
LINE FORMAT INVERSE
INPUT
OFF
COLOR = I.
Once you have selected the output list line (double-click), the whole line is set to
COLOR 2 and INVERSE;
all
INPUT fields are set to INPUT
OFF
. The attributes INTENSIFIED and INTENSIFIED OFF do not change, because the example does not address this attribute.
... FIELD FORMAT f1 fmt11 ... fmt1m ...
fn fmtn1 ... fmtnm
The output format of the field f1 is changed to the format
specified in fmt11 ... fmt1m.
For details of permitted
format specifications, see FORMAT.
Fields occurring more than once or not at all in the line are treated as in the FIELD VALUE addition.
If you combine the
LINE FORMAT and FIELD
FORMAT additions, the format set in LINE FORMAT is always assigned to the whole line. The individual field format specifications are applied afterwards.
DATA: FLAG VALUE 'X',
TEXT(20) VALUE
'Australia',
I TYPE I VALUE 7.
FORMAT INTENSIFIED OFF.
WRITE: / FLAG AS CHECKBOX, TEXT COLOR COL_NEGATIVE.
AT LINE-SELECTION.
MODIFY CURRENT LINE
LINE FORMAT INTENSIFIED
FIELD VALUE FLAG FROM SPACE
FIELD FORMAT FLAG INPUT OFF
TEXT COLOR = I.
When you choose the list line (double-click), the checkbox for FLAG
is reset (FIELD VALUE addition, see above), and it is
not ready for input. The format for the whole line is set to "intensive", and TEXT is displayed in a different color.
... LINE VALUE FROM wa
The current value of the field wa is placed in the list as the contents of a line.
You can use the LINE VALUE addition to modify the whole contents of the line. Instead of placing the new line contents in the system field SY-LISEL (length: 255 characters), you place it instead in a user-defined work area wa. It is thus independent of the attributes of SY-LISEL.
If you need a work area wa that is big enough for any width of list, choose type
SLIST_MAX_LISTLINE from type group SLIST.
... FIELD VALUE f1 FROM g1 ... fn FROM gn
The contents of the fields
f1, f2, ...
are overwritten in the list line with the current contents of fields g1,
g2, ... (type conversion as with MOVE
of g1, g2,
... to type C). The field contents of f1, f2, ... themseleves remain unchanged by the overwrite.
INCLUDE <ICON>.
DATA NEW_ICON LIKE ICON_SORT_DOWN VALUE ICON_SORT_DOWN.
. . .
WRITE
ICON_SORT_UP AS ICON.
. . .
AT LINE-SELECTION.
CALL FUNCTION 'LIST_ICON_PREPARE_FOR_MODIFY'
CHANGING
NEW_ICON = NEW_ICON.
MODIFY CURRENT LINE FIELD VALUE ICON_SORT_UP FROM NEW_ICON.
MODIFY LINE n OF CURRENT PAGE.
1. ... LINE FORMAT
fmt1 ... fmtn
2. ...
FIELD FORMAT f1 fmt11 ... fmt1m ... fn fmtn1 ... fmtnm
3. ...
LINE VALUE FROM wa
4. ... FIELD VALUE f1 FROM g1 ... fn FROM gn
Changes the nth line on the page displayed (system field SY-CPAGE).
... LINE FORMAT fmt1 ... fmtn
... FIELD FORMAT f1 fmt11 ... fmt1m
... fn fmtn1 ... fmtnm
... LINE VALUE FROM wa
... FIELD VALUE f1 FROM g1 ... fn FROM gn
siehe MODIFY LINE
MODIFY LINE n OF PAGE m.
1.
... LINE FORMAT fmt1 ... fmtn 2. ... FIELD
FORMAT f1 fmt11 ... fmt1m ... fn fmtn1 ... fmtnm
3. ...
LINE VALUE FROM wa
4. ... FIELD VALUE f1 FROM g1 ... fn FROM gn
Changes the nth line on page m.
... LINE FORMAT fmt1 ... fmtn
... FIELD FORMAT f1 fmt11 ... fmt1m ... fn fmtn1 ... fmtnm
... LINE VALUE FROM wa
... FIELD VALUE f1 FROM g1 ... fn FROM gn
siehe MODIFY LINE
MODIFY CURRENT LINE.
1.
... LINE FORMAT fmt1 ... fmtn 2. ... FIELD
FORMAT f1 fmt11 ... fmt1m ... fn fmtn1 ... fmtnm
3. ...
LINE VALUE FROM wa
4. ... FIELD VALUE f1 FROM g1 ... fn FROM gn
Changes the last line to be read using line selection or
READ LINE (even if that was in a different list level).
This variant is particularly useful whenever the line to be modified has definitely been chosen using
line selection or READ LINE.
You then do not need to note the number of lines to the MODIFY.
... LINE FORMAT fmt1 ... fmtn
... FIELD FORMAT f1 fmt11 ... fmt1m ... fn fmtn1 ... fmtnm
... LINE VALUE FROM wa
... FIELD VALUE f1 FROM g1 ... fn FROM gn
see MODIFY LINE
Modifying Lines in Lists