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

excel output

Former Member
0 Likes
535

how to get the output as excel in tab format after executing the program?

4 REPLIES 4
Read only

Former Member
0 Likes
506

Check the FM: GUI_DOWNLOAD

or the demo program: RSDEMO01

Regards,

Ravi

Read only

Former Member
0 Likes
506

hi

chk this:

regards,

madhumitha

Read only

Former Member
0 Likes
506

Hi,

Go thru this code.

&----


*& Report ZGUIDOWNLOAD

*&

&----


*&

*&

&----


REPORT ZGUIDOWNLOAD.

tables : vbak.

data : begin of i_vbak occurs 0,

vbeln like vbak-vbeln,

erdat like vbak-erdat,

erzet like vbak-erzet,

end of i_vbak.

select vbeln

erdat

erzet

from vbak

into table i_vbak.

loop at i_vbak.

write : /10 i_vbak-vbeln,

25 i_vbak-erdat,

45 i_vbak-erzet.

endloop.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

FILENAME = 'C:\dd.xls'

FILETYPE = 'ASC'

  • APPEND = ' '

WRITE_FIELD_SEPARATOR = 'X'

  • HEADER = '00'

  • TRUNC_TRAILING_BLANKS = ' '

  • WRITE_LF = 'X'

  • COL_SELECT = ' '

  • COL_SELECT_MASK = ' '

  • DAT_MODE = ' '

  • IMPORTING

  • FILELENGTH =

TABLES

DATA_TAB = i_vbak

  • 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

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Thanks

Sunil

Read only

Former Member
0 Likes
506
try this FM

call function 'RH_START_EXCEL_WITH_DATA'
   exporting
     data_filename             = 'WDPDDPRT.XLS'
     data_path_flag            = 'W'
*    DATA_ENVIRONMENT          =
     data_table                = excel_data[]
     macro_filename            = print_macro
     macro_path_flag           = 'E'
     macro_environment         = macro_envir
     wait                      = 'X'
     delete_file               = 'X'
   exceptions
     no_batch                  = 1
     excel_not_installed       = 2
     internal_error            = 3
     cancelled                 = 4
     download_error            = 5
     no_authority              = 6
     file_not_deleted          = 7
     others                    = 8.