cancel
Showing results for 
Search instead for 
Did you mean: 

Quantity Field in Smartform

Former Member
0 Kudos

Hi Experts,

I am printing a Quantity field from item data in my smartform. But user has asked me not to print the decimal value if its zero and he want to print it if its Zero.

Eg.. if Quantity is 14,999.90 then he want to print it as it is .. But is value is 14,999.00, then he want to print only 14,999. I tried to use option &Quantity(13,0)& but it actually rounds it off and then it changes the value.. please suggest a solution..

Thanks,

Rahul

Accepted Solutions (1)

Accepted Solutions (1)

former_member209818
Active Contributor
0 Kudos

Hi Rahul,

As you mentioned, printing option &Quantity(13,0)& wil actually round off the values and that is not acceptable as a solution to you.

This is a typical requirement, which you will need to handle in a custom way,

before writing the Quantity, put a code node in the smartform and use FRAC command available in the ABAP. This will give the fraction part of the quantity. Based on the Fraction part... if its Zero, you can use &Quantity(13,0)& to print the value or else if that part is not equal to Zero, you can print the value as it is..

Hope this will solve your problem..

Answers (0)