Skip to Content
Sep 10, 2013 at 10:14 AM

Restraining decimal points for selective values of a single field?


Hello everyone,

here is my sample code ...

" types: begin of ty_x,

(some fields)





menge type P decimals 3,

currkey type waers,

end of ty_x. (let us say this is my final output structure )

data: i_x type table of ty_x,

w_x type ty_x.

loop at it into wa.




if currkey is not maintained in TCURX table

then menge should be diaplayed with 3 decimal values


menge should be diaplayed without decimal values


append w_x to i_x.


reuse alv grid ( to display the output).


here what should be the type of menge so that i can get the output as i have mentioned in the if clause?

output example:

field1 field2 field3 field4 QUANTITY(MENGE) CURRENCYKEY

A A A A 123.456 USD

B B B B 11100.253 USD

C C C C 11100 KRW

D D D D 1255 JPY

i have tried to restrict the type to p with decimals 0. but that would reflect to all the values in the field quantity.
kindly help me with this..

Thanks in advance,

jyothi reddy.