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

Internal Table To Excel

Former Member
0 Likes
695

Hello everyone,

I am downloading an internal table using the FM

SAP_CONVERT_TO_XLS_FORMAT. Is there another FM which

would allow me to specify a range of columns??

There are currently 300 columns in my table

and because of the limitation of excel i.e. 255 columns

I need to extract the data twice e.g. Cols 1 to 200

and Cols 201 300

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
658

HI,

you can use GUI_DOWNLOAD Function module.

-Rakesh

Hello everyone,

I am downloading an internal table using the FM

SAP_CONVERT_TO_XLS_FORMAT. Is there another FM which

would allow me to specify a range of columns??

There are currently 300 columns in my table

and because of the limitation of excel i.e. 255 columns

I need to extract the data twice e.g. Cols 1 to 200

and Cols 201 300

5 REPLIES 5
Read only

Former Member
0 Likes
658

How about using the GUI_DOWNLOAD method of CL_GUI_FRONTEND_SERVICES class.

Read only

0 Likes
658

use <b>GUI_DOWNLOAD</b> FM

data : filename type string,

fl_type type char10 value 'ASC'.

FILENAME ' 'C:\TEST.xls'.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

FILENAME = FILENAME

FILETYPE = 'ASC'

  • APPEND = ' '

  • WRITE_FIELD_SEPARATOR = ' '

  • HEADER = '00'

  • TRUNC_TRAILING_BLANKS = ' '

  • WRITE_LF = 'X'

  • COL_SELECT = ' '

  • COL_SELECT_MASK = ' '

  • DAT_MODE = ' '

  • CONFIRM_OVERWRITE = ' '

  • NO_AUTH_CHECK = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • WRITE_BOM = ' '

  • TRUNC_TRAILING_BLANKS_EOL = 'X'

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

Read only

Former Member
0 Likes
659

HI,

you can use GUI_DOWNLOAD Function module.

-Rakesh

Read only

Former Member
0 Likes
658

Hi,

you can do with normal GUI_DOWNLOAD.

give the file name as 'abc.xls'.

regards

vijay

Read only

0 Likes
658

Cheers guys.

Thanks for taking the time out to reply.

Many thanks