Decimal places in Smartforms

Hi All,
In smartforms, to control the number of decimal points in a field we can use the formatting option
&symbol(.N)&
for e.g.
The EKPO-MENGE field contains the value 1234.56. The Dictionary definition specifies 3 decimal places and an output length of 17.
&EKPO-MENGE(.1) -> 1,234.6
&EKPO-MENGE&(.4) -> 1,234.5600
&EKPO-MENGE&(.0) -> 1,235
Can we use a variable instead to giving the number directly ?
like
data length type i .
  length = '1'.
&EKPO-MENGE(.length) -> 1,234.6
Will this approach work.
Thanks,
Mandeep

Hi,
remove quotes.
length = 1.
try it now.

Similar Messages

  • Displaying Currency with three decimal places in smartform

    hi abap experts~~
    I'm wondering that how to convert numeric type to currency type.
    for example below.
    ex) 2346.856 --> 2.346,856
    please help me to solve the problem..
    Regards,
    Himanshu

    Hi Himanshu,
    This depends on the SU3 settings of ur system. GO to
    tcode SU3>Defaults->decimal notation..
    There change to ur desired type and relogin.
    The format will change...

  • Aligning Decimal places in smartforms

    Hi All,
    In My requirement i need to align the amount field values properly.
    Here the amount should be decimal justified and should appear one beneath the other.
    Let us consider one example :
    I have 3 fields which i am displaying:
    Current Output:
    1) Total Amount 1                 56.24 USD
    2) Total Amount 2                1000.00 USD
    3) Total Amount Due.            2000.00 USD
    Required Output:
    1) Total Amount 1                   56.24  USD
    2) Total Amount 2                1000.00 USD
    3) Total Amount Due.           2000.00 USD
    Regards,
    Bhanu.R

    Hi,
    As i said my earlier mail. move the currency values into character field and use the below statemnt to get the desired output.
    data : v1 type c LENGTH 20.
    WRITE / v1.
    shift v1 left deleting leading space.
    WRITE / v1.
    It should work for you...
    let me know if the problem still persisting
    regards,
    Sreenivasa sarma

  • Decimal place problem in smartforms..

    Hi All,
    I my smart forms i am displaying a quantity filed, but itz displaying with 3 decimal places. But i need to hide the decimal places. I try to use formating option &symbol(.N)&  but itz giving error while calling the smart forms.
    Plz help me...
    Regards,
    Pavan.M

    Hi,
    I've yet to find any SAP documentation or training material the recommends using the table's own header as the Smartforms work area.  I have however found it causing unusual problems in the generated function module.
    That said, I've tried reproducing your problem and have not been able to.  You could try defining a work area and seeing if that helps.
    Regards,
    Nick

  • Decimal places are not displayed in smartforms

    Hi,
      Iam having a quantity field which has length 13 and decimals 3. While debugging it has the value has decimal places but while displaying it does not have the decimal places. Only the whole number is displayed. Can anyone help how to rectify this one.Thanks...
    Thanks,
    Rose.

    Hi,
    The format of a quatity field will be based on the associated unit of measure.  Each unit of measure will have a number of decimal places (as defined in table T006 field DECAN) defined to match how the quantity is typically recorded (e.g. ST or 'each' has no decimal places as you could never have half and each).
    Regards,
    Nick

  • Rounding a quantity field to one decimal place. PLEASE URGENT

    I have a quantity field with three decimal places. I have to print this field with only one decimal place. This is in a smartform.
    suppose: qty = 45.678
    I want it to be printed as 45.7
    Thanks in advance.

    Hi Riki,
    I think you can use Function Module ROUND to round off the value...
    REPORT ZTEST_SHAIL4 .
    data: out type p decimals 1,
    inp type f.
    inp = '45.678'.
    CALL FUNCTION 'ROUND'
    EXPORTING
    DECIMALS =
    input = inp
    SIGN = ' '
    IMPORTING
    OUTPUT = out
    EXCEPTIONS
    INPUT_INVALID = 1
    OVERFLOW = 2
    TYPE_INVALID = 3
    OTHERS = 4
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Now use the variable 'out' to display the rounded off value...
    Regards,
    SP.

  • Quantity field to one decimal place. PLEASE URGENT

    I have a quantity field with three decimal places. I have to print this field with only one decimal place. This is in a smartform.
    suppose: qty = 45.678
    I want it to be printed as 45.7
    Thanks in advance.

    Create one more variable in Global definitions with only 1 decimal place.
    Assign value of qty to this new variable.
    SAP automatically takes care of the rounding.
    And then print this new variable rather than qty.
    You can write all these in a code block.

  • Smart Forms - Set decimal places in display formatting

    Hello,
    i have a variable (quantity 15 field with 3 decimal places) which i want to print via smartforms.
    sap help describes that you have to set (.<number>)
    for example: &field(.2)& to do that.
    this doesn t work at all.
    Does anybody know how you can do that?
    I would appreciate an answer, because that costs me already alot of time.
    thanks alot!
    Jasmin

    Hi Jasmin,
    We use this notation in a smartform to print weights and it works fine. Perhaps you should also mention the total numbers to display before the decimal?
    We have used: &BRGEW(8.0)&
    Regards,
    John.

  • JPY Currency - Decimal Notation in SMARTFORMS

    When outputing an amount field how do you ensure the correct number of decimal places is displayed in smartforms?

    Hi Terry,
    abap-coding is:
    data: amount type bseg-wrbtr,
          hval(20).
    write amount to hval currency bkpf-waers.
    regards Andreas

  • Issue with printing the decimal value in smartforms

    Hi experts,
    Here I am printing the net valve in to smartforms.The problem is, valve i want to print is 4505.600.But it is displaying as 45056.00.It is in OMR currency. This problem occurs only for this currency.i am picking the value from PO.
    I have used komv-kwert feild for display. Please give me the solution
    Regards,
    madhu

    Hi Madhu,
    I have faced similar problem in my Smartform with currency JPY with no decimal places at all.
    To resolve this you have to specify Reference Currency with the Currency type  under Global Definitions-->Currency/Quant.Fields. For example take your case :
    Fieldname               Reference Field     Data Type
    WA_FINAL-KWERT              W_WAERS           C CURR
    *Here W_WAERS should contain OMR
    *WA_FINAL-KWERT sould contain 45056.00 then your output will look like 4505.600
    Thanks & Regards,
    Rock.

  • Error while updating decimal places in general settings

    Hii All
             I have got an error while updating Decimal places in General Settings
    Cannot update while another user is connected to the company i have checked, there is no other user logged in, i could add other settings but the problem is only with Decimal Places
    Note : there are no postings yet, a fresh database for a new client
             what could be the possible reason
                                                                 thanks
                                                                         RIYAZ

    Hiii All
          As a forum rule, i have initially gone through with the existing threads and then i was force to post a thread,
              would be helpfull if there is any other way..
                                                Thanks
                                                         RIYAZ

  • Decimal places in report painter

    Hi experts.  I have a financial report written in report painter.  I want to show two decimal places on a single row.  The rest of the report is in whole dollars, but this one row is a percentage, so I want to show decimal places.  I know that you can format an entire column, but I can't figure out how to format a single row.  Can anyone help?
    Thanks
    Janet

    YES U CAN
    SAME AS ABOVE PROCEDURE
    BUT SELECT ROW INSTEAD OF COLUMN
    Edited by: Anil Kumar Potnuru on Feb 10, 2009 9:02 PM

  • Can not change the number of decimal places in the normalization of result

    dear all
        i want to see the proportion of some data, for example, the income of May is 300, and the total income is 1000, i need to display it like 33.33% . so i set the
    Calculate single values as normalization of result, and then it display 33.333%, i like to display only two number of decimal places, so i set the number of decimal places as 0.00, but i doesn't work, it still display three decimal numbers.
        maybe you say i can use the percentage function like %CT %GT %RT, but i need to allow external access to my query, so the i can not use those functions.
        can somebody helps me ? your advice is appreciated.

    hi,thanks for your advice, but that doesn't suit for my problem.
    before i set the normalization of result, i can change the decimal values. After that i cann't.
    In your thread, someone proposes use the T-code OY04. but this wouldn't help. As i change to other key figure, such as user quantity, when i set normalization of result, it still display 3 decimal values.
    i think the point maybe lie in the normalization of result. please advise... thanks...

  • Problems with decimal places and formatting

    Hi , we are having problems with an add on running on different localization companies. Decimal places separatd by "," differ from other localizations. We dont know if this is a SQL collation setting or somethng related to code or requirements to run add ons on different servers and languages.
    Any ideas??
    Thanks

    Hello
    Follow up with this thread:
    [Re: How to get the numeric value of DocTotal from UI API]
    Regards,
    J.

  • Decimal Places in Item Cost must be 6 characters while in Journal Entry 2.

    I have the following problem:
    Accounting needs to see and work with 2 decimal places, but the item cost is needed in 6 decimals.
    If I register a A/P Invoice and i go to the Journal Remark, the Journal Entry should be in 2 decimals. If i look for the Item Cost on the Wharehouse this cost should be in 6 decimals.
    Is there a way to handle Accounting in 2 units and Cost in 6 Units
    Thank You very much

    Hi Saul,
    The request appears illogical, how can the accountant work with 2 decimal places & the item valuation is held with 6? The stock account with 2 decimals will never match the stock audit report with 6 decimals.
    I'm afraid the SAP Business One core functionality does not cater for this need. There are no 'behind the scenes' journal entries. A JE is legally binding so you need to decide whether you wish to work with the most accurate calculations regarding item cost as possible (6 decimals) or accommodate the accountants & work with 2 decimals in the journals.
    You might want to take the nature of the stock into consideration, if there are huge quantities at small individual prices 6 decimals might be better, if you use mainly standard cost &/or have no major cost fluctuations when using MAP/FIFO, 2 decimals might be sufficient.
    All the best,
    Kerstin

