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: 

Supress Zeros in ABAP

Former Member
0 Kudos

Hi,

I have a variable of CHAR type 12 which is preceded by few Zeros, as per my requirement i have to suppress preceding zeros.

Can someone suggest how to approach this problem.

Eg: V = 0000048521701

output should be : V = 48521701.

Thanks and Regards,

Harsh

6 REPLIES 6

former_member208856
Active Contributor
0 Kudos

Hi,

Use this code, it can help you.

data : a(10), b(10).

a = '0048521701'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING

input = a

IMPORTING

OUTPUT = b

.

write 😕 a.

write 😕 b.

Reward points, if helpful,

Sandeep Kaushik

Former Member
0 Kudos

Hello,

Use <b>NO_ZERO</b>

Vasanth

Former Member
0 Kudos

Hi ,

You can use this..

SHIFT <STR> BY DELETING LEADING '0'.

Thanks.

varma_narayana
Active Contributor
0 Kudos

Hi

SHIFT v LEFT DELETING LEADING '0'.

This will work.

<b>Reward if Helpful</b>

Former Member
0 Kudos

Hi harsh,

1. <b>0000048521701 -


> 48521701</b>

2. Just copy paste.

3.

REPORT YAM_TEMP04.

data : v(12) type c.

*----


V = '0000048521701'.

write 😕 v.

*----


<b>shift v left deleting leading '0'.</b>

write 😕 v.

regards,

amit m.

Former Member
0 Kudos

Hi Harsh,

use 'CONVERSION_EXIT_ALPHA_OUTPUT' FM to achieve this.