Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

After executing report LIST-->EXPORT-->Spreadsheet an select excel file only showing heading,

kevin_patel
Explorer
0 Kudos
1,641

After executing Z report going into LIST-->EXPORT-->Spreadsheet and select excel file but my excel file only showing heading , data is missing.

I have checked various option like change type of final output structure, Changing various field catalog field option, Try both function module List and grid display.
Also while using option Local file and download as uncoverted file and give extension .xls it is showing data but menu option is not available.

1 ACCEPTED SOLUTION

kevin_patel
Explorer
0 Kudos
769

Issue has been resolved. There is ALV inconsistency problem.

4 REPLIES 4

NTeunckens
Active Contributor
0 Kudos
769

You mention it is a Z-report. Is the Excel-export 'custom' or re-use of Standard-logic. In the first case, I would review the Code, in the Second case, I would advise to check for SAP-Notes on the (Standard) functionality in use ... There are a lot of Notes on Excel-export functionality.

kevin_patel
Explorer
0 Kudos
769
FORM field_catalog .
  PERFORM field_cat
        USING:
              'sale_doc'                 'gt_final'     'LIKP'        'VBELN'          text-003     gc_space gc_c411,
              'doc_desc'                 'gt_final'     'TVAKT'       'BEZEI'          text-004     gc_space gc_c411,
              'sale_doc_t'               'gt_final'     'LIKP'        'LFART'          text-005     gc_space gc_c411,
              and so on upto 30 more field .
ENDFORM.
*&---------------------------------------------------------------------*
*&      Form  FIELD_CAT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_1516   text
*      -->P_1517   text
*      -->P_1518   text
*      -->P_1519   text
*      -->P_1520   text
*      -->P_1521   text
*      -->P_1522   text
*----------------------------------------------------------------------*
FORM field_cat  USING    p_fieldname TYPE any
                         p_tabname TYPE any
                         p_ref_tabname TYPE any
                         p_ref_fieldname TYPE any
                         p_long_text TYPE any
                         p_no_out TYPE any
                         p_emp TYPE any.
  CONSTANTS : lc_l TYPE char1 VALUE 'L'.
  CLEAR : gw_fcat.


  gw_fcat-fieldname        = p_fieldname    .
  gw_fcat-tabname          = p_tabname      .
  gw_fcat-ref_tabname      = p_ref_tabname  .
  gw_fcat-ref_fieldname    = p_ref_fieldname.
  gw_fcat-seltext_l        = p_long_text    .
  gw_fcat-no_out           = p_no_out      .
  gw_fcat-ddictxt         = lc_l.




  APPEND gw_fcat TO gt_fcat.
  CLEAR gw_fcat.
ENDFORM.
*&---------------------------------------------------------------------*
*&      Form  DISPLAY_ALV
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM display_alv .
*ALV variables
  DATA lv_repid TYPE sy-repid.
  CONSTANTS : lc_a            TYPE c VALUE 'A'.
*Add values for layout
  gw_layout-colwidth_optimize = abap_true.
  gw_layout-expand_all = abap_true.
  gw_layout-zebra = abap_true.




*Generate ALV using ALV Grid display
  lv_repid = sy-repid.


  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program = lv_repid
      is_layout          = gw_layout
      it_fieldcat        = gt_fcat
      i_save             = lc_a
      is_variant         = gw_variant
      i_bypassing_buffer = abap_true
    TABLES
      t_outtab           = gt_final
    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.
  REFRESH : gt_final.


ENDFORM.

kevin_patel
Explorer
0 Kudos
769

Please find above code here in ALV for being only displaying 3 field actually it was more but for analysis purpose I have only put 3 fields and download sheet but not able to download excel file.

kevin_patel
Explorer
0 Kudos
770

Issue has been resolved. There is ALV inconsistency problem.