cancel
Showing results for 
Search instead for 
Did you mean: 

Making column Disable

Former Member
0 Kudos
57

Hi Guru,

I am displaying one ALV using Class.

But in the output I have to disable some colums so that no body can change them and some colum changeable.

Would you tell me how to proceed with that.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Look at program ... BCALV_EDIT_02

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello Sandeep,

If you want to Hide the Columns in the ALV Ouput and you have Developed the ALV by OOPs method then in Field Catalog you need to Pass 'NO_OUT = 'X' .

By doing this the Particular field wont be Displayed in the Output.

Regards,

Irfan

Former Member
0 Kudos

Hi Sandeep,

CLASS cl_eventhandler DEFINITION.

PUBLIC SECTION.

METHODS:

handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid

IMPORTING e_object e_interactive,

handle_user_command FOR EVENT user_command OF cl_gui_alv_grid

IMPORTING e_ucomm,

ENDCLASS. "cl_eventhandler DEFINITION

*class implementation

CLASS cl_eventhandler IMPLEMENTATION.

METHOD handle_toolbar.

DATA: ls_toolbar TYPE stb_button.

CLEAR ls_toolbar.

MOVE 'INSERT' TO ls_toolbar-function.

MOVE icon_print TO ls_toolbar-icon.

MOVE 'Insert ' TO ls_toolbar-quickinfo.

MOVE 'Insert' TO ls_toolbar-text.

MOVE ' ' TO ls_toolbar-disabled.

APPEND ls_toolbar TO e_object->mt_toolbar.

CLEAR ls_toolbar.

SIMIILARLY INSERT DELETE

ENDMETHOD. "handle_toolbar

METHOD handle_user_command.

CASE e_ucomm.

WHEN 'INSERT'.

*fetch selected row

CALL METHOD gr1->get_selected_rows

IMPORTING

et_index_rows = lt_rows.

CALL METHOD cl_gui_cfw=>flush.

IF lt_rows[] IS INITIAL.

MESSAGE s001(00) WITH 'No row selected has been selected'.

ELSE.

ENDCASE.

ENDMETHOD. "handle_user_command

ENDCLASS. "cl_eventhandler IMPLEMENTATION

Warm Regards

Gokul

Former Member
0 Kudos

Hi,

Use the field EDIT in the Fieldcatalog.

EDIT = 'X' then the coloumn become editable

EDIT = space the coloumn is not editable

Refer to the program BCALV_GRID_EDIT