Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

EDIT GRID ROW

Former Member
0 Kudos

Hi

i displayed jtab in grid, i m using abap objects

jtab having few fields. i m making <b>2 fields input disabled(</b>still displayed)

then I M adding a new row to the grid, now how can i make all the fields of new row editable

Thanks in advance

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos

Hello M B

You probably have to define the editability at the

cell level

. For a sample report please refer to

BCALV_EDIT_02

.

PROGRAM BCALV_EDIT_02.
*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
* Purpose:
* ~~~~~~~~
* This report illustrates how to set chosen cells of an
* ALV Grid Control editable. (See BCALV_EDIT_01 for an overview
* of possible states).
* Remark: You may set the states for chosen columns using field
*         EDIT of the fieldcatalog, see BCALV_EDIT_03.
*-----------------------------------------------------------------
* To check program behavior
* ~~~~~~~~~~~~~~~~~~~~~~~~~
* Switch to the state editable and ready for input.
* You may then change the
* price of flights where the capacity of a plane is greater or equal
* than 300 seats.
*-----------------------------------------------------------------
* Essential steps (search for '§')
* ~~~~~~~~~~~~~~~
* 1.Extend your output table for a field, e.g., CELLTAB, that holds
*   information about the edit status of each cell for the
*   corresponding row (the table type is SORTED!).
* 2.After selecting data, set edit status for each row in a loop
*   according to field SEATSMAX.
* 2a.Use attribute CL_GUI_ALV_GRID=>MC_STYLE_ENABLED to set a cell
*    to status "editable".
* 2b.Use attribute CL_GUI_ALV_GRID=>MC_STYLE_DISABLED to set a cell
*    to status "non-editable".
* 2c.Copy your celltab to the celltab of the current row of gt_outtab.
* 3.Provide the fieldname of the celltab field by using field
*   STYLEFNAME of the layout structure.
*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

Regards

Uwe

4 REPLIES 4

uwe_schieferstein
Active Contributor
0 Kudos

Hello M B

You probably have to define the editability at the

cell level

. For a sample report please refer to

BCALV_EDIT_02

.

PROGRAM BCALV_EDIT_02.
*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
* Purpose:
* ~~~~~~~~
* This report illustrates how to set chosen cells of an
* ALV Grid Control editable. (See BCALV_EDIT_01 for an overview
* of possible states).
* Remark: You may set the states for chosen columns using field
*         EDIT of the fieldcatalog, see BCALV_EDIT_03.
*-----------------------------------------------------------------
* To check program behavior
* ~~~~~~~~~~~~~~~~~~~~~~~~~
* Switch to the state editable and ready for input.
* You may then change the
* price of flights where the capacity of a plane is greater or equal
* than 300 seats.
*-----------------------------------------------------------------
* Essential steps (search for '§')
* ~~~~~~~~~~~~~~~
* 1.Extend your output table for a field, e.g., CELLTAB, that holds
*   information about the edit status of each cell for the
*   corresponding row (the table type is SORTED!).
* 2.After selecting data, set edit status for each row in a loop
*   according to field SEATSMAX.
* 2a.Use attribute CL_GUI_ALV_GRID=>MC_STYLE_ENABLED to set a cell
*    to status "editable".
* 2b.Use attribute CL_GUI_ALV_GRID=>MC_STYLE_DISABLED to set a cell
*    to status "non-editable".
* 2c.Copy your celltab to the celltab of the current row of gt_outtab.
* 3.Provide the fieldname of the celltab field by using field
*   STYLEFNAME of the layout structure.
*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

Regards

Uwe

0 Kudos

Thank you very much,

for this requirement, we have to do at <b>CELL LEVEL</b>.

if i m clear with ur answer; when i add a row i have to work with each cell of new row and make it editable.

is there any possibility that we can make the complete row editable

to be more clear, i want to do at <b>row level, </b>not at cell level.

I am also working on this. so far no hit.

Thanks

MB

0 Kudos

Hi,

Using the structure LVC_S_STYL and the attribute MC_STYLE_ENABLED of the class CL_GUI_ALV_GRID you can make some rows editable and some rows non editable.

Check the report BCALV_EDIT_04 is the package SLIS.

In the report check the subroutine: fill_celltab.

Regards,

Sesh

0 Kudos

Hi

I tried this property as uwe said, it is a solution at cell level, i am expecting at row level.

Thanks,

MB