‎2006 Nov 29 7:24 AM
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.
‎2006 Nov 29 8:01 AM
‎2006 Nov 29 8:17 AM
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
‎2006 Nov 29 8:23 AM
hi,
you can use the FM TEXT_CONVERT_XLS_TO_SAP.
its pretty simple.
regards,
Mahesh
‎2006 Nov 29 8:20 AM
use func module
ALSM_EXCEL_TO_INTERNAL_TABLE, Use unique spread sheet for uploading the data.
‎2006 Nov 29 8:21 AM
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
‎2006 Nov 29 8:25 AM
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
‎2006 Nov 29 9:07 AM
‎2006 Nov 29 9:16 AM
Hi,
If you know the no. of rows to be uploaded,you can use ALSM_EXCEL_TO_INTERNAL_TABLE function module.