Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

vofm help

former_member188827
Active Contributor
0 Likes
599

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
550

u have to maintain the same field length , then u have to div by mul of 100's.

Regards

Prabhu

4 REPLIES 4
Read only

Former Member
0 Likes
551

u have to maintain the same field length , then u have to div by mul of 100's.

Regards

Prabhu

Read only

0 Likes
550

can u b more specific as how to achieve dis.

Read only

0 Likes
550

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

Read only

Former Member
0 Likes
550

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