SQL cast statement to return 3 decimal places in AR invoice fields

My statement is:
SELECT CAST ($[$38.58.NUMBER] AS NUMERIC(19,6)) * CAST ($[$38.U_PriceKG.NUMBER] AS NUMERIC(19,6))       /  CAST ($[$38.11.0] AS NUMERIC(19,6)),3)
This statement returns 3 decimals which is correct.  The issue is the 3 rd decimal is always 0 instead of the correct result.  Example if result should be 98.784  the query returns 98.780
What can be changed in the syntax to allow return of the exact result.
I am working in AR invoice.  Th U_PriceKG field is a UDF defined as price.  General settings display price as 3 decimals. 
Any suggestions would be greatly appreciated
Edited by: Charlotte Sicard on Jan 20, 2010 10:50 PM

Hello,
Check you decimal settings.
SELECT CAST ([$38.58.NUMBER] AS NUMERIC(19,6)) * CAST ([U_PriceKG.NUMBER ]AS NUMERIC(19,6)) / CAST ([$38.11.0] AS NUMERIC(19,6)),3)
The SBO will display the result of your query depending on the UDF type you have set up, and will display the decimal values based on decimal settings  in General Settings \ Display tab.
Regards,
J.

Similar Messages

  • Decimal places in the BCC field

    Hello,
    I created a field in the xml to save a field of type double, but only allows up to three decimal places.
    <property name="freight" data-type="double" column-name="freight" display-name-resource="freight" category-resource="categoryBasics" >
         <attribute name="propertySortPriority" value="50" />
    </property>
    with sql for the column freight
    freight
    number(28, 20)
    NULL
    I noticed that this also occurs in other fields in BCC,
    Is it possible to increase the number of decimal places for a property?
    thanks.

    Hi,
    I created the view mapping as your orientations and looked like this
    <add-item item-descriptor="itemMapping" id="AmImTest">
      <set-property name="itemName"><![CDATA[test]]></set-property>
      <set-property name="description"><![CDATA[AssetManager Test itemMapping]]></set-property>
      <set-property name="mode"><![CDATA[AmMmDef]]></set-property>
      <set-property name="viewMappings"><![CDATA[ivM1]]></set-property>
      <set-property name="formHandler"><![CDATA[AmFhDef]]></set-property>
      <set-property name="itemPath"><![CDATA[/atg/multisite/SiteRepository]]></set-property>
      <set-property name="name"><![CDATA[AssetManager]]></set-property>
    </add-item>
    <add-item item-descriptor="itemViewMapping" id="ivM1">
      <set-property name="propertyMappings"><![CDATA[propertyViewMapping=pvM1]]></set-property>
      <set-property name="attributeValues"><![CDATA[includedProperties=av1]]></set-property>
      <set-property name="displayName"><![[scopus.geralProperties]]></set-property>
      <set-property name="name"><![CDATA[ item View Mappi]]></set-property>
    </add-item>
    <add-item item-descriptor="attributeValue" id="av1">
      <set-property name="value"><![CDATA[id,name,description,freight]]></set-property>
    </add-item>
    <add-item item-descriptor="propertyViewMapping" id="pvM1">
      <set-property name="propertyView"><![CDATA[pv1]]></set-property>
    </add-item>
    <add-item item-descriptor="propertyView" id="pv1">
      <set-property name="description"><![CDATA[BIZUI Basic editor for double properties with more than 3 decimal characters.]]></set-property>
      <set-property name="attributes"><![CDATA[inputFieldMaxlength=pvAtrDef1]]></set-property>
      <set-property name="mode"><![CDATA[aMgrMmView]]></set-property>
      <set-property name="isComponentPropertyView"><![CDATA[false]]></set-property>
      <set-property name="isReadOnly"><![CDATA[false]]></set-property>
      <set-property name="type"><![CDATA[double]]></set-property>
      <set-property name="name"><![CDATA[SCO BIZUI with more than 3 decimal characters.]]></set-property>
    </add-item>
    Did I missed something?

  • Change the decimal places in screen MIGO field Order quantity - MENGE

    Gurus
          the scenario is in Screen MIGO , when gettin inside posting MIGO the functinal consultants need to give order quantity in the second screen and the technical name of that field is MENGE which can accept only 2 decimal places after point...now the requirement is we need to have 5 decimal places after point in that field...
    how to achieve this....

    still not solved.
    impact analysis

  • Decimal Place settings for  'Total' field in Marketing documents.

    Dear sir,
    I'm Using SAP B1 2005B Patch Level 5
    I want to know which Decimal places setting i have to set for'Total'
    Field in all Marketing documents.I want to know whether it come's under
    Prices settings or Amounts setting.

    Jambulingam,
    The no. of decimals is set  in the Administration  -System Initialisation -  General settings - Display tab . There on the left hand side you can see the settings for decimals.
    Since it is a total you wil have to set it for Amounts.
    Nagesh

  • SQL*Loader how to handle decimal place

    Hi all
    I need to load data into table with number field (12,2)
    however, the source data is 1,025.02. Then the data cannot be loaded and in log, there is error message Invalid Number
    Please kindly advise how to handle this in control file?
    Thanks
    Thomas

    load data
    ,YOUR_NUMBER_COLUMN .... ... ... " to_number(:YOUR_NUMBER_COLUMN,'999G999D99' , 'NLS_NUMERIC_CHARACTERS=''.,'' ')"
    )

  • Suppressing decimal places in the screen fields

    Hello All,
    I need to display a quantity fields which is referring to the domain MENGE(10+3)
    While displaying, it appears as 1234567890.000
    here how to suppresss the zero's.
    Screen field is got from program(not dictionary)
    can you help me out.
    Regrds,
    Subramanian.

    Hi,
    Try the following..
    in the attributes for the menge field give the Reference field (down below the attributes screen)...
    Also Check the check box Right justified..
    Thanks,
    Naren

  • Problem while changing decimal places in SAP B1 2007

    Hi Experts,
    I want change the decimal places of Quantity type fields from 2 decimal places to 4 decimal places. But while changing it in Genral settings form ,it shows the error message "Cannot update while another user is connected to the company". it is working in SAP B1 2005B but not in SAP B1 2007
    Please help me if you have any solution on this issue..
    Thanking you in advance

    Paul,
    Please see SAP Note 1247060 as is discusses the fact that this did work in 2005, but the behavior was changed in version 2007 ...
    https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/smb_searchnotes/display.htm?note_langu=E&;note_numm=0001247060
    Eddy

  • Decimal places in Pur docs - URGENT

    Hi
    We have requirement in our project where we need to accomodate 4 decimal places in the PRICE field instead of the 2. For example we load an item from catalogs or external supplier site, where the price is 75.3492 the price gets rounded off to 75.35 but we need the exact price with 4 decimal places. Is there any way we can accomodate this? any inputs would be appreciated.
    Thanks
    Naveen

    Hi Naveen,
    In transaction OY04, you can specify the decimals for currency.
    Kind regards,
    Yann

  • Changing the Decimal places for Percentage in cost distribution in SC

    Hi Gurus,
    Is it possible to change the number decimal places for the Percentage field in cost Assignment tab in Shopping cart in cost distribution option?
    The user wants 3 decimal places, currently we can enter only 2 decimal places.
    I have gone thro' couple of blogs which are talking about changing the price decimal and not the percentage field decimal. (in IMG setting: General settings > Currencies > Set Decimal places)
    So, if anyone come acorss this issue, please let me know.
    Thanks and Regards,
    Nowsath

    Decimal Places Factor of the Receiver Weighting Factors
    Specifies the number of valid decimal places with which the given weighting factors are valuated.
    Example
    You enter 123456 as the weighting factor. Depending on the factor, this number is interpreted as:
    Factor Decimal places Weighting factor
    1 0 123456
    10 1 12345.6
    100 2 1234.56
    1000 3 123.456
    10000 4 12.3456
    100000 5 1.23456
    1000000 6 0.123456
    Please check with your FICO consulant .what settings you have in backend system.
    http://help.sap.com/saphelp_nw04/helpdata/en/bb/bdbdc4575911d189240000e8323d3a/frameset.htm
    Muthu

  • Decimal place in Quantity field

    Hello experts,
    Got a query regarding decimal places in the quantity field of a sales order.
    The material UOM is maintained as EA. I have checked the transaction CUNI, where the decimal place is maintained as ZERO. Still , Sales order / Delivery documents which i am creating is allowing decimal places for in the quantity.
    For eg: material quantity of 50 EA in sales order, during the delivery batch splitting is getting splitted as 25.095 EA and 24.050 EA. Can you pleae advise the reason for this and how to go about this...
    Thanks,
    Safeer Rahman

    Thanks for your reply....
    But , as i have already told the decimal place field  is maintained as 0(zero) in CUNI for the UOM EA.... Still its allowing me to enter decimal values... for eg:. its allowing me to enter 50.038 EA. I don't know why its not giving an error message prompting me not to enter decimal values...
    Any idea?
    Thanks,
    Safeer Rahman

  • Decimal places of the field

    i have some fields of datatype  curr and domain wertv6/wertv7...which has 2 decimal places..
    but in my screen i'm getting 5 decimal places for all those fields....how is this happening?

    hi Anil,
    go to se84
    expand abap dictionary
    go to data element
    and write domain name = wertv6,data type = curr,decimal = 2
    you will find lots of data element.
    hope it solves your problem
    thanks
    Sachin

  • Decimal place truncuation!!

    hi i have a field in XI called net_price how should i change the decimal place value of that field to more than 2 decimal places
    say 4 ,now it is truncuating to two decimal places.
    thanks
    Edited by: Capricorn!! on Aug 27, 2009 6:14 AM

    Hi Somenath,
    Are you sure that all the data in cube is affected? I mean also the data loaded in cube before GUI upgrade?
    I have a feeling that instead of GUI upgrade something happened to the background user that is extracting the data in source system. E.g. this user master data has changed - in decimal format.
    So check the user and check data loaded before/after change of GUI.
    BR
    m./

  • 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
    end

    Hi 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

  • Sql Function to return 2 decimal places

    Hi,
    Can you please tell me how can i convert any integers to 2 decimal places using sql.
    for e.g 124 to 124.00
    150.2698 to 150.27
    12.3 to 12.30
    Thanks,
    Parvez

    Like this:
    SQL> with t as
      select 124 n from dual union all
      select 150.2698 from dual union all
      select 12.3 from dual
    select n, to_char(n,'9999.00') n_new from t
             N N_NEW  
           124   124.00
      150.2698   150.27
          12.3    12.30
    3 rows selected.?

  • Yielding the desired number of decimal places using the AVG function in t-sql

    Hello again.  Confused retired hobby coder having trouble setting up a scalar-valued function to return the desired number of decimal places from a AVG query.
    Whenever I run the following script I get the number of decimals I desire:
    Using the above I created a scalar-valued function as follows:
    Running this function as: SELECT [dbo].[TestHCIPartial] (1,3)  my return is -7.
    Can you help me with the function causing it to yield the answer to 6 decimal places?
    Thanks and regards, Minuend.

    You've not specified precision and scale in UDF return type. So you're leaving it to server to interpret it based on default settings
    If you want exactly up to four decimal places tweak udf as below
    ALTER FUNCTION..
    RETURNS decimal(20,4)
    AS
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

Maybe you are looking for

  • Help With GPS options

    I am using my phone and do not want any "data" transfer so the carrier doesn't pick my phone up as a smart phone.  The phone is a 700.  Note that I do have Mobile Data turned off and Allow Mobile Data Usage set to in home network only.  Having the Da

  • My HP F4180 not working with my Mac Mini

    My HP F4180 will not work with my Mac mini. I doesn't even like my set up disc. Please advise. Thank You.

  • ITunes doesn't open when I connect my iPhone

    i upgraded from Tiger to Leopard. Since then every time I connect my iPhone, iTunes doesn't open automatically. And the phone restarts every time I connect to computer. Please help.

  • Dim focus points in viewfinder

    Is it possible to brighten the focus point(s) in the viewfinder. Using the Canon 3Ti. Wearing tri-focal glasses it's hard to see them at times (depends on lighting, background, etc.). Canon 3Ti, EF 50mm f/1.4 USM, EF-S 18-55mm f/3.5-5.6 IS II, EF-S 5

  • Rebate Agreement Scenario

    Greetings all, I am planning to implement Rebate agreement in our system. There is a scenario that one customer is calculated in over lapse period, One for quarterly period and another in annually period. For example, sales for customer A will have r