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 Editable

Former Member
0 Likes
1,913

HI i am working on alv,in whcih i have alternate columns as editable,now in my display i will have only 10 rows.i want the entire 10th column with non editable fields,how can i do this plz let me know.

i made those fields above as editable by putting edit = 'x' for alternate columns.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
969

Hi...

although your quest..is not so clear i assume that you want to have some editable and some no-editable field in the same column...

if thats true ...here is the solution...

1.In your ALV internal table stucture include this filed

CELLTAB TYPE LVC_T_STYL

2. befor displaying loop the internal table...like



data : ls_celltab TYPE LVC_T_STYL

LOOP AT <table>  INTO <waork area>
LS_CELLTAB-FIELDNAME = 'COUNT'.  "fild name
    IF LS_RATE_ANL_TAB-ACT_NEW IS INITIAL. " condition
      LS_CELLTAB-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED. "uneditable 
    ELSE.
      LS_CELLTAB-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_ENABLED. "editable
    ENDIF.

    modify LS_CELLTAB from  TABLE <work area>-CELLTAB. "modify table using index

endloop..

3.put this in layout

GS_LAYOUT_F4-STYLEFNAME = 'CELLTAB'.

regards

vivek

Edited by: vivek jain on Jan 16, 2009 9:24 AM

7 REPLIES 7
Read only

Former Member
0 Likes
969

Do not process the changes made on any column in the 10th row..

Read only

Former Member
0 Likes
969

in field catalogue explicitly mention edit = ' ' for the 10th row

Edited by: Vikas Chinta on Jan 16, 2009 9:08 AM

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
969

Hi

No, you cant keep a single row as editable and rest as non-editable.

Only specified column or a set of columns can be editable but for all records, not in this way that you take field2 and field3 as editable for some records and for rest take field4 and field5 as editable.

But you can work for columns to be editable for all records being displayed.

Hope this solves your problem.

Thanks & Regards,

Tarun Gambhir

Read only

uwe_schieferstein
Active Contributor
0 Likes
969

Hello Kiran

Have a look at sample report ZUS_SDN_ALV_GRID_EDITABLE_FM in thread

The same solution can be applied for OO-based ALV.

Regards

Uwe

Read only

Former Member
0 Likes
969

check this link

thanks

Read only

Former Member
0 Likes
970

Hi...

although your quest..is not so clear i assume that you want to have some editable and some no-editable field in the same column...

if thats true ...here is the solution...

1.In your ALV internal table stucture include this filed

CELLTAB TYPE LVC_T_STYL

2. befor displaying loop the internal table...like



data : ls_celltab TYPE LVC_T_STYL

LOOP AT <table>  INTO <waork area>
LS_CELLTAB-FIELDNAME = 'COUNT'.  "fild name
    IF LS_RATE_ANL_TAB-ACT_NEW IS INITIAL. " condition
      LS_CELLTAB-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED. "uneditable 
    ELSE.
      LS_CELLTAB-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_ENABLED. "editable
    ENDIF.

    modify LS_CELLTAB from  TABLE <work area>-CELLTAB. "modify table using index

endloop..

3.put this in layout

GS_LAYOUT_F4-STYLEFNAME = 'CELLTAB'.

regards

vivek

Edited by: vivek jain on Jan 16, 2009 9:24 AM

Read only

Former Member
0 Likes
969

Hi kiran,

use input = 'X' of field catalog to display the column editable..

check out this sample code.. it works


REPORT  Y_SAMPLE.

****TABLE WORK AREA
TABLES:VBAK.

***SELECTION SCREEN***

SELECT-OPTIONS:S_VBELN FOR VBAK-VBELN. " Sales Doc

***DEFINE INTERNAL TABLE WITH HEADER LINE****

DATA:IT_JTAB LIKE VBAK OCCURS 0 WITH HEADER LINE.

****PROVIDE TYPE GROUP***

TYPE-POOLS:SLIS.

***MAINTAIN REPORT ID***

DATA:REPID LIKE SY-REPID,

****DEFINE COLUMN HEADING****

VBAK_B TYPE SLIS_T_FIELDCAT_ALV ,
fs like line of vbak_b.

****START-OF-SELECTION EVENT***
START-OF-SELECTION.


***FUNCTION MODULE COLUMN HEADINGS****

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING
I_STRUCTURE_NAME = 'VBAK'

CHANGING
Ct_fieldcat = VBAK_B.

data:  w_fnam(30) type c,
       t_fname like table of w_fnam with header line.
t_fname = 'VBELN'.
APPEND t_fname.

t_fname = 'ERZET'.
APPEND t_fname.
fs-input = 'X'.
modify vbak_b from fs
transporting input
where COL_POS eq: 2,4,6,8,10.   " to display first 10 columns in editable mode.
                                " here the first field is mandt so start from col2.

****REPORT ID SYSTEM VARIABLE****
REPID = SY-REPID.

SELECT * FROM VBAK INTO TABLE IT_JTAB WHERE VBELN in S_VBELN.

****FUNCTION MODULE OUTPUT DISPLAY***

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING
I_CALLBACK_PROGRAM = REPID
IT_FIELDCAT = VBAK_B
*IT_EVENTS = EVENTS_B

TABLES
t_outtab = IT_JTAB.
****END OF PROGRAM****

Regards,

Mdi.Deeba