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: 
Read only

EXPORT TABLE TO ARCHIVE

mariano_gallicchio2
Participant
0 Likes
757

Hello experts, there is a way to export a table(i mean name of fields, type of field etc, NOT the data ) to an archive (XML,EXCEL,HTML, or other )?

THANKS!!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
721

You can try something lile this:


REPORT  Z_TEST.
data: idfies type table of dfies with header line,
      s_file TYPE string.

parameters: p_table type ddobjname.
parameters: filename(80) type c default 'D:\Documents and Settings\Desktop\download.xls'.

call function 'DDIF_FIELDINFO_GET'
exporting
tabname = p_table
tables
dfies_tab = idfies
exceptions
not_found = 1
internal_error = 2
others = 3.

s_file = filename.

CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      FILENAME                = s_file
      FILETYPE                = 'DAT'
    TABLES
      DATA_TAB                = idfies
    EXCEPTIONS
      FILE_WRITE_ERROR        = 1
      NO_BATCH                = 2
      GUI_REFUSE_FILETRANSFER = 3
      INVALID_TYPE            = 4
      NO_AUTHORITY            = 5
      UNKNOWN_ERROR           = 6
      HEADER_NOT_ALLOWED      = 7
      SEPARATOR_NOT_ALLOWED   = 8
      FILESIZE_NOT_ALLOWED    = 9
      HEADER_TOO_LONG         = 10
      DP_ERROR_CREATE         = 11
      DP_ERROR_SEND           = 12
      DP_ERROR_WRITE          = 13
      UNKNOWN_DP_ERROR        = 14
      ACCESS_DENIED           = 15
      DP_OUT_OF_MEMORY        = 16
      DISK_FULL               = 17
      DP_TIMEOUT              = 18
      FILE_NOT_FOUND          = 19
      DATAPROVIDER_EXCEPTION  = 20
      CONTROL_FLUSH_ERROR     = 21
      OTHERS                  = 22.

Hello experts, there is a way to export a table(i mean name of fields, type of field etc, NOT the data ) to an archive (XML,EXCEL,HTML, or other )?

THANKS!!

4 REPLIES 4
Read only

Former Member
0 Likes
722

You can try something lile this:


REPORT  Z_TEST.
data: idfies type table of dfies with header line,
      s_file TYPE string.

parameters: p_table type ddobjname.
parameters: filename(80) type c default 'D:\Documents and Settings\Desktop\download.xls'.

call function 'DDIF_FIELDINFO_GET'
exporting
tabname = p_table
tables
dfies_tab = idfies
exceptions
not_found = 1
internal_error = 2
others = 3.

s_file = filename.

CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      FILENAME                = s_file
      FILETYPE                = 'DAT'
    TABLES
      DATA_TAB                = idfies
    EXCEPTIONS
      FILE_WRITE_ERROR        = 1
      NO_BATCH                = 2
      GUI_REFUSE_FILETRANSFER = 3
      INVALID_TYPE            = 4
      NO_AUTHORITY            = 5
      UNKNOWN_ERROR           = 6
      HEADER_NOT_ALLOWED      = 7
      SEPARATOR_NOT_ALLOWED   = 8
      FILESIZE_NOT_ALLOWED    = 9
      HEADER_TOO_LONG         = 10
      DP_ERROR_CREATE         = 11
      DP_ERROR_SEND           = 12
      DP_ERROR_WRITE          = 13
      UNKNOWN_DP_ERROR        = 14
      ACCESS_DENIED           = 15
      DP_OUT_OF_MEMORY        = 16
      DISK_FULL               = 17
      DP_TIMEOUT              = 18
      FILE_NOT_FOUND          = 19
      DATAPROVIDER_EXCEPTION  = 20
      CONTROL_FLUSH_ERROR     = 21
      OTHERS                  = 22.

Read only

0 Likes
721

Thanks a lot for the answer. Problem Solved!!!

Read only

Former Member
0 Likes
721

Hi,

I answered your question and told you the transaction SARA but i am not able to see it .. how? also my points got deducted..? any idea?

Read only

0 Likes
721

I dont know...

But i put the 6 point again in the answer...