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 alv fields

Former Member
0 Kudos

Hi all.

I'm using the SET_TABLE_FOR_FIRST_DISPLAY method to display alv grid.

My question is how can I set up specific cells for editing or not.

The same columns can be editable at the first record and disable at the second.

Thanks in advance,

Rebeka

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

You need to use the attribute

Use attribute CL_GUI_ALV_GRID=>MC_STYLE_ENABLED to set a cell to status "editable".

Use attribute CL_GUI_ALV_GRID=>MC_STYLE_DISABLED to set a cell to status "non-editable".

Please check the program BCALV_EDIT_02.

Hope this helps you.

Thanks,

Ruthra

5 REPLIES 5

Former Member
0 Kudos

Hi,

You need to use the attribute

Use attribute CL_GUI_ALV_GRID=>MC_STYLE_ENABLED to set a cell to status "editable".

Use attribute CL_GUI_ALV_GRID=>MC_STYLE_DISABLED to set a cell to status "non-editable".

Please check the program BCALV_EDIT_02.

Hope this helps you.

Thanks,

Ruthra

Former Member
0 Kudos

Hi ,

If you want to edit the field in the alv report then you can specify the same in your fieldcatlog for which you have to specify Filedcat-input = 'X'. The example for the is given below :

CLEAR LS_FIELDCAT.

LS_FIELDCAT-FIELDNAME = 'KWMENG'.

LS_FIELDCAT-TABNAME = 'HEADER'.

LS_FIELDCAT-SELTEXT_L = 'SO Qty.'.

LS_FIELDCAT-INPUT = 'X'.

APPEND LS_FIELDCAT.

By this way you can keep the field as editable in a Alv report .

I hope this answers your question ....

Regards

Shankar

former_member181995
Active Contributor
0 Kudos

Check

BCALV_TEST_GRID_EDITABLE

check blog:

Former Member

uwe_schieferstein
Active Contributor
0 Kudos

Hello Rebeka

You will find all required information in the excellent tutorial

[An Easy Reference For ALV Grid Control|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907], pages 47ff

Please note that LVC_T_STYL is a sorted table type. Thus, you need to use INSERT ... INTO TABLE... statements instead of APPEND.

Regards

Uwe