Application Development and Automation 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: 
Read only

abap

Former Member
0 Likes
1,195

hi,

how to avoid leading zeroes ,if suppose i want to display only 8 as my employee number rather than 000000008 .

i dnt want to go for any FM.

points assured,

thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,168

shift var left deleting leading '0'.

regards

shiba dutta

Hi Ganesh,

Use command as below

SHIFT <FLD> LEFT DELETING LEADING '0'.

Note the value ZERO should be using with quotes.

Regard,

Priyanka.

10 REPLIES 10
Read only

Former Member
0 Likes
1,168

Use <b>condense</b> statement.

Regards

Read only

Former Member
0 Likes
1,169

shift var left deleting leading '0'.

regards

shiba dutta

Read only

Former Member
0 Likes
1,168

hi Ganesh,

Pass these values to a interger variable to avoid leading zeros

i.e,


data : var type i value '000000008'.

write : var.

Regards,

Santosh

Read only

Former Member
0 Likes
1,168

Hi Ganesh,

Use command as below

SHIFT <FLD> LEFT DELETING LEADING '0'.

Note the value ZERO should be using with quotes.

Regard,

Priyanka.

Read only

p291102
Active Contributor
0 Likes
1,168

Hi,

WRITE:/ ITAB-<FIELDNAME> NO-ZERO.

Thanks,

Shankar

Read only

Former Member
0 Likes
1,168

do this way

data: str type string.
 
str = '00000000000000654654'.
 
 
call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
  exporting
    input         = str
  IMPORTING
    OUTPUT        = str.
 
 
    write:/ str.
 

Read only

Former Member
0 Likes
1,168

You can even use FM

BKK_DELETE_LEADING_ZERO

Regards,

Santosh

Read only

Former Member
0 Likes
1,168

ganesh,

Use FM,"CONVERSION_EXIT_ALPHA_OUTPUT"

Pls. mark if useful

Read only

Former Member
0 Likes
1,168

thanks

Read only

Former Member
0 Likes
1,168

Dear no need FM

use following codding for that

data str type n.

str = '0000008'.

shift str LEFT DELETING LEADING '0'.

write:/ str.

Rewards if helpful.