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: 

Display of leading zeroes when downloaded from ALV to excel

Former Member
0 Kudos
391

Hi All,

I have a problem in ALV grid display.

There is a specific field which has value starting from '001' to '999'. This is a char(3) type of variable.

The problem is that the display shows the value as '001' which is correct. but when the same file is dwnloaded to excel using standard SAP functionality, the value of the field gets changed to '1' instead of '001'.

Is there any option by which this can be controlled. Please let me know, its urgent!!

thanks

4 REPLIES 4

JozsefSzikszai
Active Contributor
0 Kudos
103

hi Ankur,

the Excel download is done by Z program? IF yes you have to do:

SET PROPERTY OF go_cell 'NumberFormat' = '@'.

this will set the Excel cell to Text type and leading zeros won't be lost.

ec

0 Kudos
103

Can u please elaborate...i did not find any parameters as go_cell. Where can i find it?

Just to confirm. The report is a Z, but the excel dwnload is done by standard button provided by the REUSE_ALV_GRID_DISPLAY FM on the output screen for user action.

0 Kudos
103

if the Excel download is done by REUSE_ALV... FM, than you can't use my advise. It only works if the Excel download is completele manually developed.

Former Member
0 Kudos
103

here is ur answer: