sapdev logo background
sapdev logo sapdev logo
Comments

ABAP MODIFY LINE Statement syntax, information and example SAP source code



Return to Statement index



MODIFY LINE

Short Reference

ABAP Syntax MODIFY { {LINE line [OF {PAGE page}|{CURRENT PAGE}]
[INDEX idx]}
| {CURRENT LINE} }
[ source ].

ABAP_ADDITIONS:
1 ... LINE line [{OF PAGE page }|{OF CURRENT PAGE}] [INDEX idx]
2 ... CURRENT LINE

What does it do? This statement overwrites a line saved in the list buffer with the content of the sy-lisel system field and permits additional modifications as specified in source . In addition, all values for this row stored with HIDE are assigned to the respective variables.
The first output of a data object in the list buffer with the WRITE statement defines the output length, which cannot be changed by the MODIFY statement. The MODIFY
statement ignores any output alignments
that are specified for the output with WRITE and CENTERED , RIGHT-JUSTIFIED .

System Fields
sy-subrc Meaning
0The specified line exists and was changed.
Not 0The specified line does not exist.

Latest notes:
We recommend that the system field sy-lisel is filled before the statement MODIFY LINE is executed with the content of the list line to be changed, and then the line is modified exclusively using the information in source , not by changing sy-lisel . The sy-lisel system field is filled either using list events or with the READ LINE statement.
For modifying icons and quick info in list lines, the LIST_ICON_PREPARE_FOR_MODIFY and
LIST_MODIFY_QUICKINFO function modules can be used.

ABAP_ADDITION_1 ... LINE line [{OF PAGE page }|{OF CURRENT PAGE}] [INDEX idx]

ABAP_ADDITION_2 ... CURRENT LINE

What does it do? The line to be changed is specified using the addition LINE or CURRENT LINE . The syntax and description of the additions are the same as for the READ LINE
statement.

Example ABAP Coding When a line in the basic list is double-clicked, the background of the number displayed becomes yellow, and the background of the remaining line becomes green.
START-OF-SELECTION.
DO 10 TIMES.
WRITE / sy-index.
ENDDO.

AT LINE-SELECTION.
MODIFY CURRENT LINE FIELD FORMAT sy-index COLOR 3
LINE FORMAT COLOR 5.
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved




MODIFY_ITAB_TABLE_KEY
MODIFY_LINE_MODIFICATION




comments powered by Disqus