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

Restraining decimal points for selective values of a single field?

27 Views

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

else.

menge should be diaplayed without decimal values

endif.

append w_x to i_x.

endloop.

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.