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: 

Excel Sheet upload!

Former Member
0 Kudos
116

Hi,

I am uploading data from excel sheet. Which is the suitable fm?

One problem is , excel sheet contents 2-3 spreadsheets in first there is data and in second it contains picture file. So while uploading it creates the problem

How can i solve it as i dont want to manipulate excel sheet.

Thanks in advamce.

8 REPLIES 8

Former Member
0 Kudos
75

Any solution?? lttile Urgent!

Former Member
0 Kudos
75

Hi,

Try this FM.

  • CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'

  • EXPORTING

  • filename = p_file

  • i_begin_col = p_scol

  • i_begin_row = p_srow

  • i_end_col = p_ecol

  • i_end_row = p_erow

  • TABLES

  • intern = IT_INTERN

  • EXCEPTIONS

  • inconsistent_parameters = 1

  • upload_ole = 2

  • OTHERS = 3.

An alternative is 'ALSM_EXCEL_TO_INTERNAL_TABLE'.

But you can never upload pictures thru this....

Rewards points if helpful.

Regards,

Kirti

0 Kudos
75

hi,

you can use the FM TEXT_CONVERT_XLS_TO_SAP.

its pretty simple.

regards,

Mahesh

Former Member
0 Kudos
75

use func module

ALSM_EXCEL_TO_INTERNAL_TABLE, Use unique spread sheet for uploading the data.

Former Member
0 Kudos
75

check this below code may be helpful for you

Uploading data from Excel

Sample source for uploading data from excel into any ztable.

You can use the following code and get an idea……

-


REPORT ZEXCEL_TO_INTERNAL .

data: begin of itab occurs 0,

name(20) type c,

addre(20) type c,

end of itab.

DATA : ITAB1 LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.

DATA : B1 TYPE I VALUE 1,

C1 TYPE I VALUE 1,

B2 TYPE I VALUE 100,

C2 TYPE I VALUE 9999.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

FILENAME =

'C:\Documents and Settings\administrator\Desktop\ppcon001bd_24.xls'

I_BEGIN_COL = B1

I_BEGIN_ROW = C1

I_END_COL = B2

I_END_ROW = C2

TABLES

INTERN = itab1

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.

loop at itab1.

write:/ itab1.

Endlop.

mark the helpful answers

Regards,

Naveen

Former Member
0 Kudos
75

hi,

plz chkout this link for excelsheet upload

http://www.sapdevelopment.co.uk/file/file_upexcel.htm

i dont think that u can upload data with 2-3 spreedsheets,copy tha data u want to upload in seperate excel file & then upload

Thanks

Madhuri

former_member188685
Active Contributor
0 Kudos
75

Check this thread..

may be that can help you in solving your issue.

Regards

Vijay

jayanthi_jayaraman
Active Contributor
0 Kudos
75

Hi,

If you know the no. of rows to be uploaded,you can use ALSM_EXCEL_TO_INTERNAL_TABLE function module.