Code: Alles auswählen.
IF rf_custom_container IS NOT BOUND.
CREATE OBJECT rf_custom_container
EXPORTING
container_name = 'CUSTCONTROL'.
CREATE OBJECT rf_alv
EXPORTING
i_parent = rf_custom_container.
CLEAR st_fieldcat.
st_fieldcat-fieldname = 'KWMENG'.
st_fieldcat-hotspot = abap_true.
st_fieldcat-edit = abap_false.
st_fieldcat-outputlen = 15.
APPEND st_fieldcat TO ta_fieldcat.
Code: Alles auswählen.
IF v_matbeleg = abap_false.
"Get current fieldcatalog
CALL METHOD rf_alv->get_frontend_fieldcatalog
IMPORTING
et_fieldcatalog = ta_fieldcat.
LOOP AT ta_fieldcat INTO st_fieldcat.
st_fieldcat-fieldname = 'KWMENG'.
st_fieldcat-hotspot = abap_false.
st_fieldcat-edit = abap_true.
APPEND st_fieldcat TO ta_fieldcat.
"MODIFY ta_fieldcat FROM st_fieldcat.
ENDLOOP.
"Show changed field catalog
CALL METHOD rf_alv->set_table_for_first_display
CHANGING
it_outtab = ta_alv
it_fieldcatalog = ta_fieldcat.
IF sy-subrc <> 0.
MESSAGE e017(z_whreservierung).
ENDIF.
"Refresh of ALV
rf_alv->refresh_table_display( ).
"Saving of changed amount
CALL METHOD rf_alv->register_edit_event
EXPORTING
i_event_id = rf_alv->mc_evt_modified.
IF sy-subrc <> 0.
"Geänderte menge wurde nicht gespeichert!
MESSAGE e017(z_whreservierung).
ENDIF.
"Refresh of ALV
rf_alv->refresh_table_display( ).
ENDIF.
Code: Alles auswählen.
IF v_matbeleg = abap_false.
"Änderbarkeit von Materialmenge in ALV steuern:
CALL METHOD rf_alv->get_frontend_fieldcatalog
IMPORTING
et_fieldcatalog = ta_fieldcat.
LOOP AT ta_fieldcat ASSIGNING <wa_fieldcat>
WHERE fieldname = 'KWMENG'.
<wa_fieldcat>-hotspot = abap_false.
<wa_fieldcat>-edit = abap_true.
ENDLOOP.
CALL METHOD rf_alv->set_ready_for_input( 1 ).
"Alv Grid aktualisieren
rf_alv->refresh_table_display( ).
"Geänderte Menge abspeichern
CALL METHOD rf_alv->register_edit_event
EXPORTING
i_event_id = rf_alv->mc_evt_modified.
IF sy-subrc <> 0.
"Geänderte menge wurde nicht gespeichert!
MESSAGE e017(z_whreservierung).
ENDIF.
"Alv Grid aktualisieren
rf_alv->refresh_table_display( ).
ENDIF.