Application Development and Automation 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: 
Read only

ALV Certain rows editable

Former Member
0 Likes
1,092

Hi All,

I have a requirement where in certain rows in ALV has to be made editable.

say 1st,5th row has to be editable all the rest has to be non editable. this will not be on the user request but predetermined.

Regards

Raghavendra

11 REPLIES 11
Read only

Former Member
0 Likes
1,036

if it is oo grid then

set the fieldcat-edit = 'X'. for that field.

if it is grid/list then

set the fieldcat-input = 'X'. for that field.

Read only

Former Member
0 Likes
1,036

for 1st,5th fields specify fieldcat-edit = 'X' or

fieldcat-input= 'X'. depending on the alv..

regards

vijay

Read only

0 Likes
1,036

Hi vijay,

it's not the fields.it's the rows that have to be made editable.

Regards

Raghavendra

Read only

0 Likes
1,036

ok sorry that is also possible, but i wanted to know

alv list/grid/classes you are using...

which one you are using...

regards

vijay

Read only

0 Likes
1,036

Hi vijay,

I'm still looking on which one would be the best option,

i think oo classes will be good one, to track the data changes as well.

Regards

Raghavendra

Read only

0 Likes
1,036

You have choosen the correct one...

once you say ok i will start telling the steps..

Read only

0 Likes
1,036

Hi Vijay,

tell me the steps to change certain rows in OO ALV.

Regards

Raghavendra

Read only

0 Likes
1,036

first you need to declare the one extra field in the internal table..

1. HANDLE_STYLE TYPE LVC_T_STYL.

DECLARE work area,and table
2.  DATA: LS_EDIT TYPE LVC_S_STYL, 
        LT_EDIT TYPE LVC_T_STYL.

changing the style...
3.
LOOP AT IT_FINAL INTO LS_OUTTAB WHERE FLAG = 'X'.
    V_INDEX = SY-TABIX.
    LS_EDIT-FIELDNAME = 'MATNR'.
    LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_ENABLED.
    LS_EDIT-STYLE2 = SPACE.
    LS_EDIT-STYLE3 = SPACE.
    LS_EDIT-STYLE4 = SPACE.
    LS_EDIT-MAXLEN = 8.
    INSERT LS_EDIT INTO TABLE LT_EDIT.
    LS_EDIT-FIELDNAME = 'VBELN'.
    LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_ENAABLED.
    LS_EDIT-STYLE2 = SPACE.
    LS_EDIT-STYLE3 = SPACE.
    LS_EDIT-STYLE4 = SPACE.
    LS_EDIT-MAXLEN = 8.
    INSERT LS_EDIT INTO TABLE LT_EDIT.
    LS_EDIT-FIELDNAME = 'POSNR'.
    LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_ENABLED.
    LS_EDIT-STYLE2 = SPACE.
    LS_EDIT-STYLE3 = SPACE.
    LS_EDIT-STYLE4 = SPACE.
    LS_EDIT-MAXLEN = 8.
    INSERT LS_EDIT INTO TABLE LT_EDIT.
    INSERT LINES OF LT_EDIT INTO TABLE LS_OUTTAB-HANDLE_STYLE.
    MODIFY IT_FINAL INDEX V_INDEX FROM LS_OUTTAB  TRANSPORTING
                                      HANDLE_STYLE .

  ENDLOOP.
assigning the style to Layout..
4.   GS_LAYOUT-STYLEFNAME = 'HANDLE_STYLE'.

regards

vijay

Read only

0 Likes
1,036

Hi Raghava,

Please refer the demo program

<b>BCALV_EDIT_02</b>.

Thanks & Regards,

Siri.

Read only

Former Member
0 Likes
1,036

Hello everybody,

I have the same requirement, to make one field on some rows editable and in another rows non editable, but I'm using ALV grid display.

Read only

0 Likes
1,036

hi,

please reward for helpful answers....

regards

vijay

Message was edited by: Vijay Babu Dudla