12-09-2010 8:54 AM
Hi All,
Im uploading an excel file of some texts to application server..
Have used the FM ALSM_EXCEL_TO_INTERNAL_TABLE for uploading...
Problem is in the excel file there are texts of length morethan 50characters...in the above FM it can hold only the texts upto 50char only..( ALSMEX_TABLINE->VALUE-->CHAR50)
Pls help me hw to resolve this issue..or suggest if any another FM available to achieve the same with an example..
Thanks,
Priya
12-09-2010 9:08 AM
Hi,
Take GUI_UPLOAD function module using that function module we can upload excel data.
types:begin of ty_Data,
textfile(300) type c,
end of ty_data.
data:itab type standard table of ty_data.
call function gui_upload
filename = 'ABC.XLS'.
TABLES.
TABLE = ITAB.
regards,
muralii
12-09-2010 9:09 AM
Hi
You can use FM GUI_UPLOAD for the same.
Pass parameters file name with extension .xls and file type as DAT.
BR,
Lokeswari.
12-09-2010 9:21 AM
Hi,
Use FM TEXT_CONVERT_XLS_TO_SAP. Below is the sample code.
TYPE-POOLS : truxs.
DATA :it_type TYPE truxs_t_text_data.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_type
i_filename = p_file
TABLES
i_tab_converted_data = it_input_file
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
it_input_file is the input table with the fields.
~~~Ganesh Kumar K.
12-09-2010 10:19 AM
Hi All..
Thanks for your replies..
This FM 'TEXT_CONVERT_XLS_TO_SAP' works out for the requirement..
But the problem is if I use the header..the data iss not getting uploaded to internal table..getting sy-subrc 1 -->Conversion failed..
So have removed the header and checked..its working fine..
Now my concern is I want the the header also to be uploaded...
Pls suggest me hw can it be acheived?
Thanks,
Priya
12-09-2010 10:29 AM
Hi
Set the value I_LINE_HEADER to 'X', FM starts reading from the second line.
~~~Ganesh Kumar K.