We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

RE:[sap-dev] Ratio Between Two Quantity Fields

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Reply from wnash7658 on Sep 24 at 8:48 PM
Thanks everybody for your replies.

Bem, then is there any standard FM that can help in this regard?

I have added the catch 0 to the code, though the testing in QAS never picked up the issue of 1.000/5.000.

Code is below and made some changes and getting the ratio calculated. Seems I have to use F and then move the result into P.

DATA: IKWMENG LIKE XVBAP-KWMENG, "item cat GA01
JKWMENG LIKE XVBAP-KWMENG, "item cat GA10
DATA: BRATIO TYPE F.
DATA: RATIO TYPE P DECIMALS 2, RATIOC TYPE C, RATIOSPLIT TYPE I.

BRATIO = ( IKWMENG / JKWMENG ) * 100. "buy X get Y free Order Qty
RATIO = BRATIO.

My issue occurred because originally X was expected to be always > Y. But now X can be smaller so the calculation produces a decinmal answer.

This is all for changing the ATP so the GA10 material is sent out to customer based on the ATP of GA01 and the determined ratio.

Regards,


Waza

---------------Original Message---------------
From: wnash7658
Sent: Monday, September 24, 2012 6:50 AM
Subject: Ratio Between Two Quantity Fields

I have order qty and ATP qty and I want to find the ratio between them. The qty fields are using QUAN 13 3 from the data disctionary.

I have declared a variable RATIO TYPE P DECIMALS 2.

When order qty > ATP qty it works fine, but when order qty < ATP qty it is returning zero and I am getting a short dump because later on I am dividing by zero.

Any help.

Regards


Waza

 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2012 Ziff Davis, Inc. and message author.
Ziff Davis, Inc. 28 E 28th Street New York, NY 10016
wnash7658  

SAP Specialist and Project Leader
31 achievements
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Become a blogger at Toolbox.com and share your expertise with the community. Start today.

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language