ROUND OFF IN CURRENCY FIELD

Hi,
In my report I am displaying the currency field NETWR in ALV Report.
Now, the requirement is as such-
For eg- If the value of NETWR field is 57,441.50 then I want to round it off to display only 57(assuming that all values in thousands) i.e 57,441.50 would be considered as 57,000 only.
I think there is some functional module to solve this problem.
Can somebody help me regarding the same,points will be rewarded.

Hi friend
Try this.
Check this sample:
DATA: WA_INPUT TYPE P DECIMALS 8,
WA_OUTPUT TYPE P DECIMALS 2.
WA_INPUT = '5678.65800341'.
CALL FUNCTION 'ROUND'
EXPORTING
INPUT = WA_INPUT
IMPORTING
OUTPUT = WA_OUTPUT
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.
WRITE: WA_OUTPUT.
OR this,
DATA: I TYPE I,
P TYPE P DECIMALS 2 Value '3.5'.
I = P.
Reward if helpfull.

Similar Messages

  • Round off at the field catalog with no decimals

    Hi,
    I'm using an ALV grid to display the data. The field catalog is defined as follows.
    fieldcatalog  TYPE slis_t_fieldcat_alv
    Is it possible to round off at the field catalog itself. For example, i have qty as 100.696 in the itab, i want to make it 101.
    What can be used to do this at the fieldcatalog stage?
    Thanks
    Keshi

    Keshini,
      Why con't you round of the value while moving into itab.
    Ex :
             LOOP at Itab.
               round ( itab-field ).
             move itab-field  to i_final-field.
             endloop.
    Ex :
      DATA pack TYPE p VALUE '123.456'
                            DECIMALS 3.
    WRITE pack DECIMALS 2.     123,46
    WRITE: / pack ROUND -2,        12.345,600      
               / pack ROUND -1,          1.234,560
             / pack ROUND 1,             12,346
             / pack ROUND 2.               1,235
    ROUND <r>    -
    Type P fields are multiplied by 10**(-r) and then rounded.
    Pls. Reward if useful

  • Rounding off Currency field

    Hi,
    I have to round off a currency field. Can some one provide the syntax for this.
    I have tried: WRITE lv1 ROUND 2.
    But I dont want to display it in output, I have to put round off value into another field.
    Regards,
    Pankaj.

    Hi,
    Check the below code
    PARAMETER : p_cur TYPE wrbtr.
    DATA : w_currency(10) TYPE c.
    WRITE p_cur ROUND 2 TO w_currency.
    w_currency = w_currency * 100.
    WRITE / w_currency.
    W_currency will have the round off value....

  • Rounding off currency value

    Hi all,
           Is there a function module to round off the currency value to nearest 0.05 , ie. if the currency value is 10.63, it should be rounded off to 10.65 and when it is 10.68, it should be rounded off to 10.70?
          If yes, could you please let me know?
          Any help in this regard is appreciated.
    Regards,
    Partha.

    hi,
    try this out.here is the sample program.
    pl look into my modified program,
    i am assuming your requirement is like
    if the last digit in your value is < 5. it should be rounded to 5.
      like 10.23 should come to 10.25
    & if the last character value is > 5 , it should be rounded to next value with 0.
        10.67 should be 10.70
        10.98 should be 11.00.
    with this assumption, i developed this small code. let me know, if i am wrong.
    regards
    srikanth
    DATA : V_CURR TYPE VBAK-NETWR,
           V_CHAR(10) TYPE C.
    V_CURR = '10.67'.
    WRITE  V_CURR TO V_CHAR.
    CONDENSE V_CHAR NO-GAPS.
    DATA : V_STRLEN TYPE I.
    BREAK-POINT.
    V_STRLEN = STRLEN( V_CHAR ).
    IF V_STRLEN <> 0 .
      V_STRLEN = V_STRLEN - 1.
      IF V_CHAR+V_STRLEN < '5'.
        V_CHAR+V_STRLEN = '5'.
        V_CURR = V_CHAR.
      ELSE.
        IF V_CHAR+V_STRLEN = '6'.
          V_CURR = V_CURR + '0.04'.
        ELSEIF V_CHAR+V_STRLEN = '7'.
          V_CURR = V_CURR + '0.03'.
        ELSEIF V_CHAR+V_STRLEN = '8'.
          V_CURR = V_CURR + '0.02'.
        ELSEIF V_CHAR+V_STRLEN = '9'.
          V_CURR = V_CURR + '0.01'.
        ENDIF.
      ENDIF.
    ENDIF.
    write :/ v_curr,
             v_char.
    added modified code.
    Message was edited by: Srikanth Kidambi

  • Rounding-off Currency fields.

    Hi,
    Can someone tell me how to round-off value of currency field.
    If fraction <= 0.49 it should be rounded-off to 0.00
    If fraction >= 0.50 it should be rounded-off to 1.00

    Hi, you have the Function Module ROUND too,
    here a litle example ( the paremeter sign = 'X' set how the number will be rounded )
    DATA l_input TYPE p DECIMALS 5.
    break-point.
    l_input = '0.499'.
    CALL FUNCTION 'ROUND'
      EXPORTING
        decimals      = 0
        input         = l_input
        sign          = 'X'
      IMPORTING
        output        = l_input
      EXCEPTIONS
        input_invalid = 1
        overflow      = 2
        type_invalid  = 3
        OTHERS        = 4.
    l_input = '0.500'.
    CALL FUNCTION 'ROUND'
      EXPORTING
        decimals      = 0
        input         = l_input
        sign          = 'X'
      IMPORTING
        output        = l_input
      EXCEPTIONS
        input_invalid = 1
        overflow      = 2
        type_invalid  = 3
        OTHERS        = 4.
    Saludos
    Daniel

  • Small Differences Rounding Off in case of Payments in Foreign Currency

    Hi all
    I have a scenario wherein I want to round off the Foreign Exchange amount to the nearest Rupee. I.e when I am making a payment in Foreign currency, the amount in local currency appears upto 2 decimal places. However, I  want the same to be rounded off to the nearest rupee.
    E.g I am making a payment of USD 111 @42.1277 which comes to 4676.17 in the local currency INR. Now I want the system to round off the amount to 4676 at the time of the payment transaction itself. Is this possible through the RDF key in Forex Automatic Postings? If yes, then I already have an account assigned there but the system does not round off the amount.
    Help would be highly appreciated.
    Cheers
    Hrishi

    i'm not aware of that functionality.
    But you can always add some logic into your fast formulas, so that the data is alreay rounded for cash payments, before you launch Prepayments.

  • Foreign Currency rounding off while conversion

    Hi All,
    I am experiencing a scenario while foreign currency conversion.
    I have searched for a solultion but i am unlucky to find one regarding this problem.
    The scenario:
    Example:
    Foreign Curr      |    Value    |       Rate     |     SAP converted Local Curr(Yen)   |    Act Con Value(Y)
    Euro                 |    1210Eur|       127.99Y|     154868Y                                   |   154867(-veRound Off)
    Is there any setting where you can round off the converted amount to its negative whole amount?
    I have searched all the setting in Foreign Currency transactions(OB52,OB59) but couldnt find.
    Hope i can get a solution.
    Regards
    Andrew

    Hi
    Reason and Prerequisites
    u2022Your tax country is Slovakia
    u2022You billed an order with several items in foreign currency,
    u2022where the exchange rate factor between foreign currency and local
    u2022currency is very large or very small.
    u2022The accounting document created during the billing has a tax line item that contains incorrect amounts in local currency
    Solution
    The solution is using the same solution as note 832477 and 32477 with the difference that the country is Slovakia. For other countries you should put the variable L_LAND1 to the string that represent the country.
    Limitations:
    The solution will NOT lead to a recalculation of taxes in local
    currency. However, it will serve to minimise any rounding differences
    which may arise from converting the individual tax lines which are
    transferred from SD to FI. In most practical cases, this should fulfill
    the legal requirements, even though rounding differences may occur for
    individual documents in special cases.
    Regards
    uday

  • Web dynpro + adobe form decimal field round off

    hello all,
    I am now developing an application which is based on the SAP WebDynpro and Adobe form, but the application has an error, if one can help me to resolve the error, I will be very thankful.
    The error is as follows, for a decimal filed on the Adobe form which is binded to a deicmal attribute of Webdynpro, if I get the value of the decimal field using the programming code as "context.nodexx.getAttribute("xx")", the decimal value is rounded off (e.g., 2.4 is changed to 2.0, 2.7 is changed to 3.0).
    for example:In Web Dynpro,  A node name is  "TestNode" which has a  type of decimalattribute named "TestAttr" ,  in  adobe form  a decimal field  bind to the TestAttr . when i input 2.3  in  adobe form,  i  click the button with code:
    this.wdComponentAPI.getMessageManager.reportSuccess(this.wdContext.nodeTestNode.getTestAttr()+"");
    the rusult is  :     2.0
    if  i  input  the  value  2.5   the result  will be  3.0
    Thanks All !

    Hi,
    there is a special display pattern to check for null values:
    null{pattern}
    Example:
    null{'please enter a value'}
    But I don't know if WDJ is really sending a null value. You can combine this with alternatives using '|' to separate alternatives.
    Regards,
    Juergen

  • Currency Conversion Round-off problem

    Hello
    My customer is in import business.
    When a journal entry is made in Dollar it is converting into Indian Rupee (local currentcy), which is correct
    but it is not rounding off. Also user cannot change it mannualy to adjust the roundo-off figure
    Is there any solution to this
    Regards
    Indrajit

    Hello Indrajit,
    What is your rounding setting for currency?
    Thanks,
    Gordon

  • Rounding a currency field

    Hi experts,
    data: field1 type [currency field of size 15, decimals 2].
    field1 = 25.87.
    I want the value of field1 to be always rounded to 25.
    Please suggest a way.
    Pts will be rewaurded.

    Hi,
    Use ceil( ) function.
    Ex. a = ceil ( 398.98).
    wreite:/ a.
    or
    Call 'ROUND' Method as below
    DATA: WA_INPUT TYPE P DECIMALS 8,
    WA_OUTPUT TYPE P DECIMALS 2.
    WA_INPUT = '123.6581'.
    CALL FUNCTION 'ROUND'
    EXPORTING
    INPUT = WA_INPUT
    IMPORTING
    OUTPUT = WA_OUTPUT
    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.
    WRITE: WA_OUTPUT.
    Hope it helps you.

  • Rounding off currency

    Dear Gurus,
    Can some one tell me how the rounding for works.
    Financial Accounting ->AR/AP->Business Transaction->Outgoing Payments->Define Account for Rounding off difference.
    My client require the following scenario.
    a. Client wanted to book all the invoies with decimals at liability booking(FB60).
    Eg : 110.36 and 110.56
    b. While making payment(F-53 or F-58) he waanted to round off the decimals(as he do not want to cut the cheque for decimals
    Eg : 110 and 111
    Please help me to configure to get the out put
    Thanks
    Raju.

    Hi
    Have tolerances set up for the user as well as customer/vendor. This will automatically knock off the differences and you can pay in round amount
    S Jayaram

  • Rounding off net weight value.

    Hi experts,
    I want to round off the quantity value to the next integer value.
    I am using the FM 'J_1I6_ROUND_TO_NEAREST_AMT' as follows...
    call function 'J_1I6_ROUND_TO_NEAREST_AMT'
    exporting
       i_amount = gross_weight
       i_amount1 = net_weight
    importing
       e_amount = gross_weight
       e_amount1 = net_weight.
    i want to round off the gross weight and net weight values.
    In Global definitions, these are given as of type VEKP-BRGEW. The field BRGEW is of datatype QUAN (length - 15 and decimal -3 )
    But when i tried executing i am getting dump .... saying
    "The function module interface allows you to specify only
    fields of a particular type under "I_AMOUNT".
    The field "GROSS_WEIGHT" specified here is a different field type"
    Please help me solve this and please let me know how to round off these fields.
    Regards
    Ammu

    Hi,
    the both fm parameters you fill have a currency data element of length 13, while you pass a quantity data element of length 15.
    You can't use this fm for your fields.
    Regards,
    Klaus

  • Withholding Tax - Rounding Off

    Hi,
    I have problems on my withholding tax setup, it automatically round off even if my settings in the currency is NO ROUNDING.
    My SAP is 8.8 patch 13. I have no problems on Vat, only on withholding tax amount.
    Kindly advise.
    Thanks,
    Harlene

    There is country specific settings in "Setup -> Financials -> Tax -> Withholding Tax", rounding type for Autralia and New Zealand.
    Refer to the help file for the rounding details.
    Country-Specific Fields: Australia & New Zealand
    Rounding Type Choose the relevant rounding type from the drop-down menu:
    Truncated AU u2013 this option is relevant for a penalty withholding tax. The tax amount calculated is truncated, and appears without decimals, for example, a tax amount of 72.25 is truncated to 72.
    Example
    If the withholding tax is posted when payment occurs, the calculation is done as follows:
    You create a payment for an invoice whose total value is 11.6 (=net value 10 + 16% vat), and the withholding tax is 18%.
    The total of 11.6 is truncated to 11.
    The WT is calculated as: 11*18% = 1.98
    The WT amount is truncated to 1.
    Result: The posted value of withholding tax is 1, and the bank account is credited for 10.6
    End of the example.
    Commercial Values u2013 this option is relevant for voluntary withholding tax. In this case the rounding calculation is done as follows:
    1 to 49 cents is rounded down to the nearest dollar, for example, 34.27 becomes 34.
    50 to 99 cents is rounded up to the nearest dollar, for example, 50.68 becomes 51.
    Example
    The following explains the calculations when creating the payment for the invoice mentioned above, but according to commercial rounding:
    The invoice total is 11.6.
    Withholding tax = 11.6*18% = 2.088. This amount is rounded to 2.
    A value of 2 is posted for withholding tax while the bank account is credited for 9.6.
    End of the example.
    BR.
    Joyce

  • Rounding off while posting foreign invoice to Accounts

    Hi,
    I am facing a problem during the accounting of foreign invoices. We are setting the exchange rate in the sales order accounting tab in exchange rate field which gets passed on to the invoice. Now on converting the value to local currency the accounting entry is passed in decimals. the business wants that a rounded off value should be passed to accounting.
    Ex: Invoice for 260 USD with exchange rate 1 USD=46.71INR, and the accounting entry being passed is value INR 12144.6 whereas the requirement is for 12145.
    Will appreciate your response on this.
    Thanks

    Hi
    Reason and Prerequisites
    u2022Your tax country is Slovakia
    u2022You billed an order with several items in foreign currency,
    u2022where the exchange rate factor between foreign currency and local
    u2022currency is very large or very small.
    u2022The accounting document created during the billing has a tax line item that contains incorrect amounts in local currency
    Solution
    The solution is using the same solution as note 832477 and 32477 with the difference that the country is Slovakia. For other countries you should put the variable L_LAND1 to the string that represent the country.
    Limitations:
    The solution will NOT lead to a recalculation of taxes in local
    currency. However, it will serve to minimise any rounding differences
    which may arise from converting the individual tax lines which are
    transferred from SD to FI. In most practical cases, this should fulfill
    the legal requirements, even though rounding differences may occur for
    individual documents in special cases.
    Regards
    uday

  • Depreciation Amount for Asset taking in Round-Off Value and not in Decimals

    Gurus,
        When I run the Depreciation, the System is calculating amount in Round-off and not in decimals
        Whereas I have knowledge that It shud calculate in decimals or to the exact amount whatever it comes, but the system is automatically rounding -off the value to the nearest ruppee
       So please inform about what has gone wrong in my case.!!
    Regards,
    Nimish Agarwal
    New Delhi

    Dear:
               Go to OAYO and do the do the necessary configuration there. Field Arithmetic Rounding
    Using this indicator you specify that rounding should take place according to the rule: tenths up to and including 4 are rounded downward to the next whole number, starting with 5 they are rounded upward to the next whole number.
    This refers to the decimal places of a currency.
    Example: 4.49 is rounded to 4
    4.50 is rounded to 5
    Check the other
               Regards

Maybe you are looking for

  • Catch the Excep while clicking on a button and display the msg in JSF UI

    Hi, I am facing a issue like i have a add button in my JSF page which will add Partner code, Partner name,etc.., If i give the same partner code and partner name second time it is throwing the duplicate key exception org.apache.myfaces.component.html

  • JDeveloper 10.1.3.2 - Nullpointer in Embedded OC4J Preferences

    When I want to have a look at the jazn-data file holding the users and policies I'm getting the followin error in the dialog-screen: java.lang.NullPointerException      at oracle.jdevimpl.xml.oc4j.jazn.PolicyPanel.onEntry(PolicyPanel.java:38)      at

  • Agent's Commission calculation in pricing procedure only for NEW Saleorders

    Hi Guys, In a pricing procedure, .the base for agent commission was calculated on cost + markup price and freight and this base for commision + commision + insurance gave the base price.But now client wants to calculate commision from cost + mark up

  • ORA-27369 Exit-Code: 255 when executing sql script as job

    Dear all I'd like to find and compile all invalid objects in an instance. This should be done every day as a scheduled job with the use of DBMS_SCHEDULER. For this, I set up the following sql-script: ---------start script-------------- set heading of

  • Import fi

    At first, sorry for my bad english, I hope you'll understand me. My problem is the import of new files to my Zen Micro. The import works well, but in Media Organizer it doesn't show the year and the tracknumber. When I watch the files in Winamp numbe