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

Omit zero in excel

Former Member
0 Likes
703

Hi !

I create a report to download data in a excel file .

But when i pass a number 0001 the file excel puts 1 .

CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.

SET PROPERTY OF cells 'Value' = itab-objectid.

the itab-objectid as the zero but the file doesn't .

Thanks a lot !

Message was edited by:

Grazia Sasso

6 REPLIES 6
Read only

Former Member
0 Likes
649

Hi!

In excel, if the filed has the value 0001, it will appear, depending on the cell format.

With cell format "Number" it will appear as 1.

With cell format "Text", it will appear as 0001.

Check your cell format in excel.

Regards

Tamá

Read only

0 Likes
649

Hi,

Me too had the same problem, you have to change it in excel only, becasue out of SAP u cant control anything.

You can look any options there in fieldcatalog, i dont think it will help, but u look.

Read only

0 Likes
649

So...can i set the cell format in abap code ? If yes....in which way ?

Read only

0 Likes
649

Hi!

You might try using excel-in-place instead of downloading. It is very easy to set up and maybe in this way it is possible to set cell formats. I don't know about setting excel cell formats in SAP, but if it can be done, it can be done this way.

Excel-in-place

1. Upload excel template into OAOR

2. Enabling the macros within excel

3. Consulting with SAP OSS Note 548409 - about the exact settings.

Regards

Tamá

Read only

0 Likes
649

thanks to all i have done it !!

Read only

Former Member
0 Likes
649

to keep the value as 001 in excel sheet u need to put a '001 in the excel sheet and it will show as 001 in the excel output......may be u modify ur internal table data by appending ' to the field and then try to download to excel sheet and it will come as 001.