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: 

Load Excel

Former Member
0 Kudos

Hi All

I Use this code

TYPES : BEGIN OF type_xldata,

string(800),

END OF type_xldata.

data: type_t_xldata TYPE STANDARD TABLE OF type_xldata.

CALL FUNCTION 'FAA_FILE_UPLOAD_EXCEL'

EXPORTING

i_filename = 'D:\2.xls'

I_DELIMITER = ';'

TABLES

et_filecontent = type_t_xldata

EXCEPTIONS

error_accessing_file = 1

OTHERS = 2.

if sy-subrc <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

All work, but load string only 255 char . Need load maximum 800 char in row.

help please..

thx.

13 REPLIES 13

Former Member
0 Kudos

hi,

instead of string , kindly try using CE_STRING, which don't have limit of characters.

TYPES : BEGIN OF type_xldata,

string(800), " CE_STRING.

END OF type_xldata.

Thanks,

Pavan

0 Kudos

have DUMP in function..

OBJECT_MOVE_NOT_SUPPORTED

0 Kudos

hi Andrey,

i wrote the below code and i am not getting any dump. kindly check.

TYPES : BEGIN OF type_xldata,

pav type CE_STRING,

END OF type_xldata.

data: type_t_xldata TYPE STANDARD TABLE OF type_xldata.

CALL FUNCTION 'FAA_FILE_UPLOAD_EXCEL'

EXPORTING

i_filename = 'D:\2.xls'

I_DELIMITER = ';'

TABLES

et_filecontent = type_t_xldata

EXCEPTIONS

error_accessing_file = 1

OTHERS = 2.

if sy-subrc = 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

pls let me know still if you have issue

thanks,

Pavan

0 Kudos

Copy You code, and have DUMP anyway

When run code

0 Kudos

hi,

kindly check weather your system had D Drive or not else change the drive to C.

kindly pass some dummy data to internal table, because your internal table is blank.

Thanks,

Pavan

Edited by: pavan kumar pisipati on Nov 21, 2008 12:44 PM

0 Kudos

if Im use string(800), All work, but string < 255 chars.

if use CS_STRING, when run have dump and error in function body

0 Kudos

hi,

when i went to function module, it is alsmex_tabline, kindly use this

begin of ty_table

pav type alsmex_tabline,

end of ty_table.

use CE_STRING not CS_STRING

and kindly check the delimeter you using is ';' , but the function module default value is ','.

if still issue persists, kindly goto SE37 and execute the function module over their and check

thanks,

pavan

Edited by: pavan kumar pisipati on Nov 21, 2008 12:53 PM

0 Kudos

yes, i use CE_STRING

if use pav type alsmex_tabline,

Work. but PAV-VALUE ONLY 50 CHAR

0 Kudos

hi,

i think we are comeing closer to the solution,

kindly use tabline only instead of alsmex_tabline

if this also not worked out, i think you need find for other FM for u r requirement.

just now i executed the functiona module with a xls sheet, what my understanding is we can use alsemex-tabline, because it is allocatting 50 character for each column and row. so i think this will solve your problem.

thanks,

Pavan

Edited by: pavan kumar pisipati on Nov 21, 2008 1:23 PM

Former Member
0 Kudos

Make a Z copy of ALSM_EXCEL_TO_INTERNAL_TABLE.

In tables tab, you will find an entery

INTERN LIKE ALSMEX_TABLINE

Now if u look at structure of ALSMEX_TABLINE, u willl find a field VALUE of type CHAR50.

This restricts u from uploading data more than 50 char from a single cell of excel.

Wat u need to do is, make a Z copy of structure ALSMEX_TABLINE. And edit the type of VALUE field to char5000 or some custom data element.

Now in FM ZALSM_EXCEL_TO_INTERNAL_TABLE in tables tab use ZALSMEX_TABLINE instead of ALSMEX_TABLINE. You will need to replace all refrences of data objects in FM coding from ALSMEX_TABLINE to ZALSMEX_TABLINE --> This is a critical step. Now activate the FM ZALSM_EXCEL_TO_INTERNAL_TABLE and now you will be able to upload any length of data from a single excel file cell.

Regards,

Amit

0 Kudos

thx i try

Former Member
0 Kudos

Kindly close the thread and award points

0 Kudos

I use this function TEXT_CONVERT_XLS_TO_SAP...

All work