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

Similar Messages

  • Lost Decimal Places when extracting value from ODS into Cube

    Hi,
    In short, we wish to transfer data from an ODS to a custom cube. One of the Key Figures is becoming an integer in the process.
    Both the ODS and Cube use the same InfoObject which is defined as a Number with a Data Type of FLTP.
    If I set a break-point in the update rules, I can see that it is reading the value into the communication structure correctly. Yet, when I browse the data in the Cube, it seems to have lost the decimal places in the update.
    More details:
    We have a custom ODS and cube which needs to store a Unit Price to four decimal places. In creating the InfoObject for Unit Price, we could not use a Data Type of Currency (Type = Amount) as this is limited to 2 decimal places.
    Instead, I used a Data Type of FLTP (Floating Point) and a type of Number. All decimal places are loading correctly into the ODS, but are being lost when transferred to Cube.
    Many thanks
    Adrian

    Hi Simon and Emmanuel,
    Thanks for the suggestions.
    Unfortunately the Query is returning the same integers as LISTCUBE.
    Also, my key figure has the same definition in both the ODS and cube (uses the same InfoObject), and there is no transformation - just transfer.
    I'd prefer not to create another currency. It could get a bit messy if I'm having to include the figure in calculation with other figures that use the real currency.
    I had thought of making the key figure a standard type of Currency and multiplying the value by 100 before storing them in the cube - then I would simply divide the figures by 100 in the query. But again, not ideal.
    I have logged a OSS note with SAP to see if there is any known issue with transferring  a floating point number between the ODS and Cube.
    Thanks
    Adrian

  • I need to get 2 decimal places when using a formula for a quotient and Numbers will only give me whole integers which is useless since most items will be less than 1. How can I change this?

    How do I get 2 decimal places when using a formula for a quotient? It only gives me whole integers. Most of the results will be less than 1 so I need 2 decimal places

    the quotient function returns only whole number portion of the dividing two numbers.  If you want the actual decimal value use the divide operator.  you enter this as:
    A/B
    if the numerator is in A1 and the denominator is in B1 you can enter the formula like this:
    =A1/B1

  • Decimal places on the result row is incorrect

    Dear Expert,
    I met a problem that decimal places on the result row is incorrect.Anyone can help me?
    On key figure balance,we do the currencies translation,also we set the key figure should have two decimal places.
    We set a fomular to calculate the total result of Account A,B,C.
    (Total result = account Aaccount Baccount C).
    If we manually sum up the balance of account A,B,C displayed on analyzer,which are rounded to 2 decimal places,the result should be 601.25(100.61200.38300.26),but the actual total result executed by query is 601.24.
    In fact we need the result 601.25 instead of 201.24.
    I take the example as following:
    Account      Balance
    Account A  100.61
    Account B  200.38
    Account C  300.26
    Total result 601.24
    Thank you in advance.
    Best Regards,
    Maggie
    Edited by: Maggie Ma on Sep 25, 2008 9:17 AM

    your "problem" is, that BEx is not totalling the "displayed" values but the real values
    try a summation on the following in Excel:
    100,605
    200,375
    300,26
    then format the cells to show 2 decimal places only
    do you see the result changing?

  • Formatting decimal places in the X Axis

    I’m having trouble limiting the number of decimal places in my X Axis on a 2 Axis plot.
    I am running a script file (SUD) that sets all the other parameters in the Plot. The “Report “ file is called up and then the script controls the functions.
    This is only a small section of the code. I haven’t found a command to set the Decimal place in the “help” page.
     ie: Call GraphObjOpen("2DAxis1_XAxis1")
        D2AxisXFormat    = " "
        D2AxisXAng       = 0
        D2AxisXRelPos    = "bottom"
        D2AxisXFont      = ""
        D2AxisXSize      = 2
        D2AxisXColor     = "blue"
        D2AxisXColorRGB  = 50266112
        D2AxisXAutoColor = 0
        D2AxisXBold      = 0
        D2AxisXItal      = 0
        D2AxisXUndl      = 0
        D2AxisXStrOut    = 0
        D2AxisXFrame     = 0
      Call GraphObjClose("2DAxis1_XAxis1")
    And:
    When I open the “Curve and Axis Definition” window of the graph on the report page ,and set the “Format:” function to display “d.dd” It seems the script is overwriting the format that I set.
    This is what I have now and would like to display only 2 decimal places in the X Axis. Can you help?
    Thanks!
    SJD
    Solved!
    Go to Solution.
    Attachments:
    X-Axis Decimal places.jpg ‏17 KB

    Thanks Brad for you quick response.
    It kind of worked... I think I might have something else going on. Not sure what though.
    With the changes made in the script you suggested, the X-Axis has changed to two digits but now it displays  " 1.dd "
    Any thoughts where else I might have gone wrong?
    Thanks again
    SJD
    Attachments:
    2013-03-13_151027.JPG ‏12 KB

  • Amount has moved one decimal place in the report

    Hi,
    I am looking in to a report at present, Transaction amount has moved one decimal place, while the local amount stays the same. Any one could tell me the possible reason for this?
    Thanks in advance
    RN

    Hi,
    Check this link,
    http://sap.ittoolbox.com/groups/technical-functional/sap-bw/key-figure-in-cube-is-multiplied-by-100-when-displayed-in-bex-report-743076
    same issue find in this.
    Hope it will help you.
    Thanks,
    Hema

  • Increase decimal places in the PO quantity and Price

    Hi All,
    Can the decimal places in the PO( ME21N) creation be increased more than 3 decimal places in quantity and price?
    I did changes in UOM's in CUNI, I increased the decimal places upto 14 but still it does not take more than three i-e., 0.001 maximum.
    Is there any other way to handle this?
    Request inputs on this.
    Note 569326 - ME9F: Customized decimal places are not taken into account........ found this OSS but this correction instruction is not for our pack level ECC 6.0
    Best regards,
    Sridhar

    hi
    In case if you are already working in production remember that decimal places should not change. It will affect all previous data.
    For your problem best solution is make order unit as 1000. So that your problem will solve
    e.g. instead of 2.009 inr for 1 Unit use 2009 inr for 1000 unit.

  • How to add 2 decimal places if the number is whole number(Integer)

    Hi Gurus- I had a requirement to add the zeros for two decimal places even the number is an whole number.
    Example: I had a column which i gave the datatype as Number(8,2) .While Inserting from the flat file to the custom table column,i am rounding it to 2 decimal places.But if its the whole number i want that also to be rounded to 2 decimal places.
    1) 3456.89675 It's getting inserted as 3456.89
    2) 123 It's getting inserted as 123 (Instead i want this to be inserted as 123.00)
    3) 123.50000 It's getting inserted as 123.5 (Instead i want this to be inserted as 123.50)
    Can you please let me know how can i achieve it to insert any number(decimal or whole number) from the flat file as 2 decimal places in the custom table column.
    Thanks in advance.

    Please do not post duplicates -- To update the date for the first of the month

  • 0xC0202009. The component returned a failure code when the pipeline engine called PrimeOutput().

    HI ,
        While importing data of MS access file [MDB file] i am getting an error code like 0xC0202009.  The component returned a failure code when the pipeline engine called PrimeOutput(). 
    I have 19k records in that only 8548 records are transferred and i get a above error message.
    If anyone knows the reason please let me know.
    bhavana

    Hi Deepa_Deepu,
    The error code and error message you posted are rather general and don’t give much useful information. To make further analysis on the issue, please post the complete error messages and let us know how the package is designed.
    Besides, you can configure the Error handling of specific component in the Data Flow Task to redirect the bad rows to a flat file, and make analysis on the rows. In addition, you can also try different drivers or providers.
    Reference:
    http://technet.microsoft.com/en-us/library/ms141679.aspx 
    Regards,
    Mike Yin
    TechNet Community Support

  • Hi BC, I have an issue with BC. When the shopping cart is used it takes stock out of inventory and h

    Hi BC,
    I have an issue with BC. When the shopping cart is used it takes stock out of inventory and holds it, regardless of whether or not a customer proceeds to purchase. OK.
    To make matters worse, the stock is only cleared from the shopping cart when the customer closes the browser - not when they close the shopping window.
    Now lets say a customer doesn't close their browser for a month - it happens! .. when their stock is finally returned it may throw out our stock levels that have in the meanwhile been adjusted. So their stock will be added on top of an accurate stock take, putting stock in that isnt really available.
    This is causing us mayhem.
    We have not yet seen if stock is actually returned at all. In the test we did today where we filled a shopping cart then closed the browser without making a purchase, the stock was not returned immediately. So we dont even know when it will be returned - thats IF a customer actually closes their browser. Any solutions out there?
    Jo

    Hi there,
    The way stock is managed in this situation is desirable for many in that case otherwise shopping on a site and adding to cart would not be viable or use friendly.
    What you mention about not closing a browser though is a case that is not true. IF you go into the shop settings in the admin you can see the cart restore timer which is by default 24 hours but you can change this to as low as 1 hour if you wish.

  • When the update statement will check the constraint violation ?

    Hello all,
    i am working on data masking of production data using oracle Translate function.i have created a function otis_mask using translate function to mask sensitive values .For this i am tesitng on a small table. i have created a table with single primary key column SSN.
    sql>desc SSN_MASK
    Name Null? Type
    SSN NOT NULL NUMBER(10)
    1) i have inserted the value 9949577766. if resulted mask value exist in table it should throw the constraint violation error.But it is not throwing any error.rows are properly updating .
    Eg:-
    Table contains below values.
    PA_DATA_SUB @qdsrih30 >select *from SSN_MASK;
    SSN
    7727399911
    9949577766
    9989477700
    UPDATE SSN_MASK SET SSN=otis_mask(SSN);
    if above update statement process 7727399911 first then resulted mask value is 9989477700.This value is already in the table.
    if the update statement process 9949577766 first then resulted mask value is 7727399911.This value is already in the table.
    in any of the above scenario update statement should have to throw constraint violation error. But its not happening. rows are properly updating . when the update statement checking the constraint violation ? after processing all the rows or processing of each row ?
    Please help me in understandding the update statement processing ?
    Thanks,
    Venkat Vadlamudi.

    1)created a function as below.
    CREATE OR REPLACE Function otis_mask(incol varchar2) return varchar2 is
    random_str varchar2(20);
    begin
    select (translate(incol,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890','qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0842319576')) INTO random_str FROM DUAL;
    return random_str;
    end;
    2. create a table ssn_mask.
    create table ssn_mask(ssn number(10) primary key);
    3) inserted 3 rows as below.
    insert into ssn_mask values(9949577766);
    insert into ssn_mask values(7727399911);
    insert into ssn_mask values(9989477700);
    4)UPDATE SSN_MASK SET SSN=otis_mask(SSN);
    5) Table contains below rows.
    Sql >select *from SSN_MASK;
    SSN
    9949577766
    7727399911
    9989477700.
    6)UPDATE SSN_MASK SET SSN=otis_mask(SSN);
    If the above statement process first row 9949577766,then otis_mask function will return 7727399911 and update statement will update the value of 9949577766 to 7727399911 .At this case 7727399911 is already in the table.So update statement should have to throw primary key constraint violation error.
    If the above statement process second row 7727399911 first ,then otis_mask function will return 9989477700.and update statement will update the value of 7727399911 to 9989477700.At this case 9989477700 is already in the table.So update statement should have to throw primary key constraint violation error.
    But its not throwing any integrity constraint violation error.
    i just want to know when update statement will check the constraint ?
    is update statement will first process all records and kepp in handy the new values then update the table with new values (or) process the first row and update the new value with old value then process second row and update with new value so on ?
    Thanks,
    Venkat Vadlamudi.

  • When the Worker.State FAILED occurs in a Task?

    How to detect that a Worker.State FAILED occurs in a Task? or to say when the Worker.State FAILED occurs in a Task? Is it when an exception happens in the call() method of Task?
    Consider the code below:
    import java.io.BufferedReader;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.net.URI;
    import java.net.URISyntaxException;
    import java.net.URL;
    import java.net.URLConnection;
    import javafx.concurrent.Task;
    * Background task to fetch the all classes documentation page from a URL
    public class FetchDocListTask extends Task<String> {
      private final String docsDirUrl;
      public FetchDocListTask(String docsDirUrl) {
      this.docsDirUrl = docsDirUrl;
      @Override
      protected String call() throws Exception {
      System.out.println("---- FetchDocListTask  docsUrl = " + docsDirUrl);
      StringBuilder builder = new StringBuilder();
      try {
      URI uri = new URI(docsDirUrl + "allclasses-frame.html");
      URL url = uri.toURL();
      URLConnection urlConnection = url.openConnection();
      urlConnection.setConnectTimeout(5000); // set timeout to 5 secs
      InputStream in = urlConnection.getInputStream();
      BufferedReader reader = new BufferedReader(
      new InputStreamReader(in));
      String line;
      while ((line = reader.readLine()) != null) {
      builder.append(line);
      builder.append('\n');
      reader.close();
      } catch (URISyntaxException e) {
      e.printStackTrace();
      return builder.toString();
    When the State.FAILED occurs? In fact, I want to write a code to simply detect whether the computer is connected to the internet. Hope for help~

    Yes. If the call() method exits due to an unhandled exception, the state property changes to FAILED. If a return statement is successfully executed, the state property changes to SUCCEEDED. There are no other possibilities.
    You can test with something like:
    import javafx.application.Application;
        import javafx.concurrent.Task;
        import javafx.concurrent.WorkerStateEvent;
        import javafx.event.EventHandler;
        import javafx.scene.Scene;
        import javafx.scene.control.TextArea;
        import javafx.scene.layout.BorderPane;
        import javafx.stage.Stage;
        public class TaskStateTest extends Application {
            public static void main(String[] args) { launch(args); }
            @Override
            public void start(final Stage primaryStage) {
                Task<Void> exceptionHandlingTask = new Task<Void>() {
                    @Override
                    protected Void call() throws Exception {
                        try {
                            throw new Exception("Boom");
                        } catch (Exception exc) {
                            System.out.println(exc.getMessage() + " handled");
                        return null;
                Task<Void> exceptionThrowingTask = new Task<Void>() {
                    @Override
                    protected Void call() throws Exception {
                        throw new Exception("Boom");
            //            return null;
                final BorderPane root = new BorderPane();
                final TextArea textArea = new TextArea();
                root.setCenter(textArea);
                primaryStage.setScene(new Scene(root, 600, 400));
                primaryStage.show();
                registerHandlers(exceptionHandlingTask, "exceptionHandlingTask", textArea);
                registerHandlers(exceptionThrowingTask, "exceptionThrowingTask", textArea);
                Thread t1 = new Thread(exceptionHandlingTask);
                Thread t2 = new Thread(exceptionThrowingTask);
                t1.start();
                t2.start();
            private void registerHandlers(final Task<Void> task, final String msg, final TextArea textArea) {
                task.setOnFailed(new EventHandler<WorkerStateEvent>() {
                    @Override
                    public void handle(WorkerStateEvent event) {
                        textArea.appendText(msg + " failed\n");
                task.setOnSucceeded(new EventHandler<WorkerStateEvent>() {
                    @Override
                    public void handle(WorkerStateEvent event) {
                        textArea.appendText(msg +  " succeeded\n");

  • Is the "deadline" variable also set when the Due transition is used ?

    Hi,
    I needed to understand if the 'deadline' variable is also set when the due transition is used. The reason I am asking is because of the following scenario that we saw:
    1. There is a Due transition form an interactive activity to an automatic
    2. The automatic had a Syntax error (typo) in a SQL statement
    3. When the instance reached this automatic... the instance aborted... [process level Exception level handling is not present :( ]
    My first thought was that there was an instanceExpiration exception, but was not certain.
    An leads would be nice...

    1. The exception is seen in the Engine Logs, but the strange thing is that sometimes the Expection is caught within the localized exception block and still manages to bubble up to the process level exception handler...If you have a 'throw ex' in your catch block its supposed to propagate up to the process level... (there is a setting to prevent this...)
    2. I tried adding the throws clause in the catch block to force it to always bubble up to the process level exception handle, this does not always happenThis sounds strange, that it doesn't always happen? Right click on the project, and go to Preferences, in the Processes category, set the Exception Handling to 'Propagate', that should send the error the parent process.
    3. I tried removing the localized catch blocks to always be caught by the process level handler... this also does not happen consistently... The exception is seen in the engine log and the instance goes on its merry wayIf the exception gets caught, (without an additional 'throw') the instance will continue...
    HTH,
    -Kevin

  • What type of Data target is used when the safety interval is used?

    Hi ,
    what type of Data target is used when the safety interval is used in generic delta in datasource?DSO or cube  or cube?
    Pls explain me ?
    Thanks,
    Nimai

    It's up to your reporting requirement to go for dso or cube..
    I prefer to having staging with DSO and then further reporting on Cube ..
    It's always easier to manage when you have any changes to the cube .. you need not to extract data from R/3 .. if you have dso you can extract directly to cube
    Another thing is -for any reason some of your records got corrupted so you can have full loads to dso which has the overwrite functionality...  and sends delta records to cube. even in cube you can do selective deletion but we have to very careful to avoid double records in next loads
    Edited by: Srinivas on Jul 29, 2010 8:23 PM

  • [svn:fx-trunk] 11593: Advanced CSS fix - descendant selectors should search for arbitrary ancestors including when the universal selector is used .

    Revision: 11593
    Author:   [email protected]
    Date:     2009-11-09 15:20:36 -0800 (Mon, 09 Nov 2009)
    Log Message:
    Advanced CSS fix - descendant selectors should search for arbitrary ancestors including when the universal selector is used.
    QE notes: Please add test cases for arbitrary ancestor depth that involve using the universal * selector. Thanks for the additional testing on this patch too!
    Doc notes: N/A
    Bugs:
    SDK-23213 - descendent selectors can't catch components more than one level down
    Reviewer: Corey
    Tests run: Checkintests, test case
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-23213
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSSelector.as

    Welcome guy -
    Unless you are using Spry menus as a learning experience, you should move forward to a menus system that will display properly on the millions of portable devices that won't work with Spry which was deprecated 2 years ago.
    Many are using JQuery menus or pure HTML/CSS menus.
    If you wish to continue your Spry for learning experience, we'll be glad to assist; please let us know.
    By the way, your submenus are not showing because you need to add the red value to this rule in your vertical CSS
    ul.MenuBarVertical ul.MenuBarSubmenuVisible{
        width: 220px;
        left: 180px;

Maybe you are looking for