cancel
Showing results for 
Search instead for 
Did you mean: 

Remove .00 in smartform display

Former Member
0 Kudos

How to remove trailing zeroes in msartform display.

I have a variable of type curr. Suppose the value is 23.00, then i want to display it as 23 only. What formatting option to give.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

Suppose your fileld is netwr in

type it as &netwr(Z)&

Thanks,

NN.

Former Member
0 Kudos

No. That does not remove .00

Former Member
0 Kudos

Hi,

Try this that is for leading zeros.

->find the length of the field by going into that table if the length is 13 and decimals is 3

If you need without decimals write this.

&netwr(13.0)&

If you need with one decimal write this.

&netwr(13.1)&

If you need with two decimals write this.

&netwr(13.2)&

Thanks,

NN.

Former Member
0 Kudos

Yes now its working.Thank you so much. But now since the length is 13 and decimals 2 , if i write &netwr(13.0)&, then how do i do space compression. I cannot write &netwr(C,13.0)& both together.

Former Member
0 Kudos

hai netaji how r u

Former Member
0 Kudos

Hi,

Define this variable of yours as an integer and not packed decimals (p). Then it would take 23 as a value and not 23.00.

Thanks

Nayan

former_member195383
Active Contributor
0 Kudos

Hi...

assign that amount to a character field.

wf_int = strlen(wf_amount).

if wf_amount+wf_int - 2 eq '00'.

wf_amount = wf_amount+0(wf_int - 2).

endif.

then display wf_amount.

Former Member
0 Kudos

hi,

u can create the one local varible of the type integer or the typpe P with decimal 0. and assign ur final result to that and display the new value,

i hope this is useful for u.

cheers!

pradeep

sachin_mathapati
Contributor
0 Kudos

Hi Priti,

Try this...

Declare a new field of type P with decimals 0.

data: v_Curr like VBAP-ZWERT,

v_newCurr type P decimals 0.

v_newqunat = v_quant.

Regards,

Sachin M M

Edited by: Sachin Mathapati on Jun 18, 2008 11:11 AM

Former Member
0 Kudos

Is there any formatting option, Like for space compression we have (C).