Rounding to 2 decimals in PCR
I am doing a calculation to determine a percentage value in a PCR by using HRS/37.5 where HRS is their planned work time for the week. The value is then multiplied by a constant. I want the final result to be rounded to 2 decimal places. How do I specify the number of decimal places using arithmetic operations and the HRS function?
Hi It works.
What I was suggesting looks like this
hrs=20
20*100000
200000/37.5
result/100000 will be rounded to two digits.I have used this somany times.
I have just tested on my system.Please try and let me know
Thanks
Venkat
Similar Messages
-
Hi all programmers,
I am a FICO functional consultant. I have got an issue that I think and was told that it can be solved by an ABAPer. The issue is described below:
"I am encountering a serious production issue. On the FB60 screen when I enter the amounts in the line items and select the the respective tax code, my system calculates the tax amount as $0.06 where as when I calculate on my calculator it is coming up as 0.0565. Because of this my total balance is offsetting by 1 cent ($0.01). I want my SAP system also to round off to $0.0565 instead of $0.06. Is there any way to do this setting. I know I can change the value manually under tax tab. But, there are so many invoices like this and calculating the tax manually and then entering the right decimal value in the tax tab will not serve my purpose."
Being a functional person and with no ABAPer's support, I request you guys to please help me from scratch (inclusing which t.code to use) on solving this issue by changing or creating a programming routine.
<b><REMOVED BY MODERATOR></b>
Thank you,
SONY
Title and Message were edited by:
Alvaro Tejada GalindoHi,
Please try this to create program routine.
DATA: N1 TYPE P DECIMALS 4 VALUE '0.0565',
N2 TYPE P DECIMALS 2.
MOVE N1 TO N2.
WRITE: N2.
Regards,
Ferry Lianto -
Sales order item quantity not rounded and allowing decimals with UoM EA
Hi gentlemens,
I noticed something strange in our SAP ERP system.
When we enter a material in a new sales order item, we are allowed to enter quantity 1,5 EA (1 and half Each).
But when I check the config of the UoM EA in table T006, the number of decimals (field DECAN) is 0 and the decimal place for rounding (field ANDEC) is also 0.
As far as I remember from other other SAP system, there should be an error message when entering the quantity 1,5 EA saying that decimals are not allowed for this unit of measure.
Can someone help and tell me wich error message or which rounding program should normally be active when entering decimals with uom EA ?
Thanks and regards,
BDTHi Mani,
Thanks for the thread reference. I found the related OSS notes yesterday evening but this was for procurement.
Here the question I have is more for a sales item.
The strange case we are facing is:
In a sales order, we can enter a particular material as a standalone item with a quantity of 1.5 EA without any problem.
But if we create the same new item as a sub-item of a previous one (filling UEPOS), with qty 1,5 EA, then a rounding is triggered by the system based on the T006 config.
I am wondering if this is a problem with the SAP standard program or if we did anything wrong in the past in our system?
Best regards,
BDT -
Rounding condtion type decimals
HI ALL,
I have a requirement where for eg: Condition type PR00 is with 50.45 it should round off to 50.00
or if it is 50.95 also inthat case also it should round off to 50.00
i tried doing rounding rule in conditon type, it is only rounding the decimals
i dont want any decimals
Please let me knw if any one has the answer
SyedHello,
In transaction V/06 there is a field under header 'Control data1' which can effect how the system rounds off condition values during pricing:
->> Rounding rule
The rule that determines how the system rounds off condition
values during pricing. The last digit will be rounded.
Example
o In the standard rounding rule '_', values are rounded off according
to business standards:
10.454 -> 10.45 DEM
10.455 -> 10.46 DEM
o In rounding rule 'A', values are always rounded up:
10.459 -> 10.46 DEM
10.451 -> 10.46 DEM
o In rounding rule 'B', values are always rounded down:
1045.9 -> 1045 LIT
1045.1 -> 1045 LIT
Please try using the rounding rule 'B' for your scenario.
I hope you find this information very helpful and hopefully it will solve your problem.
Regards,
Martina McElwain
SD - Forum Moderator -
Rounding % to zero decimals
Hi,
I have requirement to find the percentage of row(rowvalue/grandtotal). To get this I used pivot table and have taken the values as percentage of row. But in the same the user wants to have zero decimals. Is it possible to round off percentage values in Pivottable?
Thanks,
Phani.Phani,
Look at:http://shivabizint.wordpress.com/2008/09/14/changing-the-precession-of-percent-of-columns-in-pivot-table-of-obiee/
thanks,
Saichand.v -
How to convert 3.16 to 3.20 in tables? Round only the decimals?
In a recent post mr Trevor wrote a powerful script to round decimals but altering the preceding number:
23.45 was converted to 23.
23.78 to 24.
It is possible to script only the decimals not touching the integer?
,03 : 00
,06 : 10
,14 : 10
,18 : 20
,71 : 70
,77 : 80
Etc?Hi, thank you.
As numbers are placed on tables, how to apply this script to the whole document?
It is necessary to make a list?
Or it may be used with a skeleton like this wrote by Trevor?
var doc = app.activeDocument;
app.changeGrepPreferences = app.findGrepPreferences = null;
app.findGrepPreferences.findWhat = "\\d+\,\\d+";
var myNumberFinds = doc.findGrep(),
l = myNumberFinds.length;
while (l--)
app.changeGrepPreferences.changeTo = Math.round(myNumberFinds[l].contents.replace(/\,/,".")).toString();
myNumberFinds[l].changeGrep();
Yes, numbers between ,094-0,99 will afect the integer!
Thank you. -
Rounding to nearest decimals--VERY URGENT
Hi all,
I am encountering a serious production issue. On the FB60 screen when I enter the amounts in the line items and select the the respective tax code, my system calculates the tax amount as $0.06 where as when I calculate on my calculator it is coming up as 0.0565. Because of this my total balance is offsetting by 1 cent ($0.01). I want my SAP system also to round off to $0.0565 instead of $0.06. Is there any way to do this setting. I know I can change the value manually under tax tab. But, there are so many invoices like this and calculating the tax manually and then entering the right decimal value in the tax tab will not serve my purpose.
PLease help me with this as it is a very urgent issue.
I would surely award points for any kind of positive help.
Thank you,
SONYHi,
As far as my knowledge goes SAP bydefault rounds off to 2 digits. If you want any changes in that you will have to take the help of ABAPer and write the routine to change the number of decimal points.
Regards
Santosh Hegde -
Can't get it to round to 2 decimals, using DecimalFormat, please proof read
Why won't this output #.##? No matter how I change them it still gives me exact answers.
import javax.swing.*;
import java.awt.*;
import java.util.*;
import java.text.DecimalFormat;
public class Calculator{
public static void main (String[] args){
//Ask for input
String inputString = JOptionPane.showInputDialog("Input your desired calculation, separating numbers and operation with spaces.(+-/*%)");
//split input to make switch function
String[] result = inputString.split("\\s");
/*I Put both of these in here, but stuck with the Double,
I think thats the better fit*/
//float n1 = Float.parseFloat(result[0]);
//float n2 = Float.parseFloat(result[2]);
double n1 = Double.parseDouble(result[0]);
double n2 = Double.parseDouble(result[2]);
char c = result [1].charAt(0);
if((c == '+') || (c == '/') || (c == '*') || (c == '%') || (c == '-'))
DecimalFormat df = new DecimalFormat("#.##");
//switch function to cover the 5 functions, and divide by zero message
switch(c)
case '+':
double answer = n1 + n2;
df.format(answer);
JOptionPane.showMessageDialog(null, inputString + " = " + (answer));
break;
case '-':
//DecimalFormat df = new DecimalFormat("#.#");
double answer2 = n1 + -n2;
df.format(answer2);
JOptionPane.showMessageDialog(null, inputString + " = " + (answer2));
break;
case '/':
if(n2 == 0)
JOptionPane.showMessageDialog(null, "You know that's a no no!");
else
//DecimalFormat df = new DecimalFormat("#.#");
double answer3 = n1 / n2;
df.format(answer3);
JOptionPane.showMessageDialog(null, inputString + " = " + (answer3));
break;
case '*':
//DecimalFormat df = new DecimalFormat("#.#");
double answer4 = n1 * n2;
df.format(answer4);
JOptionPane.showMessageDialog(null, inputString + " = " + (answer4));
break;
case '%':
//DecimalFormat df = new DecimalFormat("#.#");
double answer5 = n1 % n2;
df.format(answer5);
JOptionPane.showMessageDialog(null, inputString + " = " + (answer5));
break;
else
System.out.println("Can't do that operation!");
}I commented out some other stuff I was thinking on, so just ignore. Thanks!cuz you are not using the value returned by the DecimalFormat object.
df.format(answer2);
JOptionPane.showMessageDialog(null, inputString + " = " + (answer2));DecimalFormat.format() returns a string. By what magic do you think the primitive double answer2 is going to be changed to a String object?
String a2 = df.format(answer2);
JOptionPane.showMessageDialog(null, inputString + " = " + (a2)); -
Reading data from force gauge rounding off decimals
Hello everyone. I am new to Labview and this is my first posting on the forum. I am currently writing a program to record pull tests on crimps using a force gauge. Everything is going fairly well for it being my first project except when the data I am reading from the force gauge is rounding off the decimals. I am sure it is where I am using the absolute value and conversion functions but I am unsure the correct way I should be doing this. Thanks in advance for any advice. Also, I tried searching on this but did not come up with anything so I apologize if this is a redundant topic.
The reason you are losing your decimals is because of the data type you are using.
If you notice, your indicator is blue, indicating it is "I8" (an 8-bit integer).
Since it is an integer, by definitiion it has no decimal precision.
After you read in the data string, try converting it to SGL (single precision float, 32-bit) or DBL (double precision float, 64-bit)
Cory K -
I have an excel sheet containing data of hourly loads in MW( rounded to 4 decimals) of one year. So, I have 365*24 values that I want to import to Labview using Read from spreadsheet.vi. However what i get in the output array is 0's and randomly some unit values at very few places. I have checked the array size of the output array and it shows different array sizes for different yearly data.
I am attaching the four excel spreadsheets .
Plz help me with the issue I am facing.
Attachments:
Load-2012.xlsx 95 KB
Load-2013.xlsx 94 KB
Load-2014.xlsx 59 KBIf you are using LabVIEW 2014, it includes the Report Generation Toolkit (which is also available as an add-on in earlier LabVIEW Versions). This can read native Excel files, including .xlsx. With a few functions (3 or 4, I think), you should be able to get the entire Table into a 2D array.
Bob Schor -
How to use Round off function in TAX Formula
Dear All,
I have to do Round off in the Tax Formula. Hence I was suggested by the SAP Forum Team to use Round off function in the Tax Formulae.
But sir I don't know how to use Round off function in the Tax Formulae.
For Eg. BaseAmt = Total
TaxAmt = BaseAmt * Rate
Now within this Eg. How will i use the Round off function and where i will use it.
Please guide me with example.
Regards
Hitesh ParsawalaHi Hitesh,
you can do like this
Cess_ST_TaxAmt=Round(Cess_ST_BaseAmt*Cess_ST_Rate,0)
where you can introduce rounding function by choosing from dropdown available in Operation and by click on Insert.
It will post following in formulla window
Round (Number, Decimals as Number)
where in parameter you have to give 1.Number-which is to be round and 2.Decimals as Number-as per your requirement like by 2 decimal or 0 decimal
If required give me call,
BR
Samir Gandhi -
Dear Gurus,
Can some one tell me how the rounding for works.
Financial Accounting ->AR/AP->Business Transaction->Outgoing Payments->Define Account for Rounding off difference.
My client require the following scenario.
a. Client wanted to book all the invoies with decimals at liability booking(FB60).
Eg : 110.36 and 110.56
b. While making payment(F-53 or F-58) he waanted to round off the decimals(as he do not want to cut the cheque for decimals
Eg : 110 and 111
Please help me to configure to get the out put
Thanks
Raju.Hi
Have tolerances set up for the user as well as customer/vendor. This will automatically knock off the differences and you can pay in round amount
S Jayaram -
Hi All,
I have a requirement in BEx .
lets say i have keyfigure A1 having value , A1 - 345.5678. if i will do the rounding for two decimals then the ideal result will be A1 - 345.57.
but, i want to keep the value for A1 - 345.56 after rounding also.
Please suggest.
Regards,
Macwan James.Hi,
Actually the number of the decimal places to which rounding should
be performed for keyfigures are defined in table T006-ANDEC.
Please refer to the following notes and carry out the manual steps which will solve the rounding issue.
442987 - Decimal places/rounding units of measure
866505 - Unwanted rounding of units T006-ANDEC
Please also check the following SDN link.
No Rounding of Key Figure
Regards,
Amit -
Hi abap king's,
in <b>alv tree</b> program i want to remove the decimals or to round off the decimals. for ex. 1890.41 to be displayed as 1890.
thanks,
Madhu.Hi,
In the internal table , use this logic to populate the field.
DATA: X TYPE P DECIMALS 2 VALUE '12493.97'.
WRITE: /X ROUND -2, "output: 1,249,397.00
/X ROUND 0, "output: 12,493.97
/X ROUND 2, "output: 124.94
/X ROUND 5, "output: 0.12
Best regards,
Prashant -
User exit for rounding off result value
Hi Gurus,
Is there any user exit available or std. functionality by which we can round off the result value. My client wants if the value is 192.5 or 191.8 then this value should be rounded off to 195. That means rounding in multiples 0f 5. Is there any exit available?
Regards
AmitIf in QM just specify the correct number of decimals for the characteristic, in your case 0. In config under plant settings you can set up the results recording settings to allow you to record one additional decimal then specified by the characteristic. The result is rounded to 0 decimals when displayed.
FYI - there should be no reason to have to use user exits to round off decimals in QM.
Craig
I didn't read the initial posting correctly. To round the whole number portion by 5 you will have to provide that logic yourself via the user exits already posted.
Craig
Edited by: Craig Snyder on Jan 13, 2010 2:56 PM
Maybe you are looking for
-
Installing Windows 7.0 on iMac.
I have downloaded Windows 7.0 Ultimate from Microsoft with the intention of installing on a partition of my iMac's drive. I have the instructions form Apple support regarding Boot Camp, and step-by-step directions. They reference In Step 3, 1) Insert
-
I am new at Acrobat 9 Pro, and I am probably doing things wrong. So far I have not been able to create text in a new document with Acrobat 9 Pro, only field? Is that normal? Also, if I import a document created in word, it will recognized fields bu
-
Xslt transform problem on Sun AS 8PE
Hi, I have following xslt: <xsl:call-template name="CustomerFilter"> <xsl:with-param name="custFilterPath" select="CustomerFilter"/> </xsl:call-template> <xsl:template name="CustomerFilter"> <xsl:param name="custFilterPath"/> <xsl:text>Cust
-
Urgent: File export in campaign
Hi Gurus, I have created one personalized mail form of type 'export' . I have got the personalized mail form enhanced by creating a new scenario and got it iimplemented using the BADI provided.The requirement was like this : From the business partne
-
HT3702 Apple Apps and Itunes driving me crazy
Why do I continue to keep getting contact WWW.apple.com/support/itunes.ww when I still have plenty of credit on the CC in file? It will let me make one purchase then it flips out in me? Very frustrating.