Application Development 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: 

Download internal table to multiple sheets of an excel using OLE Object

Former Member
0 Kudos

Hi,

In an internal tale there may be more than 1Lac records.

Users want to download 65K records in one Sheet of Excel and then further 65K in another sheet and so on.

In this way the number of worksheet is variable.

I am using the below statement to pass the Sheet number i.e. Sheet1, Sheet2, etc.

DATA : sheet type ole2_object,

fl_sheet_name type char10.

SET PROPERTY OF sheet 'Name' = fl_sheet_name.

By using the above statement I get SY-SUBRC as 2 and the record is not passed to Excel.

If I change the statement to SET PROPERTY OF sheet 'Name' = 'Sheet1'.

It works fine.

Is there any limitation that we cannot set the parameters of OLE object through a variable?

Please let me know.

1 REPLY 1

sujeet2918
Active Contributor
0 Kudos

Hello Anurita,

Before "SET PROPERTY OF" statement you just Loop at your internal table from where you are going to explore in excel.

and check for the entry using tabix, if it excedes 65k then again loop the SET PROPERTY OF.

Hope it will work,

Regards,

Sujeet