‎2006 Dec 17 7:38 AM
hi all
i am using function module ALSM_EXCEL_TO_INTERNAL_TABLE for uploading Excel file..
in this FM length is restricted to 50 charecters .
but in my file one column is having 100 charecters
how i can solve this problem.
‎2006 Dec 17 7:40 AM
Use GUI_UPLOAD instead. That will solve your problem.
- Guru
Reward points for helpful answers
‎2006 Dec 17 7:45 AM
hi guru,
can u send me sample piece of code.. its very urgent,
i dont have idea on Gui_upload for excel.
Thanks & Regards
harsha
‎2006 Dec 17 7:50 AM
types: begin of ttab,
rec(1000) type c,
end of ttab.
types: begin of tdat,
fld1(10) type c,
fld2(10) type c,
fld3(10) type c,
end of tdat.
data: itab type table of ttab with header line.
data: idat type table of tdat with header line.
data: file_str type string.
parameters: p_file type localfile.
at selection-screen on value-request for p_file.
call function 'KD_GET_FILENAME_ON_F4'
exporting
static = 'X'
changing
file_name = p_file.
start-of-selection.
file_str = p_file.
call function 'GUI_UPLOAD'
exporting
filename = file_str
tables
data_tab = itab
exceptions
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
others = 17.
delete itab index 1.
loop at itab.
clear idat.
split itab-rec at cl_abap_char_utilities=>horizontal_tab
into idat-fld1
idat-fld2
idat-fld3.
append idat.
endloop.
loop at idat.
write:/ idat-fld1, idat-fld2, idat-fld3.
endloop.
- Guru
Reward points for helpful answers
‎2006 Dec 17 8:45 AM
hi,
chk these links.code is there. just use it.
http://www.sapdevelopment.co.uk/file/file_uptabpc.htm
http://www.sapdevelopment.co.uk/file/file_upexcel.htm
Regards
Anver
‎2006 Dec 18 4:11 AM
hi ,
u can use the FM GUI_UPLOAD.
To use this u have to convert the excel file to tab-delimited file.if u dose this the file will be stored as *.TXT file .
Then u can use gui_upload.
with regards,
magesh.