2008 Jan 23 2:23 PM
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)
2008 Jan 23 2:28 PM
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
2008 Jan 23 2:40 PM
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 ?
2008 Jan 23 2:52 PM
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
2008 Jan 23 3:00 PM
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
2008 Jan 23 5:07 PM
It is possible to copy file to server presentation in job backgrond?