cancel
Showing results for 
Search instead for 
Did you mean: 

Keep leading zeroes when we write to CSV File

Former Member
0 Kudos

Hi Experts, For Example My Source Field  ---AAAAA------datatype v(13)-- has value 01234567891, when i write to csv file  and when i open the file in Xl, it looses the leading zero Any Suggesion for not loosing the leading zero Thanks

View Entire Topic
former_member187605
Active Contributor

Is the sole purpose of your csv file to visualise its content in Excel?

If you use a comma or a semicolon as the field separator, you can precede the field contents by a tab: insert a non-printable ascii x09 in front of its value by mapping it to chr(9)||source_fiield in your Query transform.

Former Member
0 Kudos

Hi Dirk, Thanks for responding, can you give me with an example, i did not understand My Source Field is AAAA - DATATYPE V(13)- source value is 012345678 Thanks

former_member187605
Active Contributor
0 Kudos

In the mapping of AAAA, put:

     chr(9)||AAAA

Former Member
0 Kudos

Thanks Firk, it worked I have one more question Is it by default  chr(9) for any datatype of length or any calculation

Former Member
0 Kudos

Sorry for typo error of name

former_member187605
Active Contributor
0 Kudos

It works fine for any string you want to keep leading zeroes in.

afafpatel
Explorer
0 Kudos

Hi Direk,

Will it work for DS too if we want to store leading zeros while extraction data from SAP source?