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 to upload paragaragh from excel to internal table

Former Member
0 Kudos

Hi all,

Pl tell me

how to upload paragaragh from excel to internal table..

Thanks,

Naresh

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi

you can Upload data from Excel sheet to internal table.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = p_pfile " name of file

i_begin_col = 1

i_begin_row = 2

i_end_col = 13

i_end_row = 8

TABLES

intern = it_tab "name of internal table

EXCEPTIONS

inconsistent_parameters = 1

upload_ole = 2

OTHERS = 3.

IF sy-subrc 0.

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

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

ENDIF.

thanks,

4 REPLIES 4

former_member184619
Active Contributor
0 Kudos

Hi Naresh,

Use Function Module

'ALSM_EXCEL_TO_INTERNAL_TABLE'

Regards,

Sachin

Former Member
0 Kudos

hi

you can Upload data from Excel sheet to internal table.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = p_pfile " name of file

i_begin_col = 1

i_begin_row = 2

i_end_col = 13

i_end_row = 8

TABLES

intern = it_tab "name of internal table

EXCEPTIONS

inconsistent_parameters = 1

upload_ole = 2

OTHERS = 3.

IF sy-subrc 0.

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

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

ENDIF.

thanks,

0 Kudos

Hi,

I have tried this FM. but i am able to upload only a single sentence in my EXCEL sheet,where i have a paragraph in my excel. pl help on this.

Regards,

Naresh

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