cancel
Showing results for 
Search instead for 
Did you mean: 

Keeping leading zeroes in flat file

Former Member
0 Kudos

I am loading data from a flat file to a DSO.

One of the columns in the flat file is data type CHAR with a length of two. The data values will be either 01, 02 or 03.

When I load the data, the leading zeroes are dropped. Thus, I see 1, 2 and 3 in my DSO. How can I prevent this happening?

Accepted Solutions (1)

Accepted Solutions (1)

Pravender
Active Contributor
0 Kudos

You can either change the number format to text format in the excel sheet and then try to load the data.

Or concatenate the value 0 to the field value in transformation (update rule/transfer rule) using a routine. Then load the data.

Answers (2)

Answers (2)

Former Member
0 Kudos

Create an InfoObject zyourfield and add it to your DSO.

Then create a fieldroutine in the transformation / update rule:

data: zyourfield type /bic/oizyourfield.

if source_fields-zyourfield ne ''.

write source_fields-zyourfield +6(2) to h_zyourfield right-justified.

overlay h_zyourfield with '00'.

result = h_zyourfield .

endif.

This should do the trick, good luck!

former_member181964
Active Contributor
0 Kudos

Hi,

Right Click on that column in Excel file and Formate Cells >Custome> Under Type give "00" and then give the values in column like 01 , 02 .... and save as .csv and close it, immediatly load it, DON"T OPEN FILE, because , if you open it will reset to 1, 2... SO again you need to Right click.....and formare cells..

Thanks

Reddy

Edited by: Surendra Reddy on Jun 24, 2010 4:28 PM