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: 

Problem with FM ALSM_EXCEL_TO_INTERNAL_TABLE

Former Member
0 Kudos

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

5 REPLIES 5

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi

You can use FM GUI_UPLOAD for the same.

Pass parameters file name with extension .xls and file type as DAT.

BR,

Lokeswari.

Former Member
0 Kudos

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.

0 Kudos

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

0 Kudos

Hi

Set the value I_LINE_HEADER to 'X', FM starts reading from the second line.

~~~Ganesh Kumar K.