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

Similar Messages

  • 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.

  • 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...

  • 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

  • Issue with display of decimal places

    Hi,
    In our custom built components we are facing a strange issue with the display decimals  where the data type of an element is "QUAN - Quantity field, points to a unit field with format UNIT".
    If the element has a value of 3000.000 KG the value is displayed as 3000. Where as for an element which has a value 3000.123 KG the same is displayed as it is with the decimals. We tried to resolve the issue by using Text editor or Input field as read only but in vain. The display property in the context are set to default.
    If we change the element data type reference to "Dec - Counter or amount field with Comma and Sign" then all the values are displayed with the decimal places even if decimals are zero.
    As a result we are facing alignment issues for the various quantity related elements displayed on the screen.  To change the underlying data type of the element is a not a solution for us as the data type quan is required for conversion from one unit to another unit.
    Can someone please advise how we could resolve this issue.  We are on NW 7.0 + EHP4 + NW 7.01 SP4, kernel patch level 55 for 7.01
    Regards
    Rohit Chowdhary

    Jameel, Thanks for the answer but this is a not a solution for us. We have around 40-50 webdynpro components and with mutliple views referring to this data element / domain combination. More so the context are bound to database tables / structures . 
    I hope to get a reply from Thomas on possible solution for this. I am not sure if I can open an support ticket for this issue.
    Rohit Chowdhary

  • ToGB() decimal places

    Hi All,
    I have this piece of code which outputs the values to a html file.
    (get-mailboxdatabase)|foreach-object {
     $database= $_.name
     $accounts= (get-mailbox -database $_.name).count
     $size = (get-mailboxdatabase $_.name -status).databasesize.ToMB()/1024
         add-content $wfile "<tr>"
         add-content $wfile "<td align= 'center'>$database</td>"
         add-content $wfile "<td align= 'center'>$Accounts</td>"
         add-content $wfile "<td align= 'center'>$size</td>"   
    My issue I can't get the size to output to 2 decimal places it outputs 8 decimal places.
    If I use ToGB() instead of ToMB()/1024 I only get the whole number
    I have tried using {N0:02} but it doesn't help
    What am I doing wrong?
    TIA
    Andy

    How are you applying the format string?
    $size = '{0:N2}' -f ((get-mailboxdatabase $_.name -status).databasesize.ToMB()/1024)
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • 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

  • 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.

  • Decimal format to 2 decimal places ????

    Hello Everyone,
    I have created a web dynpro application which to display a report depending on the data given by the BAPI. But there is some issue with the numeric data returned by the BAPI.
    For ex - if the BAPI returns 5.00 the value is displayed in the report as 5.
    I want uniform decimal values till 2 decimal places. For example 5 shd come as 5.00, 2.1 shd come as 2.10 etc.
    I searched SDN abt this, and found many threads relating to this.
    I tried using decimal format, creating a simple dictinary type, but using all this what happens is the value basically changes to a string format, this implies that the value is displayed in the table as "left-aligned".
    Where- as we need the decimal numeric values to be right-aligned.
    Any thoughts how to achieve this.
    Please correct me if I have missed out on anything.
    Thanks,
    Samta

    Hi,
    From wat i understood.. u have a attribute coming from BAPI.. which you want to display with two decimal places,,
    In this case.. assuming it is coming with 2 decimal places from the backend..  create a value node.. inside the node which contains the output data. set its carinality to 1..1 .. create a value attribute of type big decimal in it.. or probably string.. if there is an issue in displaying BigDecimal directly..
    map this new attribute to the necessary column in the table..
    BigDecimal value = new BigDecimal("the actual value in string or long").setScale(2);
    assign this to the value attribute created..
    (If alignment is the problem.. set the column 's textview property halign to right.. and layout as block or paragraph.. )
    Regards
    Bharathwaj
    Message was edited by:
            Bharathwaj R

  • 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

Maybe you are looking for

  • TS3587 How do I find EndNote if it's not in the Mac App Store?

    I want to cite sources within my paper in Pages '09, but I am told that I need to have EndNote X2 installed.  I downloaded Pages from the Mac Store, and it looks as if EndNote X2 is only available with the iWork package.  Do I have any other options?

  • Duplicating clip within frame

    I'm not sure what you call this, but I've done it in the past and can't for the life of me remember how the heck I did it. I want to take one clip - 10 seconds in length and place it 4x across and 4x down so it looks like you're watching 16 clips - b

  • Configuration Comparison Tool

    Hello Folks, I remember some colleague once mentioned the possibility of someone having a tool to compare configurations. But I don't remember who it was. I have another request for comparing configurations from customer and I don't want to do that m

  • Fax the Maintenance order to the person responsible to work center

    Hello The business requirement is that the maintenance order should be faxed to the person responsible for the main work center used in the maintenance order. Please suggest any work around if possible. Thanks for your reply. Regards Santosh

  • I can't resize pictures with my selection tool anymore how can i reset it?

    i can't resize pictures with the selection tool anymore, i can only move them please help.