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 cell editing

Former Member
0 Likes
780

Hi ,

can anybody tell me how to make a cell editable in alvgrid .

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
742

HI PLZ CHECK THE FOLLOWING CODE.

In the field catalogue, change the attributes of that field as editable

fcat-edit = 'X'.

After creating the grid, register event entered and modified

  • Create alv grid

CREATE OBJECT w_grid_vend

EXPORTING

i_parent = w_vend_contnr

EXCEPTIONS

error_cntl_create = 1

error_cntl_init = 2

error_cntl_link = 3

error_dp_create = 4

others = 5.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

  • Register edit event

CALL METHOD w_grid_vend->register_edit_event

EXPORTING

i_event_id = cl_gui_alv_grid=>mc_evt_enter

EXCEPTIONS

error = 1

OTHERS = 2.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

  • Edit event for modified

CALL METHOD w_grid_vend->register_edit_event

EXPORTING

i_event_id = cl_gui_alv_grid=>mc_evt_modified

EXCEPTIONS

error = 1

OTHERS = 2.

Handle the changed data in the methods

  • Handle data changed

METHODS handle_data_changed FOR EVENT data_changed

OF cl_gui_alv_grid

IMPORTING er_data_changed.

ALL THE BEST PRIYANKA

DO REWARD POINTS

HI PLZ CHECK THE FOLLOWING CODE.

In the field catalogue, change the attributes of that field as editable

fcat-edit = 'X'.

After creating the grid, register event entered and modified

  • Create alv grid

CREATE OBJECT w_grid_vend

EXPORTING

i_parent = w_vend_contnr

EXCEPTIONS

error_cntl_create = 1

error_cntl_init = 2

error_cntl_link = 3

error_dp_create = 4

others = 5.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

  • Register edit event

CALL METHOD w_grid_vend->register_edit_event

EXPORTING

i_event_id = cl_gui_alv_grid=>mc_evt_enter

EXCEPTIONS

error = 1

OTHERS = 2.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

  • Edit event for modified

CALL METHOD w_grid_vend->register_edit_event

EXPORTING

i_event_id = cl_gui_alv_grid=>mc_evt_modified

EXCEPTIONS

error = 1

OTHERS = 2.

Handle the changed data in the methods

  • Handle data changed

METHODS handle_data_changed FOR EVENT data_changed

OF cl_gui_alv_grid

IMPORTING er_data_changed.

ALL THE BEST PRIYANKA

DO REWARD POINTS

6 REPLIES 6
Read only

uwe_schieferstein
Active Contributor
0 Likes
742

Hello Neetesh

If the entire ALV grid should be editable simply set the layout ls_layout-edit = 'X' (see also sample program BCALV_EDIT_01). For switching on/off at the level of individual cells look at sample program BCALV_EDIT_02.

Regards

Uwe

Read only

Former Member
0 Likes
742

pls check these programs

BCALV_EDIT_01

BCALV_EDIT_02

BCALV_EDIT_03

BCALV_EDIT_04

BCALV_EDIT_05

BCALV_EDIT_06

BCALV_EDIT_07

BCALV_EDIT_08

Read only

Former Member
0 Likes
742

In the field catalogue, change the attributes of that field as editable

fcat-edit = 'X'.

After creating the grid, register event entered and modified

  • Create alv grid

CREATE OBJECT w_grid_vend

EXPORTING

i_parent = w_vend_contnr

EXCEPTIONS

error_cntl_create = 1

error_cntl_init = 2

error_cntl_link = 3

error_dp_create = 4

others = 5.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

  • Register edit event

CALL METHOD w_grid_vend->register_edit_event

EXPORTING

i_event_id = cl_gui_alv_grid=>mc_evt_enter

EXCEPTIONS

error = 1

OTHERS = 2.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

  • Edit event for modified

CALL METHOD w_grid_vend->register_edit_event

EXPORTING

i_event_id = cl_gui_alv_grid=>mc_evt_modified

EXCEPTIONS

error = 1

OTHERS = 2.

Handle the changed data in the methods

  • Handle data changed

METHODS handle_data_changed FOR EVENT data_changed

OF cl_gui_alv_grid

IMPORTING er_data_changed.

Read only

Former Member
0 Likes
743

HI PLZ CHECK THE FOLLOWING CODE.

In the field catalogue, change the attributes of that field as editable

fcat-edit = 'X'.

After creating the grid, register event entered and modified

  • Create alv grid

CREATE OBJECT w_grid_vend

EXPORTING

i_parent = w_vend_contnr

EXCEPTIONS

error_cntl_create = 1

error_cntl_init = 2

error_cntl_link = 3

error_dp_create = 4

others = 5.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

  • Register edit event

CALL METHOD w_grid_vend->register_edit_event

EXPORTING

i_event_id = cl_gui_alv_grid=>mc_evt_enter

EXCEPTIONS

error = 1

OTHERS = 2.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

  • Edit event for modified

CALL METHOD w_grid_vend->register_edit_event

EXPORTING

i_event_id = cl_gui_alv_grid=>mc_evt_modified

EXCEPTIONS

error = 1

OTHERS = 2.

Handle the changed data in the methods

  • Handle data changed

METHODS handle_data_changed FOR EVENT data_changed

OF cl_gui_alv_grid

IMPORTING er_data_changed.

ALL THE BEST PRIYANKA

DO REWARD POINTS

Read only

Former Member
Read only

Former Member
0 Likes
742

What do u mean by cell editable?

1> The entire ALV grid column editable ?

2> Selected cells in a row/column editable?