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: 

Leading zero

Former Member
0 Kudos
540

Hi,

I working in table control.When i click the download button then all the material number which is in table control should be download in local excel file.

Its working fine.But the leading zero of the material number is removed.

Is it possible to download the material with leading zero.If then please guide me.

Regards,

K.Sudhakaran.

9 REPLIES 9

Former Member
0 Kudos
94

Hi

Are you sure the leading zero is removed by excel and not while downloading it?

Max

0 Kudos
94

Hi max,

Yes sure the leading zeros are available till the last internal table. After excel only zeros are removed.

With out excel configure how can i download data with leading zeros ?.Because client doesnt know abt excel configuration.

Regards,

K.Sudhakaran.

0 Kudos
94

Sudha,

Sorry for a mis-leading answer before. i didnt think through the problem before giving you an answer. The thing here is there are leading zeroes added to your data as long as your data stays in SAP. You will also see leading leading zeroes if you have downloaded the file as a text file.

But the problem here is Excel has already been set to remove zeroes from the front of a number if that particular coloumn has been declared as a numerical field. You try to show your user to change that field in excel to character so that there will be leading zeroes again.

Unfortunately, there is not much we can do on the SAP side, as SAP is giving the number out with leading zeroes and excel is doing the trick for you.

Regards

Aneesh.

0 Kudos
94

Hi,

when handing the values to excel you could change your value to this: '=REPLACE(". That will also force excel to render your value as text.

Message was edited by:

Martin Schöffler

Former Member
0 Kudos
94

Sudha,

Use function module <b>CONVERSION_EXIT_ALPHA_INPUT</b> before downloading to add leading zeroes.

Regards

Aneesh.

0 Kudos
94

Sometimes sticking a single quote in front works, eg '0000000012345689. You may have to do that in a temporary table to avoing mashing the existing values.

It might make a difference what type of file you're downloading - is it excel, tab delimited, CSV.

(oops, didn't see Martin had said the same thing)

0 Kudos
94

Hi All,

This can be solved in a better and simpler way as follows:

CONCATENATE '="' wa-field_name '"' INTO wa-field_name.

This should solve the problem

Thanks,

Jiten

0 Kudos
94

thanx...

Former Member
0 Kudos
94

No, in excel you have to define the column as text and not number. If you define it as a number it will remove the leading zeros. So if you have a downloaded tab delimited file, when you open in excel, first define the column attributes where you want to display the leading zeros.

Albert