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

Fetch excel file from app. server using open dataset...

aris_hidalgo
Contributor
0 Likes
516

Hello Experts,

Our functional consultant is asking me if it possible to get an excel file from the

application server file using OPEN dataset and in background mode? If yes, Please tell me on how to do this.

Thank you guys and take care!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
426

Hi,

data : fname(30) type c.

open dataset <fname> for input in binary mode.

trasfer fname to content.

close dataset <fname>.

Regards,

V.Balaji

Reward if Usefull...

2 REPLIES 2
Read only

Former Member
0 Likes
427

Hi,

data : fname(30) type c.

open dataset <fname> for input in binary mode.

trasfer fname to content.

close dataset <fname>.

Regards,

V.Balaji

Reward if Usefull...

Read only

Former Member
0 Likes
426

Hi Viraylab,

to download this the procedure:

you can use the FM 'EXCEL_OLE_STANDARD_DAT ' for this purpose.

this FM 'EXCEL_OLE_STANDARD_DAT' can be used to start Excel with a new sheet and transfer data from an internal table to the sheet.

Here are some of the parameters:

file_name: Name and path of the Excel worksheet file e.g. ?C:TEMPZTEST?

data_tab: Name of the internal table that should be uploaded to Exvcel

fieldnames: Internal tabel with column headers

How to build the field names table:

data: begin of i_fieldnames occurs 20,

field(60), end of i_fieldnames.

i_fieldnames-field = ?This is column 1?. append i_fieldnames-field.

i_fieldnames-field = ?This is column 2?. append i_fieldnames-field.

to upload follow this:

OPEN DATASET dsn FOR INPUT IN BINARY MODE.

DO.

READ DATASET dsn INTO itab-field.

IF sy-subrc = 0.

APPEND itab.

ELSE.

EXIT.

ENDIF.

ENDDO.

[/code]Rob

or Try this function module.

FILE_READ_AND_CONVERT_SAP_DATA

pass 'XLS' to I_FILEFORMAT..

Dont forgot to Reward me points .....All the very best....

Regards,

Sreenivasa sarma K.