cancel
Showing results for 
Search instead for 
Did you mean: 

Removing Leading zeros from query output.

Former Member
0 Kudos

Hello Experts,

Is it possible to remove leading zeros from the query output for a particular column?

I have a characteristics 'Reference Document' which has values like '000001386'. The users just need '1386' to be displayed and have asked us to remove the leading zeros.

Is there something that can be done for this at a query level? I can't modify the underlying InfoProvider because this requirement is just for one set of users, the other users need the document nmber in the original format.

Thanks

Arvind

Accepted Solutions (1)

Accepted Solutions (1)

chemicala_srimallikarjuna
Active Contributor

Hi,

you can use ALPHA conversion option in the definition of that particular characteristic.

Try this code in a routine.,in query designer;

data a(9) value '000001386'.

SHIFT a LEFT DELETING LEADING '0'.

write:/ a.

Output will be : 1386

Or use this method also

data a(9) value '000001386'.

Call function 'CONVERSION_EXIT_ALPHA_OUTPUT'

Exporting

input = a

Importing

output = a.

write a.

output:

1386

Regards

CSM Reddy

Former Member
0 Kudos

Hi CSM Reddy,

Do you mean to say we can write a routine at the query designer level? I wasn't aware of this. Can you please explain how this is done?

Thanks

Arvind

Answers (1)

Answers (1)

Former Member
0 Kudos

Per my knowledge that has to be done during the ETL process.

Edited by: Abhijit N on Mar 11, 2009 8:45 PM