‎2007 May 07 7:42 AM
hi all,
ive created a vofm routine in which multiplication of two conditional values is carried out.
if my values are for instance 1100.00 & 20.00 the result shud b 22000.00 but the result is coming out to be 2200000.00
the data type of xkwet which stores the product of the above vales is
p(7) decimals 2.perhaps because of dis it is filling the remaining values by zeros.
can ny1 suggest how to resolve dis issue as i cant divide the result by 100.
rgds
‎2007 May 07 7:46 AM
u have to maintain the same field length , then u have to div by mul of 100's.
Regards
Prabhu
‎2007 May 07 7:46 AM
u have to maintain the same field length , then u have to div by mul of 100's.
Regards
Prabhu
‎2007 May 07 7:57 AM
‎2007 May 07 8:10 AM
Hi,
Define one field type P and decimals 2.
Then multiply by divident by 10000 and then divide it by your value.
Due to SAP standard data type of structure the values comes always multiple of 1000 in custom routine.
for the reference; please find below example;
DATA: WORKFIELD(16) TYPE P DECIMALS 2.
CHECK KOMP-KZWI1 NE 0.
IF XWORKG NE 0.
WORKFIELD = ( KOMP-KZWI1 - XWORKG ) * 10000 / KOMP-KZWI1.
XKWERT = WORKFIELD.
ELSE.
XKWERT = 0.
ENDIF.
Cheers
Nilesh Shete
‎2007 May 07 8:53 AM
hi,
in case of subroutine multiplication and division is not working properly.
u have to make a function module for muliplication or division.
Enjoy .
Rewards point if helpful.
Regards
Santosh