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: 

Doubt regarding no-zero

0 Kudos
248

i am a beginner in ABAP so i am using an online ABAP editor to practise.

my question is the zeros are automatically suppresses without using the no-zero.

for eg:

data num1 type i.

num1 = 000040.

write num1.

*now without using no-zero, all the zeros in 00040 are removed in the output.

what i don't understand is that is it because of the editor or any other reason?

a help will be appreciated 🙂

3 REPLIES 3

Jeansy
Active Contributor
182

Hi,

this is normal. WRITE uses several conversions to format the output to the user (in some cases based on the personal preferences of the user, e.g. the format of a decimal number or date-display).

In your case, you use an integer variable, for this type SAP does not show the leading zeros in this case.

Kind regards
Jens

abo
Active Contributor
182

NO-ZERO only works for types C, N or string.

No effect on type i, as in your case.

raymond_giuseppi
Active Contributor
0 Kudos
182

Abap use some Conversion Rules for Elementary Data Objects to convert elements, in case of WRITE target is a character type field.

Your field is of type Integer, so look at Conversion Rules for Elementary Data Objects, Numeric Source Fields, Source Field Type i, int8, (b, s), Character-Like Target Fields