Maybe you are looking for

  • Error in function call when passing timestamp as parameter

    Hi All, I have created a function in database "Calulate_Wegs" whcih takes two parameter one "number" and other is "timestamp". I am able to get the output from function when running in database. But when i tries to call the function in OBIEE as EVALU

  • Control user access in SOA Suite 11.1.1.2 Console

    Hi All, We recently migrated our application from SOA Suite 11.1.1.1 to 11.1.1.2 . In 1.1 we had an end user account assigned to the Monitor group which could access the middleware console and view composite flows but could not deploy/undeploy or ret

  • Pacman fails on incoming? [Fxd]

    Hi I have added incoming to pacman.conf....but get this when I pacman -Suy warning: failed to get filesize for incoming.db.tar.gz failed downloading incoming.db.tar.gz from ftp.archlinux.org: 550 incoming.db.tar.gz: No such file or directory failed t

  • AP 1252 in autonomous mode not sending framed-ip-address

    I was attempting to use the Websense RADIUS Agent to transparently map wireless users in it's database. This is done by passing the RADIUS accounting packets through the websense server where Websense can read them and map the username and password.

  • Product Hierarchy from SRM 4.0 to SRM 5.0

    Hello Gurus, We are in SRM 4.0. We may move to SRM 5.0. I have some ZPRODUCTHIERARCHY in srm 4.0. How can I transfered all the  ZPRODUCTHIERARCHY to SRM 5.0 . is there  any standard way to do it. Any link or clue is appreciated.Scenario Standalone Th