07-10-2018 11:06 AM
Hi,
I have created a ALV grid using the class CL_GUI_ALV_GRID and it has a editable column. Now I want to add a new row once the "Add Row" button clicked and in that row all the columns should be editable. Is there any possibility to do that?
07-10-2018 3:44 PM
07-11-2018 10:07 AM
07-12-2018 10:33 AM
I think you need to write some code to make row editable after insert. check the logic to make column editable when ALV initial.
03-17-2020 12:30 PM
Please use the COMMENT button for comments, questions, adding details, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area.
07-11-2018 10:21 AM
03-17-2020 7:26 AM
03-17-2020 7:31 AM
Use of CL_GUI_ALV_GRID=>MC_STYLE_ENABLED on every cell of the added row, or at least on every required field.
03-17-2020 12:14 PM
Or once by defining FIELDNAME = space.
PS: the ALV table must contain a column of type LVC_T_STYL, its value must be set for the added row with values for FIELDNAME and STYLE, the method SET_TABLE_FOR_FIRST_DISPLAY must be called with structured parameter IS_LAYOUT having component STYLEFNAME = name of the column of type LVC_T_STYL.
03-17-2020 12:41 PM
The rows added with the standard NEW button will take the editable mode (enabled or disabled) of the edit mode of the whole ALV Grid (component EDIT of parameter IS_LAYOUT of method SET_TABLE_FOR_FIRST_DISPLAY).
So the solution is:
NB: to use ALV styles, the ALV table must contain a column of type LVC_T_STYL, its value must be set for the added row with values for FIELDNAME and STYLE, the method SET_TABLE_FOR_FIRST_DISPLAY must be called with structured parameter IS_LAYOUT having component STYLEFNAME = name of the column of type LVC_T_STYL.