Controlling Write-Protection for the ALV Output
Use
You can depict the data in the ALV output using UI elements that allow the data to be changed. However, the ALV output is write-protected by default. To allow the user to change data, you must first remove this write-protection. If you remove the write-protection then it has the following effects:
-
UI elements (in cells, not in the toolbar) that permit data to be changed can be used.
-
The buttons for adding, attaching, and deleting rows as well as for checking data changes are visible in the toolbar.
To switch write-protection on or off, use the methods of the interface class IF_SALV_WD_TABLE_SETTINGS (implementing class CL_SALV_WD_CONFIG_TABLE).
Methods for the write-protection of the ALV output
|
Function |
Method |
|
Switch write-protection on/off |
SET_READ_ONLY |
|
Check whether write-protection is switched on/off |
GET_READ_ONLY |
Procedure
Remove write-protection
-
You get the ALV Configuration Model, as described in Getting ALV Configuration Model.
-
To remove the write-protection, add the following code:
lv_value->IF_SALV_WD_TABLE_SETTINGS~SET_READ_ONLY( ABAP_FALSE ).