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: 

FILE FORMAT NOT SUPPORTED

vallamuthu_madheswaran2
Active Contributor
0 Kudos

Hi Friends,

I'm using the below coding. if i opened the excel, it displays the message "file format not supported".

CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'

EXPORTING

i_field_seperator = 'X'

  • i_line_header = 'X'

i_filename = lv_file

  • i_appl_keep = 'X'

TABLES

i_tab_sap_data = gt_main.

  • CHANGING

  • I_TAB_CONVERTED_DATA = gt_main

  • exceptions

  • conversion_failed = 1

  • others = 2.

Thanks & regards,

Vallamuthu.M

6 REPLIES 6

vinod_vemuru2
Active Contributor
0 Kudos

Hi,

Instead of this, use FM GUI_DOWNLOAD. SCN has lots of sample codes on this FM.

Thanks,

Vinod.

0 Kudos

Hi Viond,

Thanks, I tried GUI_DOWNLOAD. if there is any special charactrer, that line is not downloaded. that's what i'm using this functional module

0 Kudos

Hi,

You mean character from some other language other than english? If yes, you may need to pass appropriate code page. Please let us know that special character and you code for GUI_DOWNLOAD.

Thanks,

Vinod.

0 Kudos

Hi Vinod,

I'm getting data from DB table(BSIS & BKPF) and downloading in excel using GUI_DOWNLOAD.

some data is missing in that excel. I checked it in debugging mode. before executing the FM the internal table has 44157 data.

after downloading the XL has 43708 data. how to solve it. the FM is given below

CONCATENATE full_path '.xls' INTO lv_file.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = lv_file

filetype = 'ASC'

append = 'X'

write_field_separator = 'X'

confirm_overwrite = 'X'

TABLES

data_tab = gt_main

fieldnames = i_final

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.

Edited by: vallamuthu madheswaran on Mar 17, 2010 11:34 AM

OttoGold
Active Contributor
0 Kudos

Maybe you would like to follow this approach to generate the excel file:

/people/otto.gold/blog/2010/02/11/happy-reporting-with-excel-ii

or go for this one:

/people/otto.gold/blog/2010/02/09/happy-reporting-with-abap-ole-excel

Regards, Otto

vallamuthu_madheswaran2
Active Contributor
0 Kudos

Solved myself. if double quote(") is there, then split the line. so l'm using the following code.

REPLACE ALL OCCURRENCES OF '"' IN gt_main-sgtxt WITH ''.

now it's working fine