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

Read Excel from sap server HDD

Former Member
0 Likes
776

I want to read xls from path wich I see by FM RZL_READ_DIR_LOCAL (server space) and how to read xls format to itab from this path?

ALSM_EXCEL_TO_INTERNAL_TABLE work only on local HDD (not server space)

I want to read xls from path wich I see by FM RZL_READ_DIR_LOCAL (server space) and how to read xls format to itab from this path?

ALSM_EXCEL_TO_INTERNAL_TABLE work only on local HDD (not server space)

5 REPLIES 5
Read only

Former Member
0 Likes
749

Hi,

You need to use the OPEN DATASET and READ DATASET statements.

Here is a sample, This program will upload a comma delimited file from app server, and break it up into specific fields of an ITAB.

report ztest_0001

no standard page heading.

parameters: d1 type localfile default '/usr/sap/TST/SYS/Data1.csv'.

data: begin of itab occurs 0,

fld1(20) type c,

fld2(20) type c,

fld3(20) type c,

end of itab.

data: wa(2000) type c.

start-of-selection.

open dataset d1 for input in text mode.

if sy-subrc = 0.

do.

read dataset d1 into wa.

if sy-subrc 0.

exit.

endif.

split wa at ',' into itab-fld1 itab-fld2 itab-fld3.

append itab.

enddo.

endif.

close dataset d1.

Regards,

Satish

Read only

Former Member
0 Likes
749

Yes it is possible but I have to problem to read .xls (I must) not .csv.

Maybe you know method to convert this xls to human format ?

Read only

Lakshmant1
Active Contributor
0 Likes
749

Hi Kosmo,

You can use FM C13Z_APPL_TO_FRONT_END to copy file from app. server to presentation server and then use FM ALSM_EXCEL_TO_INTERNAL_TABLE.

Hope this helps

Thanks

Lakshman

Read only

Former Member
0 Likes
749

Somone wrota example with usage

CL_ABAP_CHAR_UTILITIES=>horizontal_tab to read XLS but

this class don't work me. I have sap 4.6

Read only

Former Member
0 Likes
749

It is possible to copy file to server presentation in job backgrond?