Decimal places in Query generator
Hi All,
I am observing a weird behavior in Query generator's execution of a simple sql query. the query is :
Select 0.002834
now, in the general settings - display - amounts , I put the decimal value as 4 or 6, then only it prints 0.0028 or 0.002834.
else it prints 0.00 (if the decimal place is 2). it should ideally have nothing to do with the display of amount. any idea?
(the effect is shown only after you change the decimal display, update it and close and reopen the SAP application.
Thanks,
Binita
Edited by: Binita Joshi on Apr 12, 2010 4:03 PM
Hello Binita,
>I have tried converting it to numeric(19,4) and numeric(19,6) but still the result was same.
Check your decimal places settings in
\Administration\System Initialization\General Settings\Display tab
Check the following values:
- Units (For meaurement)
- Decimals in Query
Now let' s say,
- Unit set to 6 decimal places
- Decimals in Query set to 2
run the following query in query generator:
select cast(0.000245 as decimal(19,6))
result will be
0.00
run the same query as FMS on item master data in any measurement field (lenght)
select cast(0.000245 as decimal(19,6))
result will be
0.000245
Now set the - Decimals in Query set to 6 on \Administration\System Initialization\General Settings\Display tab
run the following query in query generator:
select cast(0.000245 as decimal(19,6))
result will be
0.000245
This is a normal habit of SAP B1 rounding engine / displaying engine.
Regards
J.
Similar Messages
-
BEx Analyzer displays wrong number of decimal places after implementing BW patch
Hey folks,
we patched our BW 7.31 from PL10 to PL15 last weekend and now we got some issue with the number of decimal places shown in BEx Analyzer 7.x.
One example for KF X
Settings Info Object X
Decimal Places: Not defined
RSRT - Display X
Shows 3 decimal places
Query Designer Settings using KF X
Number of Descimal Places: 0 [Use Default Settings: NO]
BEx Analyzer Properties for KF X
Decimal Places: 0
Resulting in BEx Analyzer workbook shows 3 decimal places instead of 0!
Anyone with an good idea about that?
Thanks,
AndreasHi Andreas,
Have you used the list calulation like "Calculate Result As Average" or "Calculate Single Values as normalization of result" in the relevant key figures?
For "Calculate Single Values as normalization of result",iIt is the known design that it is always displayed with three decimal places for normalized values, and the setting in Query Designer for
decimal place doesn't take effect.
For "Calculate Result As Average", the following note maybe relevant.
2096911 - Decimal places in query result is wrong, if average is used and display precision is set to less than 3, it will always show 3 decimal places.
Another clue is to check if the key figure is a Quantity type with unit, and what's defined in table
T006 field ANDEC for this unit.
Hope this helpful.
Regards,
Ceciclia -
Dear Experts,
The amounts and prices set 6 decimal places in Display under General Settings.
When I created query with calculation and it has 6 decimal places. How can I eliminate the decimal places in query?
Thanks.Hi Sandra ,
Please take a look at this document ..hope this is what you are looking for
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00d3b230-73cc-2c10-d1a5-d293097224a7?quicklink=index&overridelayout=true
Thank you
Bishal -
Decimal places in a simple select query
Hi , I've a very basic query for you. I'm running the Select statement below, and want the Area to be just two decimal places. Is there a simple way of doing this ?
I'm having to compare the difference in accuracy between area calculations in Oracle Spatial and MapInfo to some very sceptical users, and they want to know if we're going to be getting 'vastly' different results.
(The tolerance is set to 0.5 mm in this instance, as we're using Ordnance Survey MasterMap to derivve our spatial objects).
select sssi_name, sdo_geom.sdo_area (geoloc, 0.0005)
from SSSI
Many Thanks,
BruceDo you mean simply the following?
select
sssi_name,
round(sdo_geom.sdo_area(geoloc, 0.0005), 2)
from SSSI -
Hi all,
How to set in a query the decimal places in 3?
For example:
1,006
Edited by: Philip Eller on Jun 18, 2008 9:23 AMHi all,
I've got the same problem. I only want to see the 'Totaal HL' with 6 decimal places. I tried this:
DECLARE @M INTEGER, @Y INTEGER
SET @M = 4
SET @Y = 2008
SELECT
T1.U_ItmAccg AS 'Accijnsgroep',
T3.U_T_Dscr AS 'Omschrijving',
'Factuur' AS 'Doctype',
((SUM(T1.Quantity * T2.SVolume * (CASE T1.UseBaseUn WHEN 'Y' THEN 1 ELSE T2.NumInSale END))/100) * 1.000000) AS 'Totaal HL',
T3.U_T_Tarief AS 'Tarief',
((SUM(T1.Quantity * T2.SVolume * (CASE T1.UseBaseUn WHEN 'Y' THEN 1 ELSE T2.NumInSale END))/100) * T3.U_T_TARIEF) AS 'Af te dragen accijns',
0 AS 'Terug te vorderen accijns'
FROM [dbo].[OINV] T0
INNER JOIN [dbo].[INV1] T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode
INNER JOIN [dbo].[@ACC_ACCGRP] T3 ON T2.U_AccSrt = T3.Name
INNER JOIN OCRD T4 ON T0.CardCode = T4.CardCode
WHERE T4.Country = 'NL'
AND MONTH(T0.DocDate) = @M
AND YEAR(T0.DocDate) = @Y
GROUP BY T1.U_ItmAccg, T3.U_T_Dscr, T3.U_T_TARIEF
UNION
SELECT
T1.U_ItmAccg AS 'Accijnsgroep',
T3.U_T_Dscr AS 'Omschrijving',
'Creditnota' AS 'Doctype',
((SUM(T1.Quantity * T2.SVolume * (CASE T1.UseBaseUn WHEN 'Y' THEN 1 ELSE T2.NumInSale END))/100) * 1.000000) AS 'Totaal HL',
T3.U_T_TARIEF AS 'Tarief',
0 AS 'Af te dragen accijns',
((SUM(T1.Quantity * T2.SVolume * (CASE T1.UseBaseUn WHEN 'Y' THEN 1 ELSE T2.NumInSale END))/100) * T3.U_T_TARIEF) AS 'Terug te vorderen accijns'
FROM [dbo].[ORIN] T0
INNER JOIN [dbo].[RIN1] T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode
INNER JOIN [dbo].[@ACC_ACCGRP] T3 ON T2.U_AccSrt = T3.Name
INNER JOIN OCRD T4 ON T0.CardCode = T4.CardCode
WHERE T4.Country = 'NL'
AND MONTH(T0.DocDate) = @M
AND YEAR(T0.DocDate) = @Y
GROUP BY T1.U_ItmAccg, T3.U_T_Dscr, T3.U_T_TARIEF
Can you help me? Thank you in advance!
Greetz -
B1 Query returning truncated decimal places when the CASE statement is used
Hi All,
Perhaps this is a friday thing.
In B1 the price setting is for 5 decimal places. I have a query the run a business process looking at the data in the Special Prices Tables. When I run the Query in SQL, the output show the correct number of decimal places. However, when the Query is then saved and run in B1, the output is truncated to 2 decimal places. Any ideas as to how I can prevent this for happening?
T0: Points to teh OSPP Table
T1: Points to the OSP1 Table
The portion of the query causing the issue is as follows:
case
when (T1.price is not null) then
T1.price
else
T0.price
endHi Earl
Seems you are right, I have tested with a few different formats and each time get a 2 decimal result. In SQL help I found the following which may explain why:
Result Types
Returns the highest precedence type from the set of types in result_expressions and the optional else_result_expression. For more information, see Data Type Precedence (Transact-SQL).
Even tried it in SQL with a stored procedure storing to a temp table and it shows the full decimals, but executing the SP in SAP Business One results in 2 decimals again.
This is indeed a strange occurrence and I a not sure how you are going to solve it! You can use NVARCHAR for example except that it right aligns the values returned, but at least it doesn't drop the decimals.
Kind regards
Peter Juby -
Query to find records with more than 2 decimal places
I have written the below query to find records with more than 2 decimal places, but it is returning records with decimal places 1 & 2.
The datatype of the AMT column is NUMBER (without any precision).
SELECT amt FROM amount_table
WHERE substr(amt, instr(amt, '.')) LIKE '.%'
AND length(substr(amt, instr(amt, '.') + 1)) > 2Output:-
AMT
*41591.1*
*275684.82*
*64491.59*
*3320.01*
*6273.68*
*27814.18*
*30326.79*
131.8413635
162.5352898
208.5203816
8863.314632
22551.27856
74.716992
890.0158441
2622.299682
831.6683841
*1743.14*
2328.195877
3132.453438
5159.827334
3.236234727
37.784
ThanksOracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
create table amount_table
LINE_NUMBER NUMBER not null,
FEE_AMT NUMBER not null
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (60208, 41591.1);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (60213, 275684.82);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (60238, 64491.59);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (63026, 3320.01);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (59906, 6273.68);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (83111, 27814.18);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (83114, 30326.79);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (2112395, 131.8413634682);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (2112399, 162.5352898104);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (2112402, 208.5203815738);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (2112403, 8863.3146321954);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (2112406, 22551.2785551322);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (2112407, 74.716992);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (2112410, 890.015844079);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (2112411, 2622.2996817048);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (2112414, 831.6683840698);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (2112415, 1743.14);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (2112418, 2328.1958771886);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (2112419, 3132.4534379886);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (2112422, 5159.8273341686);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (2112423, 3.2362347266);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (2112426, 37.784);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (2112427, 198.7423503696);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (2112430, 0.7220848332);
insert into amount_table (LINE_NUMBER, FEE_AMT)
values (2112433, 12.4149375254); -
Query regarding decimal places for currencies
Dear all,
SAP standard allows 2 decimal points as default for any condition value. However, based on the entries in TCURX table we can set number of decimal places with reference to specific currencies.
In our system there is no entry in TCURX table against USD currency. Still the system is taking 3 decimal places against the expected 2 decimal places.
Is there somewhere hardcoded this for US or are they any additional settings impacting this? Please help
Regards,
RajeshHi All,
I have been trying to set 3 decimal places. I got the reference to Note # 38881.
This is what I did:
1. Create a new currency US$ and set the decimal places to 3
2. Maintained the prices using VK11.
3. Changed the customers' sales area currency to US$
But when I created the sales order although the system determined the prices in 3 decimals i got the following information message which keeps on showing during the entire sales order creation:
Pricing error: Mandatory condition ZMAC is missing
Message no. V1801
Details are as below:
The obligatory condition ZMAC does not exist. The document is therefore considered to be incomplete from the point of view of pricing.
The cause can be, for example, that a condition record does not exist for condition ZMAC or that a field overflow has occurred when the condition rate was calculated.
Procedure
Check why the condition could not be found. Use the pricing analysis function on the pricing screen to do this. If necessary, add the missing condition manually to the document.
I believe I am missing some configuration that should be done in pricing, not sure what. As this question has been flagged answered, hope someone would be able to help me.
Thanks & Regards,
Rajesh Singh -
Percentages Incorrect - Not accurate to decimal place
Hi Experts,
I have a report that will generate sales quantities split by company and the associated % of total sales.
The sales % displays to 2 decimal places but the % is the integer before rounding. i.e. if the % should be 6.99723% it would display 6.00%
How do I get it to round correctly to display correct % splits?
The QTY for each company is calculated via a filter on the total sales qty by company name and the % worked out by dividing the filtered column by the total column.
Please help!
Edited by: user11240727 on 10-Jun-2009 08:51Hi
in rpd only, apply cast( measure as real).
here measure is your functionality to calculate % value.
If you are not getting then apply cast( column as real) for each column that you are using to build the % formula..
Also try this,
and again apply round( whole functionality , 6) and now in answers data format of column properties, select decimal places to 5
And what is the query BI Server is generating for this column, seee.. so that you can easily debug. -
Can not change the number of decimal places in the normalization of result
dear all
i want to see the proportion of some data, for example, the income of May is 300, and the total income is 1000, i need to display it like 33.33% . so i set the
Calculate single values as normalization of result, and then it display 33.333%, i like to display only two number of decimal places, so i set the number of decimal places as 0.00, but i doesn't work, it still display three decimal numbers.
maybe you say i can use the percentage function like %CT %GT %RT, but i need to allow external access to my query, so the i can not use those functions.
can somebody helps me ? your advice is appreciated.hi,thanks for your advice, but that doesn't suit for my problem.
before i set the normalization of result, i can change the decimal values. After that i cann't.
In your thread, someone proposes use the T-code OY04. but this wouldn't help. As i change to other key figure, such as user quantity, when i set normalization of result, it still display 3 decimal values.
i think the point maybe lie in the normalization of result. please advise... thanks... -
Key figure, number of decimal places are not showing in report output
Dear experts,
At cube level PO qty value is getting 0.010 where as in bex report output of PO qty showing as 0. I have chosen decimal places as 0.000 in key figure additional properties tab. In query designer also I have chosen no of decimal places as 0.000 in display propertiesu2026please help me out. How can I get 0.010 value in report o/p.
Thanks in advance.
Srivalli.Hi,
Try to run the query in RSRT. CHeck if you are getting the same output. Also make sure that in the reports all the filters are same as you have applied in the info -cube to see the data.
- Jaimin -
U261B An Issue due to 3 Decimal Places in Percentage - Help Required
I've an Issue in BEX report output, which is like when I try to create a 'Percentage' computation on a Key Figure Value, I'm getting 3 decimal places as 'default' output.
The 'Calculations' settings I made for this KF is
> Calculate Result as ... Nothing Defined
> Calculate Single Values as .... Normalize According to Next Group Level Result
> [✔] Apply to results
> Calculation Direction - Along Rows
☹ I ran SAP_RSADMIN_MAINTAIN and set object 'IGNORE_T006_ANDEC' to the value 'X' - Not woking! Should I choose Update/Insert/Delete??
☹ T006-ANDEC & T006-DECAN for '%' has 0 decimal places only. Am I checking the correct stuff?
☹ OSS note 866505 not helpful for my issue. BW 7.0 Stack
I'm getting my output as expected, but the only worrying factor is 3 decimal places due to the 'Calculations'. I'm unable to resolve using existing methods. Should I raise an OSS Note for this?
Please help...Hi, I posted a message to SAP on this topic and got an explanation - it is a behaviour that cannot be changed in certain cases:
it is the known design that it is always displayed with three decimal
places for normalized values and the setting in Query Designer for
decimal place doesn't take effect. This is because that normalization
changes the number dimension of this structure element.
You may refer to below notes about more details.
> 869135 Decimal places and scaling for "Calculate Single Values As"
You cannot set the number of decimal places or the scaling for some
columns or structural components.
For 2: Some "Calculate As" functions change the number dimension of a
KID. In this case, the scaling and the number of decimal places set for
the KID are no longer relevant. In this case, the system ignores the
original setting and selects a setting that corresponds to the new
number dimension. This cannot be overwritten. The following functions
are affected:
Calculate Single Values as Scale to Result, Overall Result or Query
Result: Scaling 1 and three decimal places.
> 501930 Number of decimal places setting is not applied
As a result, normalized values resulting from the list calculation are
displayed with three decimal places and without scaling by default.
best regards, thom -
Difference of decimal place in SAP R/3 and BW
Hello SAP experts,
I am extracting purchasing data from SAP R/3 using datasource 2LIS_02_SCL.
In BW I see a difference of one decimal place.
In RSA3 amount is shown as 17.350,00
Whereas in PSA above value is displayed as 1.735,000
Decimal notations are same in both R/3 and BW.
Please help me to understand the reason behind difference in values.
Thanks and Regards
ShilpaHello All,
The issue is resolved. The difference in Amount is due to different decimal configuration settings in TCURX table in both R/3 and BW. Ideally these settings should be same in R/3 and BW. If decimal settings doesn't match misalignment has to be taken care of either in ETL or during query design.
Thanks and Regards
Shilpa -
Hi,
I am sending quantity field to excel with three decimal places but when I open the excel after generating it shows only two decimal places.How can i obtain this function with excel it should show only 3 decimal places with thousand seperator.
Regards,
Karthik.kHi,
if you are sending your data with OLE try something like this:
SET PROPERTY OF GS_CELL1 'NumberFormat' = '#,##0.000'.
Kostas -
I have a report that has the option of dispalying pdf or excel. I have the pdf version working fine but i am having a little trouble on the excel version. I have a grand total and department total. Basically I need help formating two decimal places. Both dept_total and grand_total are numbers that both display. I have another column that displays what percent of the total is from each dept.It currently returns a number such as 10.23383547957459973 which i need to display as 10.23 How can i incorporate the trunc function into this code?
...to_char((dept_total/grand_total) *100)
The query looks similar to this.
select
to_char(a._grand_total)
,to_char(a.dept_total)
,to_char((dept_total/grand_total) *100)
from(
select sum(xxxx) grand_total,
sum(xxxx) dept_total
from table)aUse ROUND:
select to_char(round(10.23383547957459973, 2)) from dual;
10.23
Maybe you are looking for
-
Captivate 4 will not open with latest Flash Player installed?!
Hi, I've seen this question already, but there wasn't any working answer. When I launch Captivate, I get the warning box saying flash player "is not installed or its an older version" - with an OK button which just launches IE to get the player, and
-
Disk Utility Freezes & MS Word & Excel Won't Launch
Yesterday, my Disk Utility froze when it started performing a Verify Disk and I had to force quit. This morning I was using both MS Excel and MS Word, closed them and when I tried to open them 30 minutes later, neither will launch and I get an error
-
HT204088 How to view all of my apple transactions charged to my credit card
I've been seeing various charges to my itunes account each month, but I'm unable to locate "all transactions" history on my account. Help please.
-
Error when installing Integration content- Could not create java
Hi all, when i been installing the integration comp. in a server win 2005 32 bits, the installer give the next error: coul not create java virtual machine. i try desintaling and installing jvm 1.5 like manual, and i dont know why happens this error.
-
Mega 180 - Install Video Card or Install Video Driver
I just spent 6 hours at a customer's house trying to fix the Mega 180 I built for her. As I stated in a previous thread, the machine was working fine and then she experienced the BLACK SCREEN OF DEATH. This is when your machine POSTS, loads Window