10-23-2007 10:04 AM
Could someone tell me how How can i read local excel file into an internal table in webdynpro for abap application.
thank u for your reply
10-23-2007 10:42 AM
Deep,
File manuplations...............................
1. At the presentation level:
->GUI_UPLOAD
->GUI_DOWNLOAD
->CL_GUI_FRONTEND
2. At the application server level:
->OPEN DATASET : open a file in the application server for reading or writing.
->READ DATASET : used to read from a file on the application server that has been opened for reading
-> TRANSFER DATASET : writing data to a file.
-> CLOSE DATASET : closes the file
-> DELETE DATASET : delete file
************************************************************************************************
If file is on the local PC,use the function module GUI_UPLOAD to upload it into an internal table by passing the given parameters......
call function 'GUI_UPLOAD'
exporting
filename = p_file
filetype = 'ASC'
has_field_separator = '#'
tables
data_tab = t_data
******************************************************************************
p_file : excel file path.
t_data : internal table
*******************************************************************************
<b>reward points if useful.</b>
regards,
Vinod Samuel.
10-24-2007 1:46 AM
Samuel,thanks for your reply,but GUI* function doesn't work in webdynpro application when reading local file,I have already test it.
thank u.
10-24-2007 10:33 AM
Hi,
check this url:
https://www.sdn.sap.com/irj/sdn/webdynpro?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d
<b>reward points if useful.</b>
regards,
Vinod Samuel.
10-23-2007 2:09 PM
HI,
I CANT REMEMBER THE EXACY FUNCTION MODULE
I TELL U THE CLUE
U SEARCH FOR IT
ALSM_EXCEL_TO_INTERNAL_TABLE I THINK IT IS SO.
OR ELSE
SEARCH FOR FUNCTION MODULE """ ALSM_* ""
10-24-2007 12:22 PM
Hi
You can use this code
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
you can call this function module parameters are came
in this time declare the internal table name.
for example:
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = pv_name1
i_begin_col = 1
i_begin_row = 1
i_end_col = 40
i_end_row = 15614
TABLES
intern = pr_col_row
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE e000 WITH text-008. "Unable to open excel file.
ENDIF.
ENDFORM