‎2008 Apr 29 10:04 AM
Hello,
Is it possible to upload an excel sheet with data included in multiple tabs?
I guess the function module ALSM_EXCEL_TO_INTERNAL_TABLE does not have this provision. Pls provide me with a solution if there exists any.
Thanks & Regards
Nayan Kurup
‎2008 Apr 29 10:07 AM
Hi,
Check the following link:
http://sap-img.com/abap/uploading-multiple-multitab-excel-sheets-or-ranges.htm
Regards,
Bhaskar
‎2008 Apr 29 10:07 AM
‎2008 Apr 29 10:07 AM
Hi,
Check the following link:
http://sap-img.com/abap/uploading-multiple-multitab-excel-sheets-or-ranges.htm
Regards,
Bhaskar
‎2008 Apr 29 10:28 AM
Hi Bhaskar,
I checked the link that u have given here. I tried to create the Fucntion module on my system and
CALL METHOD spreadsheetintf->get_ranges_data
IMPORTING
contents = zjnccontents
error = zjncerror
retcode = zjncretcode
CHANGING
ranges = zjncranges.
is throwing an error. It says that zjncerror and zjncretcode are not declared. zjnccontents is declared as soi_generic_table. DO u have any idea abt the other two declarations?
‎2008 Apr 29 11:02 AM
Hi,
Goto SE11->Type group->enter SOI.
You can find the appropriate declaration.
Regards,
Bhaskar
‎2008 Apr 29 10:08 AM
Try FM
TEXT_CONVERT_XLS_TO_SAP
make I_FIELD_SEPERATOR = 'X'
If you are looking to upload an excel file having data in mutiple worksheets the you can
try this:
CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
PERFORM ERR_HDL.
EXCEL Ergebnis anzeigen
SET PROPERTY OF H_EXCEL 'Visible' = 1.
PERFORM ERR_HDL.
get list of workbooks, initially empty
CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
PERFORM ERR_HDL.
Eine bestehende Excelmappe öffnen
CALL METHOD OF H_MAPL 'OPEN' EXPORTING #1 = P_PCFILE.
PERFORM ERR_HDL.
1. Workdsheeet ansteuern
CALL METHOD OF H_EXCEL 'Worksheets' = H_WORK EXPORTING #1 = 1.
PERFORM ERR_HDL.
CALL METHOD OF H_WORK 'Activate'.
PERFORM ERR_HDL.
Zellbereich festlegen
CALL METHOD OF H_WORK 'Cells' = H_CELL
EXPORTING #1 = 2 #2 = 1.
PERFORM ERR_HDL.
CALL METHOD OF H_WORK 'Cells' = H_CELL1
EXPORTING #1 = 50 #2 = 9.
PERFORM ERR_HDL.
CALL METHOD OF H_WORK 'RANGE' = H_RANGE
EXPORTING #1 = H_CELL #2 = H_CELL1.
PERFORM ERR_HDL.
Bereich auswählen.
CALL METHOD OF H_RANGE 'SELECT'.
PERFORM ERR_HDL.
In die zwischenablage (Clippboard) einfügen
CALL METHOD OF H_RANGE 'COPY'.
PERFORM ERR_HDL.
*
Buffer einlesen und in interne ALV-Tabelle überführen
CALL METHOD CL_GUI_FRONTEND_SERVICES=>CLIPBOARD_IMPORT
IMPORTING
DATA = ITAB_BUF.
*
reward if helpful