Code: Alles auswählen.
METHOD alv_data_display_editable.
r_alv->register_edit_event( i_event_id = cl_gui_alv_grid=>mc_evt_modified ).
SET HANDLER me->/kbc/if_iat_gui_alv_grid~data_changed FOR r_alv.
* SET HANDLER me->/kbc/if_iat_gui_alv_grid~handle_toolbar FOR r_alv.
* SET HANDLER me->/kbc/if_iat_gui_alv_grid~handle_before_user_command FOR r_alv.
* SET HANDLER me->/kbc/if_iat_gui_alv_grid~handle_user_command FOR r_alv.
* SET HANDLER me->/kbc/if_iat_gui_alv_grid~handle_after_user_command FOR r_alv.
* SET HANDLER me->zif_gui_alv_grid~handle_button_click FOR r_alv.
r_alv->set_ready_for_input( 1 ).
CALL METHOD r_alv->set_table_for_first_display
EXPORTING
i_bypassing_buffer = abap_true
is_variant = w_variant
i_save = 'A'
i_default = 'X'
it_toolbar_excluding = t_excl
is_layout = w_layout
CHANGING
it_outtab = r_iat->t_balance_alv
it_fieldcatalog = t_fcat.
ENDMETHOD.
Code: Alles auswählen.
CASE iv_mode.
WHEN 'OPEN'.
ct_style = VALUE #( BASE ct_style ( fieldname = iv_field_name style = cl_gui_alv_grid=>mc_style_enabled ) ).
WHEN 'CLOSE'.
ct_style = VALUE #( BASE ct_style ( fieldname = iv_field_name style = cl_gui_alv_grid=>mc_style_disabled ) ).
ENDCASE.
Code: Alles auswählen.
METHOD /kbc/if_iat_gui_alv_grid~data_changed.
DATA lv_stable TYPE lvc_s_stbl.
lv_stable-row = abap_true.
lv_stable-col = abap_true.
r_iat->alv_data_changed( er_data_changed ).
r_alv->refresh_table_display( is_stable = lv_stable ).
ENDMETHOD.
Code: Alles auswählen.
METHOD alv_data_changed.
LOOP AT ir_data_changed->mt_good_cells ASSIGNING FIELD-SYMBOL(<lw_good>).
READ TABLE t_balance_alv ASSIGNING FIELD-SYMBOL(<lw_balance_alv>) INDEX <lw_good>-row_id.
ASSIGN COMPONENT <lw_good>-fieldname OF STRUCTURE <lw_balance_alv> TO FIELD-SYMBOL(<lv_value>).
IF sy-subrc = 0.
<lv_value> = <lw_good>-value.
ENDIF.
IF <lw_good>-fieldname = 'TARGET_VALUE'.
calc_value_adjust( <lw_good>-row_id ).
* get BCS Total and set all totals
calc_value_adjust_bcs( ).
ENDIF.
ENDLOOP.
ENDMETHOD.