Code: Alles auswählen.
DATA: alv TYPE REF TO iwci_salv_wd_table,
context TYPE REF TO if_wd_context_node,
editors TYPE zwd_alv_editors.
wd_this->init_alv( ).
alv = wd_this->wd_cpifc_heis_alv( ).
context = wd_context->get_child_node( name = wd_this->wdctx_hot_clean ).
TRY.
* Extraktor
CALL METHOD wd_assist->get_hclean_data
EXPORTING ranges = ranges.
CATCH cx_c2s_services.
CALL METHOD wd_this->output_msg
EXPORTING im_msgid = sy-msgid
im_msgno = sy-msgno
im_msgty = sy-msgty
im_msgv1 = sy-msgv1
im_msgv2 = sy-msgv2
im_msgv3 = sy-msgv3
im_msgv4 = sy-msgv4.
ENDTRY.
CALL METHOD context->bind_elements
EXPORTING
new_items = wd_assist->cont.
alv->set_data( r_node_data = context ).
wd_this->ir_heis_alv_config = alv->get_model( ).
editors = VALUE zwd_alv_editors( ( column = 'STAT_NEW' class_editor = 'CL_SALV_WD_UIE_INPUT_FIELD' )
( column = 'STAT_OLD' class_editor = 'CL_SALV_WD_UIE_TEXT_VIEW' )
( column = 'GEW_KRAETZE' class_editor = 'CL_SALV_WD_UIE_TEXT_VIEW' )
).
wd_this->set_alv_columns( editors = editors columns = columns ).
Code: Alles auswählen.
method SET_ALV_COLUMNS .
* 'Feldkatalog aufbauen'
DATA: l_oref_column_settings TYPE REF TO if_salv_wd_column_settings,
editor TYPE REF TO cl_salv_wd_uie_input_field,
texte TYPE REF TO cl_salv_wd_uie_text_view,
column TYPE REF TO cl_salv_wd_column,
st TYPE string.
FIELD-SYMBOLS: <ed> TYPE zwd_alv_editor,
<col> TYPE salv_wd_s_column_ref.
* access column settings
l_oref_column_settings ?= wd_this->ir_heis_alv_config.
LOOP AT editors ASSIGNING <ed> WHERE class_editor = 'CL_SALV_WD_UIE_INPUT_FIELD'.
st = <ed>-column.
column = l_oref_column_settings->get_column( st ).
CREATE OBJECT editor
EXPORTING value_fieldname = st.
column->set_cell_editor( editor ).
ENDLOOP.
* Editierbare Spalten
LOOP AT editors ASSIGNING <ed> WHERE class_editor = 'CL_SALV_WD_UIE_TEXT_VIEW'.
st = <ed>-column.
column = l_oref_column_settings->get_column( st ).
texte ?= column->get_cell_editor( ).
st = 'COLOR' && st.
texte->set_semantic_color_fieldname( value = st ).
ENDLOOP.
* Sichtbarkeit der Spalten setzen: nur Spalten in columns sollen angezeigt werden
LOOP AT l_oref_column_settings->get_columns( ) ASSIGNING <col>.
IF <col>-id NOT IN columns.
<col>-r_column->set_visible( value = if_wdl_core=>visibility_none ).
ELSE.
<col>-r_column->set_visible( value = if_wdl_core=>visibility ).
ENDIF.
ENDLOOP.
endmethod.
Code: Alles auswählen.
method INIT_ALV .
* ALV initialisieren
DATA: l_cmp TYPE REF TO if_wd_component_usage.
l_cmp = wd_this->wd_cpuse_heis_alv( ).
IF l_cmp->has_active_component( ) IS INITIAL.
l_cmp->create_component( ).
ENDIF.
endmethod.
Code: Alles auswählen.
data: container type ref to cl_gui_custom_container,
grid type ref to cl_gui_alv_grid.
create object: container exporting name = '...',
grid exporting i_parent = container.