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: 

How can i read local excel file into internal table in webdynpro for abap a

Former Member
0 Kudos

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

5 REPLIES 5

Former Member
0 Kudos

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.

0 Kudos

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.

Former Member
0 Kudos

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_* ""

Former Member
0 Kudos

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