Skip to Content
0
Dec 06, 2006 at 06:18 PM

problem with ALV GRID layout

26 Views

Hi friends

really need yours help

I have to show an ALV grid with checkbox as first column.

This checkbox is based on internal table condition may be enabled or disabled, other columns are disabled.

I used the structure 'ZMESD' where i decleared that checkbox field.

I called function module:

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_structure_name = 'ZMESD'

i_bypassing_buffer = 'X'

CHANGING

ct_fieldcat = it_fieldcat[].

x_fieldcat-seltext_s = 'CheckBox'.

x_fieldcat-checkbox = 'X'. " Display this field as a

x_fieldcat-edit = 'X'. " You can specify the width of a

MODIFY it_fieldcat FROM x_fieldcat TRANSPORTING seltext_s checkbox

edit WHERE fieldname = 'CHK' .

Now the problem is, I want to use

"REUSE_ALV_GRID_DISPLAY", where I am using

is_layout = x_layout

and value of x_layout is filled based on condition as follows

LOOP AT gt_grid INTO ls_outtab.

DATA l_tabix TYPE i.

IF ls_outtab-status = 'Reserved'. "This is the condition for which checkbox is disabled

l_tabix = sy-tabix.

REFRESH lt_edit.

ls_edit-fieldname = 'CHK'.

ls_edit-style = cl_gui_alv_grid=>mc_style_disabled.

ls_edit-style2 = space.

ls_edit-style3 = space.

ls_edit-style4 = space.

ls_edit-maxlen = 10.

APPEND ls_edit TO lt_edit.

APPEND LINES OF lt_edit TO ls_outtab-handle_style.

MODIFY gt_grid INDEX l_tabix FROM ls_outtab TRANSPORTING

handle_style .

ENDIF.

ENDLOOP.

Now I finally i m using:

<b>x_layout-lights_tabname = 'handle_style'.</b>

but its giving dump.

I am sure its only because i havent found the corrosponding X_layout field for 'handle_event'.

Please help me, as its urgent.

Points ll be awarded for sure.