Show TOC

Background documentationControlling Write-Protection for the ALV Output Locate this document in the navigation structure

 

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.

    Note Note

    If you remove the write protection of the ALV output, the system uses a specified color for the ALV output. You cannot then influence which colors are used for the ALV output. Specifications that you have made for the color of the ALV output are overwritten (see Color of ALV Output, Columns, and Cells).

    End of the note.

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

  1. You get the ALV Configuration Model, as described in Getting ALV Configuration Model.

  2. To remove the write-protection, add the following code:

    lv_value->IF_SALV_WD_TABLE_SETTINGS~SET_READ_ONLY( ABAP_FALSE ).