Application Development 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: 

How to get Header in Downloaded .xls file using GUI_Download function

Former Member
0 Kudos

How to get Header in Downloaded .xls file using GUI_Download function ???

How to use the the Header parameter available in GUI_Download function .

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI,

see this sample code..

data : Begin of t_header occurs 0,
       name(30) type c,
       end of t_header.

data : Begin of itab occurs 0,
       fld1 type char10,
       fld2 type char10,
       fld3 type char10,
       end   of itab.

 DATA: v_pass_path TYPE string.

append itab.
itab-fld1 = 'Hi'.
itab-fld2 = 'hello'.
itab-fld3 = 'welcome'.
append itab.
append itab.
append itab.
append itab.
append itab.

t_header-name = 'Field1'.
append t_header.
t_header-name = 'Field2'.
append t_header.
t_header-name = 'Field3'.
append t_header.

  CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'
    EXPORTING
      default_extension     = 'XLS'
    IMPORTING
      fullpath              = v_pass_path.

  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      filename                        = v_pass_path
      filetype                        = 'DBF'
    TABLES
      data_tab                        = itab
      FIELDNAMES                      = t_header

Cheers,

jose.

1 REPLY 1

Former Member
0 Kudos

HI,

see this sample code..

data : Begin of t_header occurs 0,
       name(30) type c,
       end of t_header.

data : Begin of itab occurs 0,
       fld1 type char10,
       fld2 type char10,
       fld3 type char10,
       end   of itab.

 DATA: v_pass_path TYPE string.

append itab.
itab-fld1 = 'Hi'.
itab-fld2 = 'hello'.
itab-fld3 = 'welcome'.
append itab.
append itab.
append itab.
append itab.
append itab.

t_header-name = 'Field1'.
append t_header.
t_header-name = 'Field2'.
append t_header.
t_header-name = 'Field3'.
append t_header.

  CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'
    EXPORTING
      default_extension     = 'XLS'
    IMPORTING
      fullpath              = v_pass_path.

  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      filename                        = v_pass_path
      filetype                        = 'DBF'
    TABLES
      data_tab                        = itab
      FIELDNAMES                      = t_header

Cheers,

jose.