|
#1
|
|||
|
|||
en el boton Exportar se te despliega la opcion de Hoja de calculo
|
#2
|
|||
|
|||
Hola por lo q entiendo es q quieres insertart tu propio boton excel y llamar a tu rutina para mostrar tu excel..
ok lo q tienes q hacer es insertar tu nuevo boton de la siguiente manera paso1 excluir el boton excel q por defecto pone la barra del alv DATA ls_toolbar_excluding TYPE ui_func. ls_toolbar_excluding = '&LOCAL&CUT'. INSERT ls_toolbar_excluding INTO TABLE lt_toolbar_excluding. paso 2 declara tu metodo en tu clase ejemplo class lcl_event_receiver definition. public section. METHODS handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid IMPORTING e_object e_interactive. METHODS handle_user_command FOR EVENT user_command OF cl_gui_alv_grid IMPORTING e_ucomm. endclass. class lcl_event_receiver implementation. *** otros metodos q debes de tener... *** METHOD handle_toolbar. PERFORM handle_toolbar CHANGING e_object. ENDMETHOD. "handle_toolbar METHOD handle_user_command. PERFORM handle_user_command USING e_ucomm. ENDMETHOD. "handle_user_command endclass. DONDE FORM handle_toolbar CHANGING e_object TYPE REF TO cl_alv_event_toolbar_set. DATA ls_toolbar TYPE stb_button. IF SY-SUBRC EQ 0. CLEAR ls_toolbar. ls_toolbar-butn_type = 3. CLEAR ls_toolbar. ls_toolbar-function = 'EXCEL'. ls_toolbar-icon = ICON_XXXXXX. ls_toolbar-quickinfo = text-008. ls_toolbar-disabled = space. APPEND ls_toolbar TO e_object->mt_toolbar. ENDFORM FORM handle_user_command USING e_ucomm TYPE sy-ucomm. Wsyucomm = e_ucomm. CASE Wsyucomm. WHEN 'EXCEL'. ****AQUI PONES TU LOGICA ENDCASE. ENDFORM Cuando estes por cargar tu alv.. acuerdate en SET HANDLER event_receiver->handle_toolbar FOR grid1. SET HANDLER event_receiver->handle_user_command FOR grid1. . . . CALL METHOD grid1->set_table_for_first_display EXPORTING i_structure_name = 'TI_ZTFIH' is_layout = gs_layout is_variant = gs_variant i_save = '' i_default = 'X' it_toolbar_excluding = lt_toolbar_excluding ----ojo!!! CHANGING it_outtab = TI_ZTFIH[] it_fieldcatalog = gt_fieldcat IT_SORT = GT_SORT[]. |
#3
|
|||
|
|||
gracias ibecerra!
|
Herramientas | Buscar en Tema |
Desplegado | |
|
|