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: 

Formatting amount

Former Member
0 Kudos
111

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

Former Member
0 Kudos
89

DATA: V_AMOUNT(8) TYPE N.

V_AMOUNT = NETWR.

3 REPLIES 3

amit_khare
Active Contributor
0 Kudos
89

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

Former Member
0 Kudos
90

DATA: V_AMOUNT(8) TYPE N.

V_AMOUNT = NETWR.

ferry_lianto
Active Contributor
0 Kudos
89

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