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: 

Copy to clipboard - export to excel

Former Member
0 Kudos

Hello everybody,

I'm trying to export data to multiple sheets in excel. To do this I use FM 'CLPB_EXPORT' where I give table with single column wchich contains eg:

CellA1#CellB1#CellC1#...

And when I paste clipboard to excel I get data in separated columns. The problem is when table cointains strings with left zeroes, it means:

0000321#00000021334#....

Then when I paste clipboard to excel I get:

321 21334 ....

I need to have all strings, but this function module deletes left zeroes. Is there any solution for this problem?

Thanks for any answer.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Isn't this an excel formatting issue? Excel will automatically converts string numbers to numbers, hence the deletion of leading 0...

You could pass the value with a quote in front (e.g: '0000321#'00000021334#....) to force excel to consider those fields as texts and not numbers. Or you could play with OLE to cutomize the related excel column so it has a text format...

Hope this helps,

Kr,

Manu.

3 REPLIES 3

Former Member
0 Kudos

I guess the problem is not with the Function Module but with the formatting of excel sheet. By default excel sheet remove the leading zeroes. Enter 001 in excel and it will be stored as 1 until unless text format for that cell is specified..

0 Kudos

So how can i change cell format?

Former Member
0 Kudos

Hi,

Isn't this an excel formatting issue? Excel will automatically converts string numbers to numbers, hence the deletion of leading 0...

You could pass the value with a quote in front (e.g: '0000321#'00000021334#....) to force excel to consider those fields as texts and not numbers. Or you could play with OLE to cutomize the related excel column so it has a text format...

Hope this helps,

Kr,

Manu.