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

Form Routines Calculation problems.

Adi_Bathineni
Participant
0 Kudos
427

Hi,

we have written one VOFM routine for the Calculation of Profit Margin and Gross Margin in the Sales Order.

The Problem is we need to show the value in the Sales Order as

for example if the Profit Margin % is 0.27, then i need to display it as something 27.xx.

The above scenario is working fine. we are multiplying the value with 100 and assigning to a character filed.

and the character field we are passing to XKWERT and the value is coming perfectly.

But the Problem is when the Profit Margin is 0.09%, when we multiply with 100, we are getting the value as 9.xx.

when we assign it to XKWERT field from the character field , it is converting 9.xx as 9x.xx.

Could you please tell me how to resolve the above problem.

in the routines we are unable to perform arithmetic operations between Currency values.

Thanks,

Adi.

3 REPLIES 3
Read only

Former Member
0 Kudos
260

Hi Adi ,

first thin u need to remember while working with VOFM routines is calculations or % should take place with 1000 not with 100,bcos SAP condition values are at % of 1000 not 100.

regards

Prabhu

Read only

former_member156446
Active Contributor
0 Kudos
260

the above post is exactly correct.... In a similar scenario I remember using floating variable and FM to convert floating variable to Char..

data: lv_f type F.

se37 > floatchar*

Read only

Adi_Bathineni
Participant
0 Kudos
260

We did in a wrong way, the requirement changed