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 getting truncated in .CSV format GUI_DOWNLOAD

abdul_hakim
Active Contributor
0 Kudos

Hello experts,

I am trying to download the data using GUI_DOWNLOAD in .CSV format but the leading zeros are getting truncated. For instance Company code 0001 is displayed as 1 in the CSV File. But when I open the same file in notepad I am seeing 0001. Is this a known issue or this is how .CSV format should be?

I have gone through some threads in SDN but they are not helpful.

Your expert advise is much appreaciated.

Thanks

Abdul Hakim

3 REPLIES 3

Former Member
0 Kudos

That is how excel displays values like 0001. It interprets them as a number and removes leading zeros.

If you don't want this happen and you want excel to treat them like text, you need to append a quote at the beginning of the token like '0001

You can use concatenate like below to append a single leading quote

field = '0001'.
CONCATENATE ''''  field INTO field.

0 Kudos

Vishnu, It is not happening with CSV.

Thanks

Abdul Hakim

deepak_dhamat
Active Contributor
0 Kudos

Hi ,

Save your File in .txt format using gui_download.

Open blank excell file and import txt file and during that change colummn properties as TExt .

regards

Deepak.