Sres, buenos dias, tengo el siguiente codigo de un alv grid que no muestra la barra de herramientas, no encuentro el error, favor de revisar y hecharme una mano, mil gracias.
Código:
REPORT z_alv_to_excel MESSAGE-ID z0 NO STANDARD PAGE HEADING LINE-SIZE 132 LINE-COUNT 65. TABLES: spfli. DATA: W_USRID LIKE PA0105-USRID, W_POSI(2) TYPE N, W_SETT01(56) TYPE C, W_TIPBUS TYPE C. DATA: W_PROGNAME TYPE SY-REPID, W_DYNNUM TYPE SY-DYNNR, DYNPRO_VALUES TYPE TABLE OF DYNPREAD, FIELD_VALUE LIKE LINE OF DYNPRO_VALUES. TYPE-POOLS: SLIS. *&---------------------------------------------------------------------* *& Estructuras *&---------------------------------------------------------------------* TYPES: BEGIN OF type_spfli, carrid TYPE spfli-carrid, "Denominación breve de la compañía aérea connid TYPE spfli-connid, "Código de conexión de vuelo directo countryfr TYPE spfli-countryfr, "Clave de país cityfrom TYPE spfli-cityfrom, "Ciudad de salida airpfrom TYPE spfli-airpfrom, "Aeropuerto de salida countryto TYPE spfli-countryto, "Clave de país cityto TYPE spfli-cityto, "Ciudad de llegada airpto TYPE spfli-airpto, "Aeropuerto de destino END OF type_spfli. TYPES: type_t_spfli TYPE STANDARD TABLE OF type_spfli. DATA: ti_spfli TYPE type_t_spfli. TYPE-POOLS: slis. DATA: gt_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE, gs_layout TYPE slis_layout_alv, gt_list_top_of_page TYPE slis_t_listheader, gt_events TYPE slis_t_event, gt_sort TYPE slis_t_sortinfo_alv WITH HEADER LINE, ls_vari TYPE disvariant, g_repid LIKE sy-repid. DATA: GT_EXCLUDE TYPE SLIS_T_EXTAB WITH HEADER LINE. SELECTION-SCREEN BEGIN OF BLOCK BLOCK01 WITH FRAME TITLE TEXT-S03. PARAMETERS: P_file TYPE rlgrap-filename DEFAULT 'c:\sapdata\'. SELECTION-SCREEN END OF BLOCK BLOCK01. *&---------------------------------------------------------------------* *& Validaciones de Pantalla *&---------------------------------------------------------------------* AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE. PERFORM BUSCAR_ARCHIVO CHANGING P_FILE. FORM BUSCAR_ARCHIVO CHANGING P_FILE. DATA: XFILE LIKE IBIPPARMS-PATH. CALL FUNCTION 'F4_FILENAME' * EXPORTING * FIELD_NAME = p_file IMPORTING FILE_NAME = XFILE. P_FILE = XFILE. ENDFORM. " buscar_archivo *&---------------------------------------------------------------------* *& INITIALIZATION *&---------------------------------------------------------------------* INITIALIZATION. * nombre del Programa MOVE sy-repid TO g_repid. *&---------------------------------------------------------------------* *& START-OF-SELECTION *&---------------------------------------------------------------------* START-OF-SELECTION. ** Obtencion de los Datos PERFORM carga_datos CHANGING ti_spfli. ** Lisatado de los datos PERFORM cargar_alv. *&---------------------------------------------------------------------* END-OF-SELECTION. *&---------------------------------------------------------------------* *& Form CARGA_CAB_GASTOS *&---------------------------------------------------------------------* FORM carga_datos CHANGING to_spfli TYPE type_t_spfli. REFRESH: to_spfli. SELECT carrid connid countryfr cityfrom airpfrom countryto cityto airpto INTO CORRESPONDING FIELDS OF TABLE to_spfli FROM spfli. ENDFORM. " CARGA_DATOS *&---------------------------------------------------------------------* *& Form CARGAR_ALV *&---------------------------------------------------------------------* FORM cargar_alv. PERFORM init_fieldcat. PERFORM init_layout. PERFORM EVENTTAB_BUILD_01 CHANGING GT_EVENTS. PERFORM COMMENT_BUILD_01 USING GT_LIST_TOP_OF_PAGE. PERFORM mostrar_alv_01 USING ti_spfli. ENDFORM. " CARGAR_ALV *&---------------------------------------------------------------------* *& Form init_fieldcat *&---------------------------------------------------------------------* FORM init_fieldcat. REFRESH: gt_fieldcat. CLEAR w_posi. G_REPID = SY-REPID. W_POSI = W_POSI + 1. gt_fieldcat-tabname = 'IT_SPFLI'. gt_fieldcat-fieldname = 'CARRID'. gt_fieldcat-ref_tabname = 'SPFLI'. gt_fieldcat-ddictxt = 'L'. GT_FIELDCAT-COL_POS = W_POSI. APPEND gt_fieldcat. CLEAR gt_fieldcat. W_POSI = W_POSI + 1. gt_fieldcat-tabname = 'IT_SPFLI'. gt_fieldcat-fieldname = 'CONNID'. gt_fieldcat-ref_tabname = 'SPFLI'. gt_fieldcat-ddictxt = 'L'. GT_FIELDCAT-COL_POS = W_POSI. APPEND gt_fieldcat. CLEAR gt_fieldcat. W_POSI = W_POSI + 1. gt_fieldcat-tabname = 'IT_SPFLI'. gt_fieldcat-fieldname = 'COUNTRYFR'. gt_fieldcat-ref_tabname = 'SPFLI'. gt_fieldcat-ddictxt = 'L'. GT_FIELDCAT-COL_POS = W_POSI. APPEND gt_fieldcat. CLEAR gt_fieldcat. W_POSI = W_POSI + 1. gt_fieldcat-tabname = 'IT_SPFLI'. gt_fieldcat-fieldname = 'CITYFROM'. gt_fieldcat-ref_tabname = 'SPFLI'. gt_fieldcat-ddictxt = 'L'. GT_FIELDCAT-COL_POS = W_POSI. APPEND gt_fieldcat. CLEAR gt_fieldcat. ENDFORM. " init_fieldcat *&---------------------------------------------------------------------* *& Form init_layout *&---------------------------------------------------------------------* FORM init_layout. gs_layout-colwidth_optimize = 'X'. gs_layout-zebra = 'X'. GS_LAYOUT-NO_INPUT = ' '. ENDFORM. " init_layout FORM user_command_01 USING ucomm LIKE sy-ucomm selfield TYPE slis_selfield. DATA: wl_file TYPE string. CASE ucomm. WHEN '&EXC'. * PERFORM get_filename CHANGING wl_file. * PERFORM download_to_exc USING wl_file ti_spfli. ENDCASE. ENDFORM. FORM EVENTTAB_BUILD_01 CHANGING PGT_EVENTS TYPE SLIS_T_EVENT. CONSTANTS: GC_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE_01'. DATA: LS_EVENT TYPE SLIS_ALV_EVENT. CALL FUNCTION 'REUSE_ALV_EVENTS_GET' EXPORTING I_LIST_TYPE = 0 IMPORTING ET_EVENTS = PGT_EVENTS. READ TABLE PGT_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE INTO LS_EVENT. IF SY-SUBRC = 0. MOVE GC_FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM. APPEND LS_EVENT TO PGT_EVENTS. ENDIF. ENDFORM. FORM COMMENT_BUILD_01 USING LT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER. DATA: LS_LINE TYPE SLIS_LISTHEADER. REFRESH: LT_TOP_OF_PAGE. * Title * LIST HEADING LINE: TYPE H CLEAR LS_LINE. LS_LINE-TYP = 'H'. LS_LINE-KEY = 'REPORTE'. LS_LINE-INFO = 'DETALLES'. APPEND LS_LINE TO LT_TOP_OF_PAGE. CLEAR LS_LINE. LS_LINE-TYP = 'S'. LS_LINE-KEY = 'Autor:'. CONCATENATE '***xx' '******' INTO LS_LINE-INFO SEPARATED BY SPACE. APPEND LS_LINE TO LT_TOP_OF_PAGE. CLEAR LS_LINE. LS_LINE-TYP = 'S'. APPEND LS_LINE TO LT_TOP_OF_PAGE. ENDFORM. "COMMENT_BUILD_01 *---------------------------------------------------------------------* * FORM TOP_OF_PAGE_01 * *---------------------------------------------------------------------* FORM TOP_OF_PAGE_01. CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE' EXPORTING IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE. ENDFORM. *&---------------------------------------------------------------------* *& Form MOSTRAR_ALV_01 *&---------------------------------------------------------------------* FORM mostrar_alv_01 USING ti_spfli TYPE type_t_spfli. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING i_callback_program = g_repid i_callback_user_command = 'USER_COMMAND_01' i_callback_pf_status_set = 'SET_PF_STATUS_01' i_structure_name = 'T_OUTTAB' is_layout = gs_layout it_fieldcat = gt_fieldcat[] * it_sort = gt_sort[] it_excluding = gt_exclude[] * I_DEFAULT = 'X' i_save = ' ' "Grabar Variante is_variant = ls_vari it_events = gt_events[] * IT_EVENT_EXIT = * IS_PRINT = * IS_REPREP_ID = * I_SCREEN_START_COLUMN = 0 * I_SCREEN_START_LINE = 0 * I_SCREEN_END_COLUMN = 0 * I_SCREEN_END_LINE = 0 * IMPORTING * E_EXIT_CAUSED_BY_CALLER = * ES_EXIT_CAUSED_BY_USER = TABLES t_outtab = ti_spfli EXCEPTIONS program_error = 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. ENDFORM. " MOSTRAR_ALV_01 FORM set_pf_status_01 USING lt_cua_exclude TYPE slis_t_extab. DATA: lf_gui_status TYPE gui_status. SET PF-STATUS 'ZZSTANDARD'. ENDFORM. "set_pf_status_01