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

XLS multiple Sheet Data Upload to Internal Tables

Former Member
0 Likes
1,568

Hi All,

Required one help.

There are many FMs which are Uploading XLS to Internal Tables.

But is there any function module, which picks up the data from All the sheets available in XLS file,

and Upload it to Internal Table.

Thanks,

Jimit Vadher

Hi All,

Required one help.

There are many FMs which are Uploading XLS to Internal Tables.

But is there any function module, which picks up the data from All the sheets available in XLS file,

and Upload it to Internal Table.

Thanks,

Jimit Vadher

12 REPLIES 12
Read only

Former Member
0 Likes
1,467

For multiple sheets upload ,could you try OLE?

Read only

Former Member
0 Likes
1,467

Hi

There are two static methods of the class CL_UA_EXCEL_TOOLS.

1. READ_CELL_FROM_ANNOTATION - This will read cell contents from connected file.

2. READ_CELL_FROM_LOCAL_FILE_INT - This will read cell contents from local file.

Call any of these method according to your requirement.

Hope this helps you.

Regards

Vinodh

Read only

0 Likes
1,467

Hi Vinodh,

Thanks

Method is getting executed, but how can i pick the data, as nothing gets uploaded from EXL sheet

Pl. help.

Regards,

Jimit

Edited by: Jimit59 on Oct 15, 2010 11:44 AM

Read only

Former Member
0 Likes
1,467

hi

use that class and method from your abap program and write a query and see whether it is uploaded or not.

Read only

Former Member
0 Likes
1,467

Hi

Once the method gets executed, you can look into your internal table whether it has been populated or not. It would have uploaded the files from all the cells. If you want to test, just for your case, use a write command and check it.

Regards

Vinodh

Read only

0 Likes
1,467

hi Vinodh,

I m not getting any value.

Pl. find the code.

DATA : value TYPE string.

DATA : e_value TYPE UAB_TEXT.

TRY.

CALL METHOD CL_UA_EXCEL_TOOLS=>READ_CELL_FROM_LOCAL_FILE

EXPORTING

ID_PATH = 'D:\Approved BP 10-11.xls'

  • ID_SHEET =

  • ID_CELL =

  • ID_ALIAS =

RECEIVING

ED_VALUE = e_value.

CATCH CX_UA_FORMULA_EXCEPTION .

ENDTRY.

WRITE : e_value.

pl. guide.

thanks,

Jimit

Read only

Former Member
0 Likes
1,467

Hi Jimit

For the code you have written, it will return only the title of the program given. My suggestion will be try to load into custom internal table and check whether its being populated or not. In the table you have used, UAB_TEXT we can not see the contents. Create a custom table as UAB_TEXT and see whether it gets populated.

Hope this information is useful.

Regards

Vinodh

Read only

0 Likes
1,467

hi Vinodh,

requesting you to pl provide the code,, if you have any, as I m not geting data,

also not able to understand, how shall I get data into custom table.

Thanks,

Jimit

Read only

0 Likes
1,467

hey,

thanks for support,

but finally i got some code, which is downloading all sheets to Internal Table.

If any body wants, pl. refer below link :

http://wiki.sdn.sap.com/wiki/display/Snippets/ReadmultiplesheetsofanExcelfileintoSAP+through

Thanks,

Jimit Vadher

Edited by: Jimit59 on Oct 19, 2010 1:07 PM

Read only

Former Member
0 Likes
1,467

http://wiki.sdn.sap.com/wiki/display/Snippets/ReadmultiplesheetsofanExcelfileintoSAP+through

Edited by: Jimit59 on Oct 19, 2010 1:06 PM

Read only

0 Likes
1,467

Jimit,

Link provided by you is not working. Please provide the appropriate one.

Cheers

VJ

Read only

_IvanFemia_
Active Contributor
0 Likes
1,467

Hi,

try to read these blogs

[abap2xlsx - Generate your professional Excel spreadsheet from ABAP|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/20046] [original link is broken] [original link is broken] [original link is broken];

[xlsx2abap - Read and edit your Excel files from ABAP|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/20791] [original link is broken] [original link is broken] [original link is broken];

Code of this SCN Community project is shared on [Code Exchange|https://cw.sdn.sap.com/cw/groups/abap2xlsx]

Regards

Ivan