How to validate for 2 decimal places

How can I put a check while inserting into a number(5,2) field that user has entered only 2 decimal places. Right now if the user inserts records like 23.5456 it gets inserted as 23.56 . I want these type of records to error out. Is there an easy way to do this kind of a validation while inserting.?
Thank You,
SK

Sorry, I don't see how you're going to accomplish this. The value has already been implicitly rounded before check constraints or triggers fire. I guess if they were inserting true literals you could check the SQL statement itself and it's possible to get at bind variable values but that's going to be a real nightmare to implement properly. I think you're going to have to have the column as a number with no scale and check constrain it if this is really required. You could probably do this with a view and instead of triggers but that's going to be ugly.

Similar Messages

  • How to increase no. of decimal places in a cube

    Dear Friends
    Can you tell me
    how to increase no. of decimal places in a cube
    i want 5.98765 this value in the keyfigure
    but it is allowing me only 5.987 only 3 digits after decimal
    urgent
    Thx

    Hi Laxmi,
    Inorder to store data with more than 3 decimal places,you can check the keyfigure with maximum precision checkbox available in the additional properties tab of the keyfigure.By which you can store upto 9 decimal places.
    Or
    You can change the data type from DEC to FLTP,by which you can store data upto  15 decimal places in the cube.
    Also by changing decimal places in Bex allows you to change the decimal places for the data to be displayed and if the data in the cube is holding 3 decimal places how can you display 5 decimal places in report.
    Hope it helps....
    Regards,
    Umesh.

  • VB: How do i format two decimal places?

    I'm using VB in Visual Studio 2013.
    The professor wants the answers from the textboxes to be displayed with dwo decimal places. 
    all he gave us was the following syntax:
    format (#,#.00)
    however i have no idea how to get this to work as i tried to figure it out on my own and nothing. i would like it to be displayed with the dollar symbol if possible with the comma separators when needed.
    i tried declaring a variable as a string and a double but i kept coming to a dead end. help please. this is the last thing i need to turn this in tomorrow.

    Hi guys,
    I don't know how long is your forum experience. 
    But there is a long time etiquette in the forums, which stands from the first day of newsgroups not to help people with code for homework.
    Do you real think I could not do that?
    Now it took me more time, but probably a wast because your replies.
    Success
    Cor
    Success
    Cor

  • How to get the exact decimal places displayed while exporting to Excel?

    Hi All,
    I have a requirement to display the exact decimal place values in my report. In my pivot table, i duplicated a column named order number and converted to percentage by applying these conditions Show Data As-> Percent Of-> Column. I got a resultant column with one decimal point. As i needed two decimal points i took the xml of the report and changed the minDigits='2' and maxDigits='2' values like this. After that i got the accurate answer. But when i export it as excel sheet it is not showing the % column properly. The values after 0 is not getting displayed. Any solution for this?
    Thanks in Advance
    Thenmozhi

    Hi Thenmozi,
    You can try adding the below statement in the Custom CSS section of the your column properties.
    mso-number-format:"\@"
    Edit your report--> Criteria-->which column you want to display in excel click column properties --> select CCS--> Paste here above code.
    Second way:
    Edit your report --> criteria-->click fx option for your column and apply the below code.
    2. '<span style="display:none">&nbsp</span>' || CAST(your column name AS CHAR)
    Award points it is useful.
    Thank,
    Satya

  • How to validate for non-english character on a single line text field

    In a "Single Line Text" field we would like to allow the users to enter alpha numeric values only. We should show error when the user enter non-English values like
    carácter
    Vijayaragavan, MCTS

    Hi,
    According to your post, my understanding is that you wanted to validate for non-english character on a single line text field.
    I recommend to use jQuery to attach regular expression validation. Please refer to:
    Using #jQuery to attach regular expression validation to a #SharePoint list form field
    In addition, for custom validations you can create your own Types. Refer to
    this[^] for creating custom field type
    More information:
    SharePoint Custom Field - Regex Validator
    Thanks,
    Linda Li                
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

  • GUI download, how to retain format of decimal places

    Hi everyone!
    I have a program that downloads data to excel file using GUI Download. The values of the amount in the ALV display are 11.90, 11.90- which is correct because it has two decimal places. But the problem now occurs in the excel file. The values are now 11.9, 11.9-.
    Do you know of any method that will retain the format of the values when it is already in the excel file.
    The format of my decimal notation is 1,234,567.89.
    Thanks in advance.

    Thank you!
    But I need to have the format of the numbers in the excel the same as the format in the ALV <b>without changing the format of the cells in the excel file</b>. It has to be changed in the program.
    Actually there are also amounts that are being displayed in excel file with 2 decimal places the same as the ALV display. But some of the amounts were changed when it comes to the excel file, and I don't know why this happens.
    Thanks.
    Message was edited by:
            Betsie Camoro

  • How to Validate an order once "Place Order" button is pressed

    Hi,
    We have a requirement which is, When customer places an order, we need to check if that order has Item 'ABC' in it.. If so, There should be another item 'XYZ' should also be in there. if not, we should throw error message on Checkout page itself. We don't want to customize the JSP as we don't have expertise. Can any one suggest the PL/SQL APIs where we can include this logic? or any other logic?. We just want to understand which API will get executed as soon as they hit that 'Place Order' Button on Check out page.
    Thank you.

    Hi,
    I think it is too late to validate items during Place Order.
    I would suggest you should do it when you click the Checkout button.
    If you refer to ibeCScpViewA.jsp (which is used when we click on Checkout button)
    you can find ready code which loops over all the items in the cart.
    You can easily customize this page.
    If you still want to stick to Place Order, then you need to customize ibeCCkpOrdReview.jsp.
    but you will have to write a lot of code on your own.
    Hope it helps!
    Hrishikesh

  • How to validate for proper date format

    Hi Experts,
    I am using following Fm to calculate date difference.....
    call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
          exporting
            i_date_from = wa_draw-zdm_vld_to_dat
            i_date_to   = sy-datum
          importing
            e_days      = v_days.
        if sy-subrc = 0 .
          if v_days > 0.
    But value of field  zdm_vld_to_dat (data type DATS  , YYYYMMDD)   in database tables itself is wrong   ...like  ct/-0/29-o
    I want to avoid passing these wrong data entry, in the FM...as also i give info message for this in spool.
    So can anybody tel me How can I detect or know this fields zdm_vld_to_dat  conatins wrong date other than YYYYMMDD...e.g.
    ct/-0/29-o   means any charecter or hyphen
    Thank you.  

    Hi Nilesh Hiwale,
    1. First thing is there is no need for any function module for difference between two dates
        See this.
    Data:
    days type i
    date1 type wa_draw-zdm_vld_to_dat
    date2 type sy-datum.
    days = date2 - date1.
    Write / days.
                          > (OR)
    2. write this condition in PAI module of your screen.
    At selection-screen.
    if date1 cn '1234567890'. or date2 cn '123456789'.
      write e000(Sabapdocu) with 'Enter YYYYMMDD Formate'.
    endif.
    Reward if it is useful,
    Mahi.

  • How to validate for a table name and field name parameters ?

    Dear techies,
                      Kindly help me in validating two parameters.
    1) table name (Date element = CDTABNAME ).
    2) field name  (Data Element = FIELDNAME ).
    I need to know the master table which can be used to validate both the fields..........
    regards,
    Prasannakumar

    You can validate it from table DD03L.
    <REMOVED BY MODERATOR>
    Thanks,
    Srinivas
    Edited by: Alvaro Tejada Galindo on Feb 26, 2008 2:02 PM

  • How to validate for a unique constraint?

    Hi all,
    Below is my stored procedure that updates the well name from the VIEW_TABLE1 into the WELL_HEADER_TABLE after comparing the apinumbers present in both the tables .
    I need to put a condition in which the apinumber should be checked and validated to be a unique value in my first comparision .Only the well names corresponding to the unique values of api_number should be updated .
    so can any one suggest me what chages do i need to implement in my code to perform this vaidation.pls help me in resolving this issue....
    Thanks and Regards
    Debashis
    [\n]
    CREATE or REPLACE PROCEDURE WORKFLOW.MERGE AS
    BEGIN
    merge into WORKFLOW.Well_Header_Table
    using WORKFLOW.VIEW_TABLE1
    on (SUBSTR(WORKFLOW.VIEW_TABLE1.API_NUMBER,0,10) = SUBSTR(WORKFLOW.Well_Header_Table.API_NUMBER,0,10) )
    WHEN MATCHED THEN UPDATE SET
    WORKFLOW.Well_Header_Table.WELL_NAME = WORKFLOW.VIEW_TABLE1.WELL_NAME
    WHEN NOT MATCHED THEN INSERT (WORKFLOW.Well_Header_Table.API_NUMBER,WORKFLOW.Well_Header_Table.WELL_NAME,WORKFLOW.Well_Header_Table.SECTION,WORKFLOW.Well_Header_Table.TOWNSHIP,WORKFLOW.Well_Header_Table.RANGE,WORKFLOW.Well_Header_Table.WELL_METER_NUMBER,WORKFLOW.Well_Header_Table.COUNTY_NAME,WORKFLOW.Well_Header_Table.OPERATOR_NAME,WORKFLOW.Well_Header_Table.PRODUCTION_FORMATION,WORKFLOW.Well_Header_Table.STATE_NAME,WORKFLOW.Well_Header_Table.FIELD_NAME,WORKFLOW.Well_Header_Table.WELL_FLAC_NUMBER,WORKFLOW.Well_Header_Table.WELL_LEASE_FLAC,WORKFLOW.Well_Header_Table.WELL_TYPE,WORKFLOW.Well_Header_Table.WELLBORE_PROFILE,WORKFLOW.Well_Header_Table.STATUS)
    values (WORKFLOW.VIEW_TABLE1.API_NUMBER,WORKFLOW.VIEW_TABLE1.WELL_NAME,WORKFLOW.VIEW_TABLE1.SECTION,WORKFLOW.VIEW_TABLE1.TOWNSHIP,WORKFLOW.VIEW_TABLE1.RANGE,WORKFLOW.VIEW_TABLE1.WELL_METER_NUMBER,WORKFLOW.VIEW_TABLE1.COUNTY_NAME,WORKFLOW.VIEW_TABLE1.OPERATOR_NAME,WORKFLOW.VIEW_TABLE1.PRODUCTION_FORMATION,WORKFLOW.VIEW_TABLE1.STATE_NAME,WORKFLOW.VIEW_TABLE1.FIELD_NAME,WORKFLOW.VIEW_TABLE1.WELL_FLAC_NUMBER,WORKFLOW.VIEW_TABLE1.WELL_LEASE_FLAC,WORKFLOW.VIEW_TABLE1.WELL_TYPE,WORKFLOW.VIEW_TABLE1.WELLBORE_PROFILE,null);
    merge into WORKFLOW.Well_Header_Table
    using WORKFLOW.HUG_MASTER_TABLE
    on (SUBSTR(WORKFLOW.HUG_MASTER_TABLE.PARENT1_ATTR_VALUE,0,10) = SUBSTR(WORKFLOW.Well_Header_Table.API_NUMBER,0,10) )
    WHEN MATCHED THEN UPDATE SET
    WORKFLOW.Well_Header_Table.WELL_NAME = WORKFLOW.HUG_MASTER_TABLE.PARENT2_ATTR_VALUE;
    END;
    [n]

    Hi Sam /Dan ,
    But in my requirement i need to compare the first 10 digits of the api number so i have made use of substring .No problem Dan seems to be prettybit angry on the way my code looks :-) .....
    Well this unique key is no more a problem .Its resolved as no duplicate values will be present in the apinumber.Now the only challenge infront of me is that i need to validate api number .In case the apiNumber of the view table is greater or less than 10 the well names needs to be updated and rows needs to be inserted into the well header table.
    I have done this part but something is going wrong and its not working .i mean even api number less than 10 are getting inserted and updated .so can u suggest me what changes i need to make
    [\n]
    on (SUBSTR(WORKFLOW.VIEW_TABLE1.API_NUMBER,0,10) = SUBSTR(WORKFLOW.Well_Header_Table.API_NUMBER,0,10) AND count(WORKFLOW.VIEW_TABLE1.API_NUMBER >= 10) )
    [n]
    Just check whether this condition will work...
    regards
    Debashis
    Message was edited by:
    debashis-in the wonderland

  • How to validate for-each path

    I have following for-each path:
    <?for-each:G_ACCT/LIST_G_INVOICENUM/G_INVOICENUM?>
    However, sometimes there is no data for child group LIST_G_INVOICENUM. I want to check if no child group, then change the path to
    <?for-each:G_ACCT?>
    Is there a way to check the path exist or not?
    Thanks.

    It is like one parent have lot of kids. Now they want to show parent name for each kid.
    <?for-each:G_ACCT?>
          display acct related infor here
          <?for-each:./LIST_G_INVOICENUM/G_INVOICENUM?>
             display invoice related info here
    You can display all parent and grand parents here
          <?end for-each?>
    <?end for-each?>
    End user wants the parent elements being repeated. If I do the second for-each inside the first for-each, parent element will not be repeated.
    will be repeated if you include the element with correct path
    +<?for-each:G_ACCT/LIST_G_INVOICENUM/G_INVOICENUM?>+
    However, sometimes there is no data for child group LIST_G_INVOICENUM. I want to check if no child group, then change the path to
    +<?for-each:G_ACCT?>+
    Is there a way to check the path exist or not?
    <?if:/G_ACCT/LIST_G_INVOICENUM/G_INVOICENUM?> -- will return true if the element exists else falsewhy do you want to change the path ? i guess to display at least parent info

  • 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

  • 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

  • How to get 2 decimal place of an amount?!

    Hi. How to get only 2 decimal place of the said amount?!
    I use to_char(v_rec.amount, '999,999,999.99') however it is outputting more than 2 decimal place. Thanks!!
    1,048.7800205
    Edited by: 989873 on Feb 26, 2013 6:33 PM

    989873 wrote:
    Hi. How to get only 2 decimal place of the said amount?!
    I use to_char(v_rec.amount, '999,999,999.99') however it is outputting more than 2 decimal place. Thanks!!
    1,048.7800205above should NOT contain any comma
    it works OK for me.
    How can we reproduce what you report?
      1* select to_char(1048.7800205, '999,999,999.99') from dual
    SQL> /
    TO_CHAR(1048.78
           1,048.78

  • General Settings Decimal Places

    Good Day
    Experts:
    I have a request to make the Decimal places, for my Quantity and Price columns in a Matrix on one of our custom screens, have the same number of places as the list in General Settings\Display Tab.
    For example, Prices has a setting of 4 Decimal Places.  How can I specify 4 Decimal Places in my datasource:
    MatlReqForm.DataSources.UserDataSources.Add("U_EaCost", SAPbouiCOM.BoDataType.dt_PRICE)
    Is there some kind of option with this command that enables specifying the decimal places?
    Is there a way to dynamically check where the value on the General Settings\Display Tab is set at
    and have the datasource take on that value when assigning it to a field?
    Please ask clarification questions if my exlpanation of needs if not clear enough...
    Thanks for the hlep,
    Ed

    Hi Ed,
    What version is this client running? It sounds like a bug. UserDataSources are automatically linked to the General Settings. If you set a datasource to the Price type then it should automatically show with the same number of decimal places as the Prices setting in General Settings. There is no way to set the number of decimal places on a datasource directly. I have tested this on a 2007A system and it works fine.
    Kind Regards,
    Owen

Maybe you are looking for