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: 

ALV GRID ONE LINE EDIT

Former Member
0 Kudos

Hi,

I have a ALV grid where I have a column as a editable. Now the problem is ALV grid is displaying 2 rows and only first line should be editable. Any idea how to do.

KK.

8 REPLIES 8

Former Member
0 Kudos

Hi,

Check out the program BCALV_EDIT_02 in the SLIS package. Input enabling is done at the cell level.

Regards,

Beejal

**Reward if this helps

0 Kudos

Hi,

In this display defualt list is coming as display, in my case its input enabled .

KK.

0 Kudos

Hello Krishna,

Probably you have made one of the columns editable through field catalog.You can make cells editable as per your requirement and not the entire column.

Regards,

Beejal

0 Kudos

This looks fine, can you tell me how it can be made.

0 Kudos

Hello Krishna,

I havent tried this before.What I suggest is that in the field catalog,dont make the columns editable as shown below:

ls_fcat-fieldname = 'CONNID'.

ls_fcat-ref_table = 'SPFLI'.

<b>ls_fcat-edit = ' '.</b>

APPEND ls_fcat TO pt_fieldcat.

CLEAR ls_fcat.

Now use the demo program given in my first post and modify only the cells that you need to change.

Hope this works.

Regards,

Beejal

Former Member
0 Kudos

chk this BCALV_EDIT_05

Former Member
0 Kudos

I THINK YOU CAN MAKE A FULL COLUMN EDITABLE THAT IS A FIELD IN ITAB.

IN FIELDCATALOG

JUST ADD THE CODE

WFIELDCAT-EDIT = 'X'.

FOR THAT PERTICULAR FIELD NAME.

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

1. * Type of final output table

TYPES : BEGIN OF ty_output.

INCLUDE STRUCTURE zjay_alv.

  • For cell editing and displaying cell as push button

TYPES : <b>cellstyles TYPE lvc_t_styl</b> ,

END OF ty_output.

data itab2 TYPE STANDARD TABLE OF ty_output.

2. w_layout-stylefname = 'CELLSTYLES' ."

3. CLEAR : wa2, w_style.

READ TABLE itab2 INTO wa2 index 2.

IF sy-subrc EQ 0.

w_style-fieldname = 'ERSDA'.

w_style-style = cl_gui_alv_grid=>mc_style_disabled.

REFRESH wa2-cellstyles.

APPEND w_style TO wa2-cellstyles.

MODIFY itab2 FROM wa2 TRANSPORTING cellstyles

WHERE matnr = wa2-matnr.

ENDIF.

4. CALL METHOD o_grid->set_table_for_first_display

EXPORTING

....

is_layout = w_layout

CHANGING

it_outtab = itab2

it_fieldcatalog = i_fieldcat.

Kindly reward points by clicking the star on the left of reply,if it helps.