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

DELETE ZERO BEFORE NUMBER

Former Member
0 Likes
936

hallow

i have field type numc20 and i wont to delete all zero before num

how can i do that

example

i have

000000000317

i wont 317

REGARDS

1 ACCEPTED SOLUTION
Read only

dev_parbutteea
Active Contributor
0 Likes
881

Hi,

use FM : CONVERSION_EXIT_ALPHA_OUTPUT

Regards,

Sooness

9 REPLIES 9
Read only

dev_parbutteea
Active Contributor
0 Likes
882

Hi,

use FM : CONVERSION_EXIT_ALPHA_OUTPUT

Regards,

Sooness

Read only

Former Member
0 Likes
881

Hi Shnya ,

Use the shift command.

Here is a sample code for the same

data : test(20) type n.

test = '000000000317'.
write / test.
shift test  left deleting leading '0'..

write / test.

Hope this helps

Regards

Arun

Read only

Former Member
0 Likes
881

Hi,

You can use Condense number.

this will truncate the leading zeroes.

truncate numc.

Regards

Shiva

Read only

Former Member
0 Likes
881

hi,

CONVERSION_EXIT_ALPHA_OUTPUT is the Fm used for giving desired o/p and takes a input from user

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING

input = int [int is avaraible of type num20

  • IMPORTING

  • OUTPUT = k. [ resultant value by FM]

if useful reward some points.

with regards,

suresh.

Read only

anversha_s
Active Contributor
0 Likes
881

hi,

data : v_matnr(40) type c,
       v_mat type matnr.
 
v_mat = '00000123456789'.
 
       pack v_mat to v_matnr.
 
write v_matnr.

Rgds

Anversha

Read only

Former Member
0 Likes
881

you can try this also..

REPORT ychatest MESSAGE-ID zz..

DATA : v_char(20) VALUE '000000000317'.

TRANSLATE v_char USING '0 '.
CONDENSE v_char NO-GAPS.
WRITE : v_char.

Read only

Former Member
0 Likes
881

also check this

DATA : v_char(20) VALUE '000000000317'.

WRITE : v_char TO v_char NO-ZERO.
condense v_char no-gaps.
WRITE : v_char.

Read only

Former Member
0 Likes
881

This is not the better way, but is quick !!

PACK field INTO field.

Read only

Former Member
0 Likes
881

hi,

<b>u follow this logic..</b>

WRITE: '000123',

/ '000123' NO-ZERO.

u can get output like this..

000123

123

regards,

Ashokreddy.