Application Development and Automation 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: 
Read only

problem Loading data From excel to sap internal table.

Former Member
0 Likes
792

Hi,

i hve a req where in the excel sheet contains some columns having multi line data eg tabs, newline, etc for a single row/record. for eg.

123 xyz sweden

belgium

124 abc finland

dutch

so in the abve case 3rd column contains multi line data like tabs, newline, etc. So need to know any function module which can be used to upload the same in the sap internal table.

Thanks,

Punit Raval.

Hi,

i hve a req where in the excel sheet contains some columns having multi line data eg tabs, newline, etc for a single row/record. for eg.

123 xyz sweden

belgium

124 abc finland

dutch

so in the abve case 3rd column contains multi line data like tabs, newline, etc. So need to know any function module which can be used to upload the same in the sap internal table.

Thanks,

Punit Raval.

5 REPLIES 5
Read only

Former Member
0 Likes
758

Hi!

For uploading the excel, you can use the ALSM_EXCEL_TO_INTERNAL_TABLE fm.

Unfortunately you have to handle the specialities within your excel, during uploading.

Regards

Tamá

Read only

vallamuthu_madheswaran2
Active Contributor
0 Likes
758

Hi Punit,

Try the function module 'GUI_UPLOAD'.

Thanks & Regards,

vallamuthu.M

Read only

mrio_espinheira
Participant
0 Likes
758

Hello,

You can use FM ALSM_EXCEL_TO_INTERNAL_TABLE to upload an Excel file with cells that contain multiple lines.

e.g. you have an Excel file in which the first Cell (A1) has the following content:

ONE

TWO

THREE

When you use the mentioned FM, the content of that cell in the TABLES parameter will be:

ROW - 0001

COL - 0001

VALUE - "ONE#TWO#THREE"

You have to be careful, because the VALUE field only stores 50 characters, so the information in each cell of the Excel file can't exceed that or the remaining characters will be ignored.

Best regards,

Mário Espinheira

Read only

Former Member
0 Likes
758

u try like this...

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = 'c:/.....xls'

i_begin_col = 1

i_begin_row = 2 ( 1st row u writing columms titles)

i_end_col = 50

i_end_row = 100 ( end of record)

tables

intern = it_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.

Read only

Former Member
0 Likes
758

This message was moderated.