@ Decimal Places in Packed Type Variable

How to check if a packed type variable has decimal placed or not?

Hi,
Try to use the statement DESCRIBE. See the help to understand the usage. The syntax is:
DESCRIBE FIELD <field> DECIMALS <dec>.
This will show the number of decimals place.
Then, you can use a condition to test.
Regards
RP

Similar Messages

  • Variable Decimal of Packed Type Variable: is this possible?

    Hi Experts,
    I'd like to ask if we can have a packed variable with the decimal declaration as variable also, like:
    DATA p_pack_var TYPE p DECIMALS g_var_decimal.
    The scenario is there is a field qamv-toleranzun which I want to be displayed like in the output in QP03. The display in QP03 has variable decimals according to the value in qamv-masseinhsw.
    So for example: qamv-masseinhsw = 3 and qamv-toleranzun is a floating type value, the output in QP03 is format with 3 decimals.
    Or if this is not possible, are there any approach to pass the value of the floating point variable to a decimal type variable with an indefinite decimal places.
    Please Help. Points will be rewarded for valid answers.
    Thanks!

    Is this what you want?
    searchComponents( Class a_class) {
    // browse components
    if (a_class.isInstance(component)) {
    // do something
    }

  • Decimal places: Using Textsybols as variable

    Hi Freinds,
    is it possible to use variable as decimal indicator anf if yes please how.
    &symbol(E.2)& = two decimal
    my intension:
    &symbol(E.2)& = to replace 2 with variable e. g. &QAMV-STELLEN&
    Thanks,
    Blacky

    Hi ,
    Please create a subroutine pool to get the desired output. please see the documentation of text symbols below:
    Text Symbols
    All symbols that do not correspond to one of the three types of symbols described above are text symbols. You define the value of a text symbol yourself in the text module.
    There are two ways of doing this:
    In the text editor, choose Include ® Symbols ® Text.
    All the text symbols contained either in the current text or in a form assigned to the text are displayed. You can assign a value of up to 80 characters to a text symbol. Enter this value in the same form as it is to appear in the output.
    The effect of assigning a value is temporary, since the values assigned are not stored with the text but are lost as soon as you leave the editor. You use this kind of value assignment if you had a ready-made text containing symbols that you want to print with specific values in place of the symbols, and you want to do this only once without storing the u2018changedu2019 text.
    In the text, use the control command DEFINE.
    Since control commands are stored with the text module, any value you assign in this way is preserved when you save the text. You can change the value assigned to a symbol in the text at any time simply by issuing another DEFINE command.
    Remember always to use the ' (inverted comma) character to delimit a value. The maximal length for these values is also 80 characters.
    Regards,
    Chandra kavali

  • About packed type variable declaration

    Hello friends
                      I need a small info related to pack numbers.
    i'm declaring these things in routine creation .
    ok . suppose if i declared
    data: A type p decimals 8 value '1.1245678'.
    its taking tht value as 0.11245678. in this format .. i'm unable to get  this thing .. please help me out .

    try a comma instead of a dot.

  • Decimal places for condition type .

    Dear sir,
    I have a condition type like JCV1,ZADC  & same are included in purchase order.These are the  manual  condition type.
    I  have created a purchase order & on condition tab page in once i enter 10 % for jcv1 condtion type ,system is showing that 10.000 .So i want that system should display 10.00  so please guide me how solve this .

    Hi,
    Check your decimal settings in your user id transaction SU01
    Thanks
    Diwakar

  • How 2 extract 2 decimal places from a float variable

    Hiya,
    I have a float variable say x with a value 10.56879, how do i extract 56 without rounding it up. I want to store 56 in an integer variable after extracting it from float.
    Cheers
    Deepak

    This works when f is positive,
    float f = 10.56879f;
    int i = Math.round((float)Math.floor(((f - (float)Math.floor(f))*100.0f)));
    System.out.println(i);

  • 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 for formula variable

    Hello,
    I have created a formula variable of type manual entry and type number. I'm multiplying it to an amount. The problem is that the user is unable to enter a decimal place value.
    eg:
    cannot enter 0.5 or 0.05. the query regards it as 5 (converts 0.5 or 0.05 to 5)
    when i enter 5.1, it converts it to 51
    when i enter 51.11, it converts it to 5.111
    when i enter 51.111, it keeps it the same and does not change it.
    Is there a setting that i need to change in the query or the fomula variable? I need the variable to accept decimal values with out changing the decimal places.
    Regards,
    Sameer

    This was an issue with the number format setting for the user.
    His setting was 1.000.000,00 and he was trying to enter it in this format: 1,000,000.00
    Hence I noticed the fictional change in decinal places.
    Should have caught it sooner.
    Regards,
    Sameer

  • Formula Variable decimal Places

    Dear All,
    Is there any way i can remove decimal places from Formula Variable / Type Number / Ready for Input ?
    Plz help ASAP.
    Regards,
    SS

    Is that you don't want the user to enter any decimal values for this variable???
    Then best way is to create a Formula Key Figure of type Customer Exit. then you can writ the code in I_STEP =3 whoich will do the validation and throw an error message in case of deciaml values.

  • Problem with packed data type variable?

    Hi all,
    I have a problem while doing calculations with packed data type variables . As they are saving in the format '0,00'. so unable to do calulations because of ',' . 
    To convert these fields into str and replacing ',' with '.' is very time consuming because i have many packed data type variables.
    Can you please provide any other alternative for over coming this problem? Is there any option while defining these variables?
    Thanks,
    Vamshi.

    Hi VAMSHI KRISHNA,
    First check out SU01 Tcode (if u don't have permission then u can ask BASIS to do it)
    Enter User Name
    Execute
    Goto Defaults Tab
    Check Out Decimal Notation here... set it 1,234,567.89
    SAVE it
    Log Off once and again login with the same user id and check the result...
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7

  • Decimal places in formula variable

    Hi all,
    I have a formula variable, for an integer (num of days), ready for input, that by default has 5 decimal places in the selection screen (g.e. 5,00000). It is possible, and if so, where can I change the number of decimal places to show in that variable?
    Please advice

    In my case the formula variable is properly displaying the value without any extra decimal places.
    I have done the following settings.
    Variable Entry - Mandatory
    Ready for Input
    Dimension indicator - Number
    Default value - 95.
    When i execute the report i can see just 95.
    Don't know why it is showing extra decimal places?

  • Formatting Numeric Only with Variable Decimal Places

    Acrobat Pro 9, Windows XP
    I'm creating a form that has a number of text box form fields that are to be numeric only per the form requestor. However, for any given field of this type the number of decimal places that can be entered can vary from 0-3 and the requestor does NOT want any unnecessary decimals to appear in the final output (e.g., a "1.2" entry should not appear as "1.200"). The standard number formatting properties always show all the decimal places so I know it's not that route. No calculations will be performed with any of these entries -- the form requestor merely is entering data and then printing it out so that it's legible for the end-user.
    I know that the following line of JavaScript in the Custom Keystroke property limits the entry to numeric only, but how should I tweak the syntax to allow a decimal entry:
         event.rc = (!event.change || /^\d$/.test(event.change))
    I probably also need a script to format for decimal places, but I don't know where to look in the JavaScript for Acrobat API Reference or in the MDN JavaScript Reference.
    Thanks in advance for any assistance.

    Good question. To keep it simple (because there are about 300 form fields in this document), if they choose to add extra decimal zeros, then who am I to argue with their entry. So in your example for a given form field, if they enter "1.200" then I expect that they want "1.200" to display.
    OK, but earlier you said:
    "However, for any given field of this type the number of decimal places that can be entered can vary from 0-3 and the requestor does NOT want any unnecessary decimals to appear in the final output (e.g., a "1.2" entry should not appear as "1.200")."
    This seems inconsistent. Can you clarify? The point is the code and where it's placed depends on this. It could be implemented either as a custom Validate or Format script, in addition to a Keystroke script.

  • Storeing values in floate data type upto two decimal places

    Hi
    I want a float type field in my table but want to store value up to two decimal places.
    so what syntax i need to follow plz suggest.
    thanks

    it is not possible to store with Number datatype. if you are using the data to sho report, then change its format (like 45 to 45.00). if you want to store 45.00 in database, then you have to modify the datatype for that column. for this follow the following path
    1. Add a column of datatype Varchar2.
    2. Copy all the value of your number field to it.
    3. Drop the old column.
    4. However make sure that if you have used that column somewhare in arithmetic calculation, the modify it and use to_number function to do arithmetic opration.

  • Changing number of decimal places for Unit of Measure

    Hi All,
    I have a requirement to convert a quantity in one unit of measure to another (custom) unit of measure.
    The issue is that the custom unit of measure has 4 decimal places (customer requirement). I found function module MD_CONVERT_MATERIAL_UNIT which does the trick for regular, 3 decimal places, UoM's. It won't output 4 decimal places since the output data type is EKPO-MENGE, which has 3 decimal places.
    Does anyone have experience with trying to convert material's UoMs into 4 or more decimal places?
    Thanks!

    <b>round_f_to_15_decs</b>  round variable of type f to 15 decimals
    Sometimes type F (float) is used to represent exact data (Amounts, Quantities):
    if values are to big to be represented as Packed (> 31 decimals)
    to significally improve performance of calculations, e.g. in statistical reports
    G_DECIMAL_PLACES_GET
    REPORT Z_ROUNDING .
    DATA: float TYPE f,
          amount TYPE p DECIMALS 2,
          correctamount TYPE p DECIMALS 2,
          chars(5) TYPE c value '1.005'.
    CLASS cl_abap_math DEFINITION LOAD.
    correctamount = chars.
    WRITE: / 'Exactly:', chars,
           / 'Correct Amount:',  correctamount.
    float = chars.
    amount = float.
    skip 2.
    WRITE: / '==== Usual Processing:',
           / 'Float:', float,
           / 'Decimals 3:', float DECIMALS 3,
           / 'Decimals 2:', float DECIMALS 2,
           / 'Amount:',  amount.
    float = cl_abap_math=>round_f_to_15_decs( float ).
    amount = float.
    skip 2.
    WRITE: / '==== Correct Processing:',
           / 'Float:', float,
           / 'Decimals 3:', float DECIMALS 3,
           / 'Decimals 2:', float DECIMALS 2,
           / 'Amount:',  amount.

  • What is the use P type variable in ABAP?

    ex:
    data <variable name > type p decimals 2.
    here what is the use of declaring it to p type.
    what is the difference between p type and float type.

    Hi,
    using packed variable we can decide the length of number and  number of decimals we want in o/p which is not possible with other types
    Packed numbers - type P
    Type P data allows digits after the decimal point. The number of decimal places is generic, and is determined in the program. The value range of type P data depends on its size and the number of digits after the decimal point. The valid size can be any value from 1 to 16 bytes. Two decimal digits are packed into one byte, while the last byte contains one digit and the sign. Up to 14 digits are allowed after the decimal point. The initial value is zero. When working with type P data, it is a good idea to set the program attribute Fixed point arithmetic.Otherwise, type P numbers are treated as integers.
    You can use type P data for such values as distances, weights, amounts of money, and so on.
    Floating point numbers - type F
    The value range of type F numbers is 1x10*-307 to 1x10*308 for positive and negative numbers, including 0 (zero). The accuracy range is approximately 15 decimals, depending on the floating point arithmetic of the hardware platform. Since type F data is internally converted to a binary system, rounding errors can occur. Although the ABAP processor tries to minimize these effects, you should not use type F data if high accuracy is required. Instead, use type P data.
    You use type F fields when you need to cope with very large value ranges and rounding errors are not critical.
    Using I and F fields for calculations is quicker than using P fields. Arithmetic operations using I and F fields are very similar to the actual machine code operations, while P fields require more support from the software. Nevertheless, you have to use type P data to meet accuracy or value range requirements.

Maybe you are looking for

  • Report using table mseg

    Well i m makin a report on material consumption which gets the opening stock, purchase, consumption & closing stock of all the materials in a particular month. i m getting mblnr from mkpf table & then go to mseg table. but it is taking a lot of time.

  • HP Officejet 7000 Wide Format printing black AND white lines on photos

    I am having some serious problems with my officejet 7000. I have contacted HP and have went through all the steps required (although all they could do is send me a new head and cartridges to help remedy the problem). This however has failed. Let me g

  • Jump Query in Business Object ?

    Hello friends, I am currently working on a BEX report which has the Jump query feature ( using tcode RSBBS). There is a requirement now that all Bex queries must feed Business Object and we need to convert all the report in Crystal report or Webi Rep

  • Pair iPhone with alpine car radio

    My iPhone 5 won't pair with the Alpine radio in my car. The iPhone 4 did it with no problems.

  • Forums in Muse?

    Trying to create a forum in Muse but so far it's impossible.  This page Business Catalyst Help | Add a forum says to "Select Modules > Forums, and click Details." yet never tells you where "Modules" is.  When you try to look up Modules you get this p