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

Upload Excel File

Former Member
0 Likes
915

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
735
5 REPLIES 5
Read only

Former Member
0 Likes
735

hi Nayan,

Check out the below related threads

Read only

Former Member
0 Likes
736
Read only

0 Likes
735

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?

Read only

0 Likes
735

Hi,

Goto SE11->Type group->enter SOI.

You can find the appropriate declaration.

Regards,

Bhaskar

Read only

Former Member
0 Likes
735

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