Code: Alles auswählen.
DATA button TYPE stb_button.
CLEAR: e_object->mt_toolbar.
CLEAR button.
button-butn_type = 3. "Separator
APPEND button TO e_object->mt_toolbar.
" Einfügen Edit Button
CLEAR button.
button-function = 'EDIT'.
button-icon = icon_toggle_display_change.
button-quickinfo = 'Edit'.
button-butn_type = '2' ."normaler Btn.
button-disabled = ' '.
button-text = 'Edit'.
APPEND button TO e_object->mt_toolbar.
CLEAR button.
button-butn_type = 3. "Separator
APPEND button TO e_object->mt_toolbar.
Code: Alles auswählen.
PARAMETERS: pa_filt TYPE ppe_filter_name.
INITIALIZATION.
PERFORM init.
START-OF-SELECTION.
AT SELECTION-SCREEN ON pa_filt.
gv_filt = pa_filt.
go_appl->get_data(
EXPORTING
iv_flt_name = gv_filt
CHANGING
o_appl_message = go_appl_msg ).
CALL SCREEN 2000.
Code: Alles auswählen.
SET PF-STATUS 'STATUS_2000'.
* SET TITLEBAR 'xxx'.
PERFORM init_dock.
PERFORM init_alv.
PERFORM set_handler.
" output display
IF go_alv IS BOUND.
CALL METHOD go_alv->set_table_for_first_display
EXPORTING
is_layout = go_appl->gs_layout
it_toolbar_excluding = go_appl->gt_toolbar_exclude
i_save = 'A'
CHANGING
it_outtab = go_appl->gt_alv
it_fieldcatalog = go_appl->gt_fieldcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE e001(zplm_cc_change_txt).
" Error in ALV generation
ENDIF.
CALL METHOD go_alv->set_ready_for_input
EXPORTING
i_ready_for_input = 1.
CALL METHOD go_alv->refresh_table_display
EXCEPTIONS
finished = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
Code: Alles auswählen.
" Create a docking control at bottom
CHECK go_dock IS INITIAL.
CREATE OBJECT go_dock
EXPORTING
repid = sy-cprog
dynnr = sy-dynnr
ratio = 80
side = cl_gui_docking_container=>dock_at_bottom
name = 'DOCK_CONT'.
IF sy-subrc <> 0.
MESSAGE 'Error in the Docking control' TYPE 'S'.
ENDIF.
" Init a OO-ALV-Grid for output
CHECK go_alv IS INITIAL.
CREATE OBJECT go_alv
EXPORTING
i_parent = go_dock
* i_appl_events = abap_true
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
SET HANDLER go_appl->on_hotspot_click FOR go_alv.
SET HANDLER go_appl->handle_data_changed FOR go_alv.
SET HANDLER go_appl->handle_user_command FOR go_alv.
SET HANDLER go_appl->handle_toolbar FOR go_alv.
Da springt er gar nicht rein.a-dead-trousers hat geschrieben:Die Verarbeitung deines Funktionscodes musst du in der handle_user_command-Methode implementieren. Da kommt dann auch der korrekte Funktionscode an.
CNTB_BTYPE_MENU oder 2 (siehe Typgruppe CNTB) ist für DropDown-Listen reserviert.Icke0801 hat geschrieben:ooh, ok, es war der Button-type = 2
Mit Type = 0 gehts.