MODIFY - Change a list line

Variants



1. MODIFY LINE n.
2. MODIFY LINE n OF CURRENT PAGE.
3. MODIFY LINE n OF PAGE m.
4. MODIFY CURRENT LINE.

Variant 1

MODIFY LINE n.

Additions




1. ... INDEX idx
2. ... LINE FORMAT fmt1 ... fmtn
3. ... FIELD VALUE f1 FROM g1 ... fn FROM gn
4. ... FIELD FORMAT f1 fmt11 ... fmt1m ... fn fmtn1 ... fmtnm

Effect

Changes the n th line of the list. This could be, for example, after line selection ( AT LINE-SELECTION , AT PFxx , AT USER-COMMAND ).
The current contents of the system field SY-LISEL are restored to the list as the line contents and the HIDE area for the line is re-determined from the current contents of the fields hidden with HIDE .

The return code value is set as follows:


SY-SUBRC = 0 Line was successfully changed.
SY-SUBRC <> 0 Line does not exist.

Note

With multiple-level line selection, the modification is always performed in the list where the (last) line selection was made, except in the case of the addition ... INDEX idx and MODIFY CURRENT LINE (see below).

Addition 1

... INDEX idx

Effect

Changes the relevant line in the list to list level idx (0, 1, 2, ...) with multiple line selection ( SY-LSIND ).

Addition 2

... LINE FORMAT fmt1 ... fmtn

Effect

The output format of the selected line is determined by the format specifications fmt1 , fmt2 ... . For a list of valid format specifications, see FORMAT .

Example

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.

After you have selected the the output list line (by double-clicking), the whole line is set to COLOR 2 and INVERSE and all INPUT fields are set to INPUT OFF . The fields with the attribute INTENSIFIED or INTENSIFIED OFF retain this because the attribute is not addressed here.

Addition 3

... FIELD VALUE f1 FROM g1 ... fn FROM gn

Effect

Overwrites the contents of the fields f1 , f2 , ... in the list line with the current contents of the fields g1 , g2 , ... (type conversion as for MOVE g1 , g2 , ... to type C). The field contents of f1 , f2 , ... themselves remain unchanged.

Notes


Addition 4

... FIELD FORMAT f1 fmt11 ... fmt1m
... fn fmtn1 ... fmtnm

Effect

Modifies the output format of the field f1 according to the format specifications fmt11 ... fmt1m .
Similar to f2 , ..., fn . For a list of valid format specifications, see FORMAT . Fields that occur several times or not at all in the line are treated as in the addition FIELD VALUE .

Notes


Example

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 the user selects the displayed list line by double-clicking, the checkbox for FLAG is reset and can no longer accept values. The format of the entire line is set to "intensified" and TEXT is displayed in a different color.

Variant 2

MODIFY LINE n OF CURRENT PAGE.

Additions




1. ... FIELD VALUE f1 FROM g1 ... fn FROM gn
2. ... LINE FORMAT fmt1 .. fmtn
3. ... FIELD FORMAT f1 fmt11 ... fmt1m ... fn fmtn1 ... fmtnm

Effect

Changes the n th line on the current page (stored in the system field SY-CPAGE ).

Addition 1

... FIELD VALUE f1 FROM g1 ... fn FROM gn

Addition 2

... LINE FORMAT fmt1 .. fmtn

Addition 3

... FIELD FORMAT f1 fmt11 ... fmt1m
... fn fmtn1 ... fmtnm

Effect

See MODIFY LINE

Variant 3

MODIFY LINE n OF PAGE m.

Additions




1. ... FIELD VALUE f1 FROM g1 ... fn FROM gn
2. ... LINE FORMAT fmt1 ... fmtn
3. ... FIELD FORMAT f1 fmt11 ... fmt1m ... fn fmtn1 ... fmtnm

Effect

Changes the n th line on page m .

Addition 1

... FIELD VALUE f1 FROM g1 ... fn FROM gn

Addition 2

... LINE FORMAT fmt1 ... fmtn

Addition 3

... FIELD FORMAT f1 fmt11 ... fmt1m
... fn fmtn1 ... fmtnm

Effect

See MODIFY LINE

Variant 4

MODIFY CURRENT LINE.

Additions




1. ... FIELD VALUE f1 FROM g1 ... fn FROM gn
2. ... LINE FORMAT fmt1 ... fmtn
3. ... FIELD FORMAT f1 fmt11 ... fmt1m ... fn fmtn1 ... fmtnm

Effect

Changes the last line read (with line selection or READ LINE ), even across line levels. This variant is especially useful if the line to be modified has been read immediately before through line selection or using READ LINE . You then need to note the number of the line until the MODIFY .

Addition 1

... FIELD VALUE f1 FROM g1 ... fn FROM gn

Addition 2

... LINE FORMAT fmt1 ... fmtn

Addition 3

... FIELD FORMAT f1 fmt11 ... fmt1m
... fn fmtn1 ... fmtnm

Effect

See MODIFY LINE

Index
© SAP AG 1996