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

Remove the Zeros

Former Member
0 Likes
1,061

Hi Guy's,

Please help me how to delete the zeros '124000000'. I want only 124. how to do this one.

Thanks and Regards,

Sai

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,037

Hey

use this fm

CONVERSION_EXIT_ALPHA_INPUT Conversion exit ALPHA, external->internal

CONVERSION_EXIT_ALPHA_OUTPUT Conversion exit ALPHA, internal->external

Regards

Divya

10 REPLIES 10
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,037

Use SHIFT and CONDENSE for a character string

* string = '124000000'
SHIFT string RIGHT DELETING TRAILING '0'. 
* string = '      124'
CONDENSE string. 
* string = '124      '

Be also a little more precise on your need.

Regards

Read only

former_member195383
Active Contributor
0 Likes
1,037

SHIFT wf_c RIGHT DELETING TRAILING '0'.

wf_c contains the value .....

Edited by: Rudra Prasanna Mohapatra on Jul 10, 2008 1:39 PM

Read only

Former Member
0 Likes
1,037

use ..

data : v_value(20) value '124000000'.

replace all ocurrences of '0' in v_value with ''.

condense v_value.

Read only

Former Member
0 Likes
1,038

Hey

use this fm

CONVERSION_EXIT_ALPHA_INPUT Conversion exit ALPHA, external->internal

CONVERSION_EXIT_ALPHA_OUTPUT Conversion exit ALPHA, internal->external

Regards

Divya

Read only

0 Likes
1,037

Hi,

Decalre one local variable with the length 3 char and move to the variable to local variable.

warm regards,

Surendar Reddy.

Read only

Former Member
0 Likes
1,037

hiiii

use following code

DATA : a(15) TYPE c,

a = '2400000000'.

REPLACE ALL OCCURRENCES OF '0' IN a WITH space.
write : a.

regards

twinkal

Read only

Former Member
0 Likes
1,037

Hi,

Check this :

DATA:
  w_test TYPE string VALUE `0000386787740000`.
  SHIFT w_test RIGHT DELETING TRAILING '0'.
  write: w_test.

Regards

Adil

Read only

Former Member
0 Likes
1,037

Hi,

check below code.

data:

w_no type i value '12400000',

w_check type i,

w_final type i.

w_final = w_no.

do.

w_check = w_final mod 10.

if w_check = 0.

w_final = w_final div 10.

else.

exit.

endif.

enddo.

write w_final.

Read only

Former Member
0 Likes
1,037
REPORT  ZTEST_ZERO.

data: in(9) type c.

in = 124000000.


SHIFT in RIGHT DELETING TRAILING '0'.

write in.
Read only

Former Member
0 Likes
1,037

Hi,

string = '124000000'.
SHIFT string RIGHT DELETING TRAILING '0'.

Regards,

Rajitha.