Truncating a number with decimals

I have created a field {@years} with the value -10 which was used as part of a formula. This part has worked fine. I also wanted to use {@years} as part of the report heading where -10 represented a time period. However, the number came up as -10.00. I used the formula Truncate(Abs({@years})) but only the Abs part seemed to work. The number came up as 10.00 instead of 10.
Is there a problem with the formula I'm using or with Crystal Reports X or something else?
Regards
Jorge

You said:
"I tried to use Abs within your formula ToText(Abs({@years},0,"")) but it says that too many arguments have been given to the function."
You've almost got it.  Check that your parens are correct.
I haven't run this on my machine yet, but I see that
the Abs function is not ended after @years...you have } but not
) after that.  See what I mean ?
The Panda
Here you go, I just ran it. First, here is the Abs function:
abs(-2.0)
Then I place the abs function inside the ToText function:
ToText(abs(-2.0), 0, "")
Notice how (-2.0 is closed off with a paren -  ")".
Yours is not closed off and the compiler thinks you are throwing (...giving) too many parameters to the Abs function (...which you are   :).
The Panda

Similar Messages

  • KP06 cannot enter number with decimals in fxd. consumption

    Hi!
    When using transaction
    KP06 Change Cost Element/Activity Input Planning with
    Planner Profile SAP102,
    layout 1-102 Std.layout Activity input ActInd/ActDep
    we cannot enter number with decimals in field Fxd. consumption
    Field name MEF
    Data element MEFXXX
    When we enter number with decimals like 12,45 it gets rounded in 13.
    I have tried to change number format of this collumn from Not defined
    to 0,00 but this is not helping. The rounding still takes place.
    My question is where can I assign the unit (of measurement) for posting of quantities.
    Regards,
    Marina

    The UOM is assosiated with Activity Type, and has a certain number of decimal points in the definition of UOM.  The other place to influence decimal points in the proper planning layout (column settings).

  • Number with No decimals

    Hi:
    In my formula one number fields returns with decimals and comma, and I want to know how to get only the absoulte value. Your ideas appreciated.
    Regards,
    Dima
    Ex: 2,829.00
    I need 2829.

    Dak,
    That's a formatting issue. Just right click the field and choose Format Field.... Then on the number tab choose the -1123 format style.
    HTH,
    Jason

  • ALV column with variable number of decimals to be displayed

    Hi,
    I've an ALV where I need to display a numeric column with a variable number of decimal row-by-row, from 0 (no decimals) to 4.
    I've declared the numeric field as TYPE P DECIMALS 4.
    I've tried with DECMLFIELD in ALV catalog, and this works for 1 to n decimals, but when  I leave the field indicated in DECMLFIELD equal to 0, ALV shows the default number of decimals of the field (4 in that case).
    Any help will be very appreciated.
    Thanks.
    Jordi

    No, I didn't try EDIT_MASK.
    How should I use it to format output to display decimals or not depending on the row?
    I have 2 kinds of values, all stored in a TYPE P DECIMALS 4: Those that really are an integer (decimals should not be displayed for that ones) and the values that really have 4 decimals (which should be displayed with decimals in ALV).
    Example:
    13,0000 should be displayed as 13
    0,4567 should be displayed as 0,4567
    With EDIT_MASK could I do that?
    Thank you very much.

  • KONV-KAWRT number of decimals

    The condition base value of a condition is always stored with 2 decimals in KONV-KAWRT, regardless of the actual number of decimals which depends on the unit in KONV-KMEIN. For example, 500 G (gram) is stored as 5000.00 G because G really has 3 decimals.
    When viewing a condition in VA03 or VF03, SAP will show the condition base value with the right number of decimals.
    My question: how can I determine the actual number of decimals myself? I thought it might be in T006-ANDEC, but that's not it.

    Dear Filip,
    Try the following simple syntax:
    DATA: FLD(8) TYPE P DECIMALS 2,
    DEC TYPE P.
    DESCRIBE FIELD FLD DECIMALS DEC.
    DESCRIBE FIELD KONV-KAWRT DECIMALS DEC.
    Regards,
    Pranav.

  • WithHold Tax with Decimals

    Hi,
    Is it possible to calculate the Withold Tax with value in Decimal places? i.e., If the base amount is 11111 and the withold tax % is 3 then the WT amount is 333.33 wherein SAP calculates it as 333 only. We had recently implemented B1 in Thailand and the requirement is that, the withold tax should be calculated with exact decimals and not rounded off.
    When I checked the Withold tax definition, there are only 2 options for rounding off, either to a lower amount or to a higher amount and there's no option to keep it as it is.
    Anybody has any solution?
    sriram

    Hi Adele,
    It has nothing to do with the decimal places.
    In the withold tax configuration, there are 2 types of rounding off methods available
    "commercial values" or "truncated AU" and you need to select any one of them.  commercial values setting, makes it to the next higher numeric and truncated au rounds it off to a lower value.
    There is a possibility that, at the time of carrying out the A/R or A/P transaction, the calculation can be done manually and we can enter the amount with decimals and SAP takes it as it is.  But when calculates it on it's own, then it doesn't.  That's why I wanted to know, whether anybody else is having this problem and whether they have any solution in place?
    sriram

  • Using Modulus (%) arithmetic operator with decimals

    When trying to use the arithmetic operator modulus with decimals there seem to be some errors in the results. Is there a restriction on the number/value of decimals that can be used with this operator? Am I perhaps just using it incorrectly?
    example ...
    Double valA= new Double("12.4");
    Double valB = new Double("1236");
    double result = valB.floatValue() % valA.floatValue();
    System.out.println("valB : " + valB );
    System.out.println("valA: " + valA);
    System.out.println("result : " + result);
    produces :
    valB : 1236.0
    valA : 12.4
    result : 8.40003776550293
    But :
    Double valA= new Double("12.5");
    Double valB = new Double("1236");
    double result = valB.floatValue() % valA.floatValue();
    System.out.println("valB : " + valB );
    System.out.println("valA: " + valA);
    System.out.println("result : " + result);
    produces :
    valB : 1236.0
    valA : 12.5
    result : 11.0

    Floating point arithmetic in general is not exact. The problem is that you are expecting exact results.
    In the second example where you use 12.5 and 1236.0 is just so happens that both of those numbers can be represented exactly, so you do get an exact result.

  • OLE: export quantity with decimals according to UoM

    Dear Guru,
    I encounter a problem when exporting data from Itab to Excel using OLE.
    In the itab, there are many Quantity fields (with UoM). When I export to Excel, I want the number of decimals of each quantity field must comply with UoM (for ex: PC with 0 decimal, Kgs with 3 decimals).
    I try to write the qty to text, it's ok but I also need the exporting qty is formatted as a number in Excel so user can do a sum.
    The solution for this problem seems complicated. I have to write qty to text, convert text to number...But for a large number of data, it is really slow.
    Is there anybody encounter the same problem? Please advice the solution.
    Thanks.

    > The solution for this problem seems complicated. I have to write qty to text, convert text to number...But for a large number of data, it is really slow.
    You make confusion about the real problem. Converting the quantity is not time consuming (or your program is really badly programmed ).
    What is time consuming is making many calls to OLE.
    To avoid that issue, SAP uses the Data Provider and the Desktop Office Integration (DOI). The whole data is sent to the frontend once (more or less), and sends only a few instructions to the frontend to process this data. I don't really know the exact process, but it's really, really  much faster.
    DOI can be programmed directly (there are SAP demo programs which show how it works, search forum), and there is an upper abstraction if you only need to paste data, set colors, that is indicated by Pedro.

  • Number of decimals in an application

    Hi all,
    I need to change the number of decimals in some applications, and have been reading some threads about it. I have found some different explanations, and I would like to make sure of how to do it.
    1) What do the numbers in the parameter SIGNED_DATA_FORMAT mean? For example 25,10 means:
          a) we have 25 digits to the left of the comma and 10 to the right, like 1234567891234567891234567.1234567890
          b) we have 25 digits in total and 10 for the decimals, like 123456789123456.1234567890
    2) If the correct answer to the previous question is "b" (I think that is the correct one), 25 is the maximum amount of numbers we can have? Could we set 50,15?
    3) what is the correct way of inputting the value in the parameter (in BPC Web Admin Application parameters)? (I mean, like 25,10 or (25,10) or "25,10" or 25.10 or.....). We had a problem some time ago with this ( Full Optimize Problem ).
    4) so, to make the modification, we should first set the parameter in an application, then make a copy of the application (the new one will have the number of decimals changed), then delete the first application, right?
    Thank you very much,
    Rafael

    Hi Sorin,
    thank you very much for such a clear answer.
    Regarding the question of how to give the parameter value, we did input once 25,10 and ended up in an error upon "modify application" execution. We actually had to delete that entry (Full Optimize Problem) because BPC seemed to not like the comma at all in the tblDefaults table where that value is written (by the way, we did delete it through web admin as you suggested, not directly in the table, -almost- never delete directly from the table
    If just a plain 25,10 is the appropriate value, do we need to delete that value from Web Admin once the application has been copied and processed? Should we rather not have any problem at all by inserting 25,10 in Web Admin?
    Thank you,
    Rafael

  • Upload Quantities in BoM with decimals

    Hi,
    I cannot achieve to upload quantities with decimals for components in a BoM with the DTW. After the upload the system rounds the number to a whole number.
    Thank you.

    Hi Oscar...
    Check with this link
    http://scn.sap.com/thread/3146841
    Regards
    Kennedy

  • SNP purchase requisitions quantities generated with Decimals

    HI Gurus,
    When we run the location heuristics in SNP the purchase requisitions are (Distribution Receipts Planned ) are created without decimals.But when these are published to ECC the  purchase requisitions are generated with decimals.For Example the SNP PR value is 15 and the ECC Pr is 15.200.How can i restrict this because i want the same quantity which is generated by SNP heuristics .Are there any settings in UOM(Unit of measure).I checked in the planning area for the key figure everthing is fine.
    What are the settings to be made.
    Dhanunjay.

    The SNP might be generating 15.2 based on your lot sizing settings.
    Most probably the reason you see 15( with no decimals) in SNP Planning book is because for your keyfigure, you have 0 decimals.
    Go to Design mode for the plannning book, select the keyfigure and change the decimal places from 0 to 3(or any higher number)
    Now you should be able to see 15.2 as stated in your example even in the plannning book
    One other way to check would be in the product view(RRP3) or as someone already suggested( RRP2)
    Thanks
    Kumar

  • How to trace purchase order number with respect to Purchase requestion numb

    Hi friends,
    Can u please help me how to Trace purchase order number with respect to purchase Requetuion  number. Is there any standard report  available in R/3

    Hi Vamsi,
    Thats what!!!
    Goto SE16 - EBAN - Give PR number in the iput screen.
    In the output screen you will have to do field selection from Menu - Settings - formatlist - choose fields.
    There you choose Purchase Order.
    So the output will display for you POs for the PR that you entered.
    Regards,
    Vishal

  • My 3rd iphone. 3GS I did not buy from an apple store, how do I register this serial number with my apple account? it is already sync to it and will preform every function except email to my home computer. It says apple ID disabled

    My 3rd iphone is a 3GS. I did not buy this one from the apple store, how do I register this serial number with my apple account? it is already sync'd and it and will preform every function except email to my home computer. It says apple ID disabled, also will not update my apps, same promt apple id disabled.
    anyone know where I can go to register this phone? Thanks

    https://register.apple.com

  • How can I create accurate decimal dimensions when creating a new document or using the art board in Illustrator CS6? When I type in a number with a decimal, it automatically rounds the number up.

    How can I create accurate decimal dimensions when creating a new document or using the art board in Illustrator CS6? When I type in a number with a decimal, it automatically rounds the number up.

    For my part you are welcome, sdowers.
    Unfortunately, the uncertainty arising from the rounding has been up several times here in this forum.
    I just came to remember a warning that needs to be given:
    The rounding of the representation of a numerical value may be harmless in itself, but if you use it for any operation that changes the value, such as multiplication or whatever, things will go wrong because the operation will be made on the basis of the rounded value instead of the true value. So, as in your first case in post #2, 39.625 rounded to 39.63 will become 79.26 instead of 79.25.

  • Error in query " Value '' of characteristic  is not a number with  spaces "

    Hi Gurus,
    I am facing an error in a query with the description:
    Error
    Value '' of characteristic  is not a number with  spaces
    System error in program SAPLRRK0 and form RSRDR;SRRK0F30-01-
    Description
    This error is occuring in Production system only, the report is running fine in Development environment.
    The error is also visible when I execute it in RSRT, I am not able to find the cause of error through RSRT.
    Can anyone please help me with the possible solutions.
    Thanks & Regards,
    Shreyas

    Hi Juergen,
    thanks for the input, I tried to run the report after loading the master data but still there was no improvement.
    I am not sure why this kind of problem is rising, some of the similar reports on same infoprovider are running fine.
    Please let me know if you know anything about the cause of error.
    Thanks & Regards,
    Shreyas

Maybe you are looking for

  • Can you add a task or reminder to calendar from reminders app?

    i am trying to add a task from the reminders app on my iphone to the calendar app.  i haven't figured out how to do this so far.  is it possible?

  • Is CS4 compatible with Dell Computers and GeForce Go 7400 video cards?

    I have been told by this forum I needed to uninstall and re-install CS4 because Encore and the Media Encoder do not work even after the fixes and updates. I have two Dell computers with Nvidia video cards. Someone told me CS4 and Encore will not work

  • Progress Bar component

    I have used the UI progress bar component in Flash CS3 AS2. For some reason the progress bar appears to work fine, when it gets to 100% it loads the movie about 3/4 way down the timeline. Its almost like the movie itself is playing behind the progres

  • Maps - picks up my old address as current location

    Opened maps in Mavericks for the first time and it asked me if it could use my current loaction which I agreed to. It shows my current location as my previous address which I left about a month ago. I'm not sure where it is picking this up from. I ch

  • How to call PBO explicitly

    Hi all, I have copied mmbe transaction to ZMMBE.I add two buttons on screen 300.When i execute it works fine.but when i go back and then execute buttons got disappear.when i debug it doesnt go to PBO.is there any way to explicitly call PBO. Regards L