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.
Showing results for 
Search instead for 
Did you mean: 

Leading zeros from data downloads

Former Member
0 Kudos


While downloading data from the ABAP tables, Excel removes the leading zeros automatically but in some SAP tables (NAST for example), those leading zeros are necessary to find the required associated data. Is there any way to prevent Excel from removing these zeros?

Thanks a lot!


Active Contributor
0 Kudos

Check this:

[Preserve Downloaded data formatting in Excel |]


Naimesh Patel

0 Kudos


There are two ways to solve it.

1) select complete columns in the Excel sheet and then assign the number format as ' TEXT ' in the sheet.Then u ll be able to see the leading zero's

2) If u donot want to wrk in Excel the way i have mentioned,then in the abap program just use the FM

"CONVERSION_EXIT_ALPHA_INPUT" over that field before uploading in a table.

By mistake i have told u the wrong way.the first way is for copying the data from text file to excel file and preserving the leading zeros.



Edited by: Kanishak Gupta on May 6, 2009 5:36 AM

Active Participant
0 Kudos

Hi Yogesh,

If ur downloading the data using se16 then change the display layout to ALV grid display. Once the data is displayed in ALV grid then use the inplace excel option of ALV grid. It will output the data in MHTML format which can be saved into (.xls,.xlsx) format. If ur downloading the data using FM 'GUI_DOWNLOAD' then open the file in Excel as text delimited and separate the fields using the identifier and convert it into text.

Hope it helps u.


Anil N.

Active Contributor
0 Kudos

while downloading excel will remove leading zeroes.

if u need to get the leadin zeros, declare that field as char.

Former Member
0 Kudos

Hi yogesh,

To get the file with leading 0s...first download the data in '.txt' format with tab delimited option.


1. From excel open ur txt file.

2. Select Radio button "Delimited"

3. Then select the delimiter i.e. separator which separates the data in ur txt file.

4. In the next screen select all the data and go for a "Text" format.

In this way u ll get the leading 0s.

Or the other way is take the data without 0s inexcel & when u upload the data put FM

'CONVERSION_EXIT_ALPHA_INPUT' to fetch the data.