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 conversion error for .xlsx

Former Member
0 Kudos

Hi,

I have been working on MIS projects wherein most of time i am dealing with excel files which users do need for reporting purpose but the problem my system have MS Office 2003 and files are in .XLSX format ( MS Office 2007 )

and i have downloaded needed patch for it and have tested successfully whether its opening MS Office 2007 files.

Now the requirement is there is file in .XLSX format on desktop i need to read that files into SAP and download at another path

lets say on C:/ and i am using GUI upload and download FM which is upoloading and downloading but downloaded files are opening though i have installed converter at my end. Kindly provide alterantive FM to input .XLSX file in SAP and download the same on Server

Thanks

4 REPLIES 4

former_member182010
Active Participant
0 Kudos

Hello Parag,

To upload an excel file into an SAP program try using FM TEXT_CONVERT_XLS_TO_SAP.

To download an excel file to your local drive from SAP program try using FM SAP_CONVERT_TO_XLS_FORMAT.

Kind Regards,

Rae Ellen Woytowiez

0 Kudos

Hello Parag,

Please check with below Function Modules to upload .XLSX file into SAP Program

CALL FUNCTION 'WS_FILENAME_GET'

EXPORTING

def_filename = '*.XLSX'

def_path = 'C:\'

mask = ',.XLSX,.*.'

mode = 's'

title = ''

IMPORTING

filename = w_file

EXCEPTIONS

inv_winsys = 1

no_batch = 2

selection_cancel = 3

selection_error = 4

OTHERS = 5.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = w_file

i_begin_col = '1'

i_begin_row = '2' "we have a header row

i_end_col = '5'

i_end_row = '100'

TABLES

intern = it_import_table

EXCEPTIONS

inconsistent_parameters = 1

upload_ole = 2

OTHERS = 3.

IF sy-subrc NE space.

EXIT. " Drop out if there are issues

ENDIF.

To Download the .XLSX file:

If you have office '07 installed , it will automatically open similar to xlsx.

and you add the extension as .xlsx, i think it will be downloaded in that format only.

Regards,

Maheswari N

Former Member
0 Kudos

Hi Parag,

Have you tried ABAP2XLSX yet?, if not try the below link,

http://wiki.sdn.sap.com/wiki/display/ABAP/abap2xlsx

Regards,

Chen

Former Member
0 Kudos

I have used class CL_GUI_FRONTEND_SERVICES and file_copy