Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

alv tree checbox problem when attempt to get the selected checjboxes

Hi

I have an ALV report which uses cl_gui_alv_tree as display control.

In this report some items in hierarchy are marked as checkboxes with following code:

CLEAR gs_fieldcat.

gs_fieldcat-col_pos = 10.

gs_fieldcat-reptext = 'Bo.Ejecutivo'.

gs_fieldcat-scrtext_s = 'Bo.Ejecutivo'.

gs_fieldcat-fieldname = 'CHECK'.

gs_fieldcat-tabname = 'IT_FINAL'.

gs_fieldcat-checkbox = 'X'.

gs_fieldcat-edit = 'X'.

gS_FIELDCAT-COL_OPT = 'X'.

gs_fieldcat-outputlen = '5'.

APPEND gs_fieldcat TO gt_fieldcat_tree.

When I call method

CALL METHOD g_alv_tree->get_selected_nodes

CHANGING

ct_selected_nodes = lt_selected_node.

CALL METHOD g_alv_tree->get_outtab_line

EXPORTING

i_node_key = l_selected_node

IMPORTING

e_outtab_line = wa_finalop.

APPEND wa_finalop TO it_finalop.

it returns an empty checkboxfield even if some of the checkbox were checked.

i have read an example and i add the following code but still not works.

FORM register_events.

DATA: tree_event_receiver TYPE REF TO lcl_eventhandler,

lt_events TYPE cntl_simple_events,

l_event TYPE cntl_simple_event.

CREATE OBJECT tree_event_receiver.

l_event-eventid = cl_gui_column_tree=>eventid_checkbox_change.

APPEND l_event TO lt_events.

CALL METHOD g_alv_tree->set_registered_events

EXPORTING

events = lt_events

EXCEPTIONS

cntl_error = 1

cntl_system_error = 2

illegal_event_combination = 3.

SET HANDLER:

tree_event_receiver->handle_checkbox_change for g_alv_tree.

endform.

what should i do?

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question