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

Download excel

Former Member
0 Likes
475

output is being displayed in ALV hirarchical list and this output is to be downloaded in EXCEL for

but the format of the output is below.

Material Description Validity EAN-code Plant Description

1M00.590 GO520 Scandinavia 1/1/2008 636926017046 NL10 Moduslink

Level Material Description Qty. Material type Material group

0 1M00.590 Scandinavia 1 FERT

1 5M00.590 Outerbox Scandinavia 1 HALB NL

1 2M00.590 Component Box Sub 1 HALB CN

2 5M00.000 x20 Plastic Tray 1 HALB NL

Material Description Validity EAN-code Plant Description

1M00.510 GO520 Scan 1/1/2008 636926017046 NL10 Moduslink

Level Material Description Qty. Material type Material group

0 1M00.510 Scandinavia 1 FERT

1 5M00.510 Outerbox Scandinavia 1 HALB NL

1 2M00.510 Component 1 HALB CN

2 5M00.000 x20 Tray 1 HALB NL

Please suggest how to acheive this?

1 REPLY 1
Read only

Former Member
0 Likes
387

Dear Prince,

Since you might be using internal table for ALV output, same internal table you may pass to FM 'GUI_DOWNLOAD'

like below.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

filename = 'C:\Documents and Settings\saptrng\Desktop\desktop\xyz.xls'

FILETYPE = 'ASC'

  • APPEND = ' '

WRITE_FIELD_SEPARATOR = 'X'

  • HEADER = '00'

  • TRUNC_TRAILING_BLANKS = ' '

  • WRITE_LF = 'X'

  • COL_SELECT = ' '

  • COL_SELECT_MASK = ' '

  • DAT_MODE = 'X'

  • CONFIRM_OVERWRITE = ' '

  • NO_AUTH_CHECK = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • WRITE_BOM = ' '

  • TRUNC_TRAILING_BLANKS_EOL = 'X'

  • WK1_N_FORMAT = ' '

  • WK1_N_SIZE = ' '

  • WK1_T_FORMAT = ' '

  • WK1_T_SIZE = ' '

  • IMPORTING

  • FILELENGTH =

tables

data_tab = itab

  • FIELDNAMES =

  • 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.

PS : reward if useful

Regards

Talwinder