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

excel to internal table

Former Member
0 Likes
1,187

Hi,

Could anybody tell me, if I have the number of sheets in the excel sheet, then how can I upload the data from excel sheet to internal table.

Thanks,

bsv,

Hi,

Could anybody tell me, if I have the number of sheets in the excel sheet, then how can I upload the data from excel sheet to internal table.

Thanks,

bsv,

8 REPLIES 8
Read only

Former Member
0 Likes
1,137

Hi

You can use the fun module

GUI_DOWNLOAD or

ALSM_EXCEL_TO_INTERNAL_TABLE

Reward points for useful Answers

Regards

Anji

Read only

Former Member
0 Likes
1,137

Hi

In this case only one funciton module can help you.

FM: <b>ALSM_EXCEL_TO_INTERNAL_TABLE</b>

Thanks and Regards,

Kunjal Patel

Read only

Former Member
0 Likes
1,137

Hi,

<b>How can I download my internal table into an Excel file?</b>

Use the function module SAP_CONVERT_TO_XLS_FORMAT to download the internal table to an excel file.

PARAMETERS: p_file LIKE rlgrap-filename DEFAULT 'c:\tmp\test.xls'.

DATA: t100_Lines TYPE STANDARD TABLE OF t001 WITH DEFAULT KEY.

SELECT * FROM t001 INTO TABLE t100_Lines.

CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'

EXPORTING

i_filename = p_file

TABLES

i_tab_sap_data = t100_Lines.Or get much more control by creating an XML file

<b>How can I read an Excel file from presentation server?</b>

You can use the Function module ALSM_EXCEL_TO_INTERNAL_TABLE to read the Excel file into the internal table of type alsmex_tabline. From this internal table you can fill the target internal table.

TYPES:

BEGIN OF ty_upload,

field1 TYPE c length 12,

field2 TYPE c length 12,

field3 TYPE c length 12,

END OF ty_upload.

DATA it_upload TYPE STANDARD TABLE OF ty_upload WITH DEFAULT KEY.

DATA wa_upload TYPE ty_upload.

DATA itab TYPE STANDARD TABLE OF alsmex_tabline WITH DEFAULT KEY.

FIELD-SYMBOLS: &lt;wa&gt; type alsmex_tabline.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

EXPORTING

filename = filename

i_begin_col = 1

i_begin_row = 1

i_end_col = 3

i_end_row = 65535

TABLES

intern = itab.

LOOP AT itab ASSIGNING &lt;wa&gt;.

CASE &lt;wa&gt;-col.

WHEN '0001'.

wa_upload-field1 = &lt;wa&gt;-value.

WHEN '0002'.

wa_upload-field2 = &lt;wa&gt;-value.

WHEN '0003'.

wa_upload-field3 = &lt;wa&gt;-value.

ENDCASE.

APPEND wa_upload TO it_upload.

CLEAR wa_upload.

ENDLOOP.

Regards,

Ranjit Thakur.

<b>Please Mark The Helpful Answer.</b>

Read only

Clemenss
Active Contributor
0 Likes
1,137

Hi bsv,

please try a forum search "excel to internal table" then ask remeining deteils.

Regards,

Clemens

Read only

Former Member
0 Likes
1,137

Hi,

Use the FM <b>TEXT_CONVERT_XLS_TO_SAP</b>.

It will convert the excel to an internal table format.

After that use <b>GUI_DOWNLOAD </b>

For More Info,

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/36f08758-0a01-0010-c291-c03004ae...

Regards,

Padmam.

Read only

varma_narayana
Active Contributor
0 Likes
1,137

Hi..

to upload data of an Excel file into internal table

You can use the GUI_UPLOAD fUNCTION MODULE. Specify the filename as YourFile.xls

You can also try with FM KCD_EXCEL_OLE_TO_INT_CONVERT

Reward if it helps.

Regards.

Read only

Former Member
0 Likes
1,137

hi,

u can use GUI_DOWNLOAD or

ALSM_EXCEL_TO_INTERNAL_TABLE Function Modules.

if useful reward some points.

with regards,

Suresh.A

Read only

Former Member
0 Likes
1,137

Hi,

As per my understanding, u want to upload data frm Excel to internal table, if the excel sheet has more than one work sheet.

Check the link below:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/36f08758-0a01-0010-c291-c03004ae...

Regards

Kannaiah