Code: Alles auswählen.
method ONACTIONSPRINGEN .
DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
lo_cmp_usage = wd_this->wd_cpuse_cpu_alv( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.
DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
lo_interfacecontroller = wd_this->wd_cpifc_cpu_alv( ).
DATA: "lo_interfacecontroller TYPE REF TO iwci_salv_wd_table ,
lv_value TYPE REF TO cl_salv_wd_config_table,
lt_columns TYPE salv_wd_t_column_ref,
ls_columns TYPE salv_wd_s_column_ref,
lo_input_field TYPE REF TO cl_salv_wd_uie_input_field,
lo_header TYPE REF TO cl_salv_wd_column_header.
lo_interfacecontroller = wd_this->wd_cpifc_cpu_alv( ).
lv_value = lo_interfacecontroller->get_model( ).
lv_value->if_salv_wd_table_settings~set_edit_mode( '99' ).
lv_value->if_salv_wd_table_settings~set_read_only( abap_false ).
* Get table columns
lt_columns = lv_value->if_salv_wd_column_settings~get_columns( ).
lv_value->if_salv_wd_table_settings~set_edit_mode( '99' ).
lv_value->if_salv_wd_table_settings~set_read_only( abap_false ).
* Get table columns
lt_columns = lv_value->if_salv_wd_column_settings~get_columns( ).
* Set column editor
LOOP AT lt_columns INTO ls_columns.
* für folgende Tabellenspalten keine Eingabebereitschaft
IF ls_columns-id = 'STATUS'
OR ls_columns-id = 'EBELP'
OR ls_columns-id = 'EXTROW'.
CLEAR ls_columns.
CONTINUE.
ENDIF.
lo_header = ls_columns-r_column->get_header( ).
* Create editor
CREATE OBJECT lo_input_field
EXPORTING
value_fieldname = ls_columns-id.
* Felder der ALV aktivieren
ls_columns-r_column->set_cell_editor( lo_input_field ).
CLEAR: ls_columns.
ENDLOOP.
DATA lo_nd_focus TYPE REF TO if_wd_context_node.
DATA lo_el_focus TYPE REF TO if_wd_context_element.
DATA ls_focus TYPE wd_this->element_focus.
* navigate from <CONTEXT> to <FOCUS> via lead selection
lo_nd_focus = wd_context->get_child_node( name = wd_this->wdctx_focus ).
* @TODO handle non existant child
* IF lo_nd_focus IS INITIAL.
* ENDIF.
* get element via lead selection
lo_el_focus = lo_nd_focus->get_element( ).
* @TODO handle not set lead selection
IF lo_el_focus IS INITIAL.
ENDIF.
* get all declared attributes
lo_el_focus->get_static_attributes(
IMPORTING
static_attributes = ls_focus ).
lo_interfacecontroller->set_focus(
index = ls_focus-index " i
column = ls_focus-column " string
).
endmethod.