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

Update ALV grid

Former Member
0 Likes
516

Hi all,

I need to update 2 columns in an ALV grid but not in all the rows (meaning in rows that have a particular status

these columns will be disabled but in other rows with a different status these columns will be editable).

I'm using the TYPE-POOLS SLIS and not the objects method.

Thanks,

Hagit

1 ACCEPTED SOLUTION
Read only

anversha_s
Active Contributor
0 Likes
482

hi,

this problem excatly replicated in this link.

http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_editable.htm

simply chk it.

<i>pls close the thread if ur issue solve, after mark ing all hlpful answers</i>

rgds

anver

if hlped pls mark points

Message was edited by: Anversha s

hi,

this problem excatly replicated in this link.

http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_editable.htm

simply chk it.

<i>pls close the thread if ur issue solve, after mark ing all hlpful answers</i>

rgds

anver

if hlped pls mark points

Message was edited by: Anversha s

3 REPLIES 3
Read only

anversha_s
Active Contributor
0 Likes
483

hi,

this problem excatly replicated in this link.

http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_editable.htm

simply chk it.

<i>pls close the thread if ur issue solve, after mark ing all hlpful answers</i>

rgds

anver

if hlped pls mark points

Message was edited by: Anversha s

Read only

messier31
Active Contributor
0 Likes
482

Hi Hagit,

In the field catalog don't set the edit property for the field. i.e fieldcat-edit = ' '.

Now add a column in your data table.

DATA : BEGIN OF GT_GRID OCUURS 0,

.

.<i>Your other columns</i>

.

.

CELLSTYLES TYPE LVC_T_STYL

END OF GT_GRID.

Now you have to check for conditions on which particular cell of a column will be editable...

DATA: LS_GRID LIKE LINE OF GT_GRID,

LS_STYLE TYPE LVC_S_STYL,

LT_STYLE TYPE LVC_T_STYL.

LOOP AT GT_GRID INTO LS_GRID.

<i>* CONDITION TO CHECK FOR ROW</i>

IF LS_GRID-FIELD1 = <CONDTION>.

  • INSERTING FIELD NAME IN STYLE TABLE. YOU CAN EVEN

  • CHECK FOR SOME CONDITION

LS_STYLE-FIELDNAME = 'FIELD1'.

LS_STYLE-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_ENABLED.

APPEND LS_STYLE TO LT_STYLE.

ENDIF.

INSERT LINES OF LT_STYLE INTO LS_GRID-CELLSTYLES.

MODIFY GT_GRID FROM LS_GRID.

ENDLOOP.

Hope this helps you...

Enjoy SAP.

Pankaj Singh

Read only

Former Member
0 Likes
482

Hi Pankaj,

I have tryed as you suggested, but when I execute the program I get a short dump TABLE_ILLEGAL_STATEMENT, it happens when trying to INSERT LINES OF LT_STYLE INTO LS_GRID-CELLSTYLES.

Any ideas?

Thanks,

Hagit.