2018 Oct 29 12:59 PM
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.
2018 Nov 28 7:36 AM
2018 Oct 30 7:27 AM
2018 Nov 02 7:23 AM
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.
2018 Nov 02 7:24 AM
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.
2018 Nov 28 7:36 AM