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

Formatting amount

Former Member
0 Likes
629

I have amount netwr

I want to be able to change it to 8 digits, left fill by zeroes, drop cents

123.45 becomes 00000123

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
607

DATA: V_AMOUNT(8) TYPE N.

V_AMOUNT = NETWR.

I have amount netwr

I want to be able to change it to 8 digits, left fill by zeroes, drop cents

123.45 becomes 00000123

3 REPLIES 3
Read only

amit_khare
Active Contributor
0 Likes
607

Check this -

DATA: var TYPE ansal_15 VALUE '123.25'.

DATA:var2 type i,

var1(8) TYPE n.

WRITE:/ var.

var2 = var.

UNPACK var2 TO var1.

WRITE:/ var1.

regards,

Amit

Read only

Former Member
0 Likes
608

DATA: V_AMOUNT(8) TYPE N.

V_AMOUNT = NETWR.

Read only

Former Member
0 Likes
607

Hi,

Please try this.


data: v_amt1 type p decimals 2 value '123.45',
      v_amt2(8) type n.

v_amt2 = v_amt1. 
write: / v_amt2.

Regards,

Ferry Lianto