‎2005 Dec 17 5:48 AM
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
‎2005 Dec 17 5:50 AM
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.
‎2005 Dec 17 5:52 AM
for 1st,5th fields specify fieldcat-edit = 'X' or
fieldcat-input= 'X'. depending on the alv..
regards
vijay
‎2005 Dec 17 6:03 AM
Hi vijay,
it's not the fields.it's the rows that have to be made editable.
Regards
Raghavendra
‎2005 Dec 17 6:06 AM
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
‎2005 Dec 17 6:09 AM
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
‎2005 Dec 17 6:10 AM
You have choosen the correct one...
once you say ok i will start telling the steps..
‎2005 Dec 17 6:13 AM
Hi Vijay,
tell me the steps to change certain rows in OO ALV.
Regards
Raghavendra
‎2005 Dec 17 6:24 AM
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
‎2006 Feb 24 11:00 AM
Hi Raghava,
Please refer the demo program
<b>BCALV_EDIT_02</b>.
Thanks & Regards,
Siri.
‎2006 Feb 23 7:12 PM
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.
‎2006 Feb 23 7:21 PM
hi,
please reward for helpful answers....
regards
vijay
Message was edited by: Vijay Babu Dudla