Code: Alles auswählen.
* Definition:
* ~~~~~~~~~~~
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
handle_toolbar_pro
FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive.
PRIVATE SECTION.
ENDCLASS. "lcl_event_receiver DEFINITION
* Implementation:
* ~~~~~~~~~~~
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_toolbar_pro.
DATA: ls_toolbar TYPE stb_button.
* append a separator to normal toolbar
CLEAR ls_toolbar.
MOVE 3 TO ls_toolbar-butn_type.
APPEND ls_toolbar TO e_object->mt_toolbar.
* append an icon to show "Proforma"
* &
* append an icon to show "Pos. details"
CLEAR ls_toolbar.
MOVE 'PROFORMA' TO ls_toolbar-function.
MOVE icon_ws_confirm_whse_proc_back
TO ls_toolbar-icon.
MOVE 'Proformabestätigung'(117)
TO ls_toolbar-quickinfo.
MOVE 'Proformabestätigung'(118) TO ls_toolbar-text.
MOVE ' ' TO ls_toolbar-disabled.
APPEND ls_toolbar TO e_object->mt_toolbar.
CLEAR ls_toolbar.
ENDMETHOD. "handle_toolbar_pro
METHOD handle_user_command_pro.
DATA: lt_rows TYPE lvc_t_row.
MOVE e_ucomm TO z_ucomm.
CASE e_ucomm.
WHEN 'PROFORMA'.
CALL METHOD proforma_grid_alv->get_selected_rows
IMPORTING
et_index_rows = lt_rows.
CALL METHOD cl_gui_cfw=>flush.
IF sy-subrc NE 0.
* handling:
* sy-subrc NE 0: ausgabe: "Error in Flush"
* sy-subrc EQ 0: Programm läuft weiter (proforma vorbereiten)
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = g_repid
txt2 = sy-subrc
txt1 = 'Error in Flush'(500).
ELSE.
PERFORM proforma_vorbereiten TABLES lt_rows.
ENDIF.
WHEN 'CONFIRM'.
CALL METHOD proforma_grid_alv->get_selected_rows
IMPORTING
et_index_rows = lt_rows.
CALL METHOD cl_gui_cfw=>flush.
IF sy-subrc NE 0.
* handling:
* sy-subrc NE 0: ausgabe: "Error in Flush"
* sy-subrc EQ 0: Programm läuft weiter (position_bestaetigen)
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = g_repid
txt2 = sy-subrc
txt1 = 'Error in Flush'(500).
ELSE.
PERFORM position_bestaetigen
TABLES
lt_rows.
ENDIF.
ENDCASE.
ENDMETHOD. "handle_user_command_pro