Sweden Currency validation

Hello ,
Can any one tell me why the following is not retuning (0)
as indication that S and S2 Strings are equal?
java.text.NumberFormat currency = java.text.NumberFormat.getCurrencyInstance(new java.util.Locale("sv", "SE" )  );
String S = "1 234,56";
String S2= (String)currency.format( 1234.56 );
System.out.println(�  S is >>  �+ S);
System.out.println(�  S2 is >>  �+ S2);
return  (S.compareTo(S2));
Knowing that formatting 1234.45 in Sweden locale should be 1 234,45

Check out the below code I hope that you will get what you want now.
java.text.DecimalFormat currency = (DecimalFormat)java.text.NumberFormat.getCurrencyInstance(new java.util.Locale("sv", "SE" )  );
DecimalFormatSymbols symbols = new DecimalFormatSymbols(new java.util.Locale("sv", "SE" )  );
symbols.setGroupingSeparator((char)32);
currency.setDecimalFormatSymbols(symbols);
System.out.println((int)symbols.getGroupingSeparator());
System.out.println((int)' ');
String S = "1 234,56 kr";
String S2= (String)currency.format( 1234.56 );
System.out.println(�  S is >>  �+ S);
System.out.println(�  S2 is >>  �+ S2);
return  (S.compareTo(S2));I would suggest you that it is a good practise to read and understand the use of API carefully, which will save a lot of time.
~Mitul

Similar Messages

  • Adding currency validation in OY03 transaction

    Hi Experts,
    I want to add a currency validation in the transaction OY03, since OY03 is transaction for table maintenace I have to add an event to vaidate the data entered in the sm30 screen. Since it is a standard table SAP is not allowing me to add an event. Please let me know how to overcome this problem, is there any way to add events to a standard SAP table maintenace?
    Your suggestions are really appreciated.
    Thanking you in advance,
    Faar.
    Moderator message - Cross post locked
    Edited by: Rob Burbank on Sep 8, 2009 4:33 PM

    Hi Rob,
    Thank you very much  for your reply.
    I tried to add an event in the maintenace using SE54 transaction, I am able create an entry for the event. but it is neither allowing me to include that particular part of code in any of the  available includes nor creating a  new include.
    This is the issue I am facing.
    Faar.

  • Foreign currency validation

    Hi, Experts,
    I was wondering when doing Foreign currency validation,  The system get the Profit center defaultly, when posting the variance.
    I am wondering where did system get the Profit center when we do FAGL_FC_VAL?

    Hi Bryan Shala,
    When you execute T-code FAGL_FC_VAL for sub-ledger like Customer and Vendor. It will check the open item posted with Profit Center.
    It will post the Gain/Loss to same Profit center, to the Profit center which posted in open Item.
    Regards
    Rakshith

  • Currency validation

    Can anyone please help me to validate a currency input from the user, like it should not accept 1,0,0,0,0.00. appreciate your kind help......

    NumberFormat.getCurrencyInstance().parse() is NOT a reliable method of validating user input. It either throws ParseExceptions on valid input or allows invalid input.
    Regular expressions definitely appears to be the best solution. I'm trying out the JRegex code now since we are using J2SE 1.3.1 and not 1.4.

  • Currency: valid ISO 4217 codes still throw IllegalArgumentExceptions

    java.util.Currency is supposed to support ISO 4217 currency codes (as written in its javadoc). But I still get IllegalArgumentExceptions for the currency codes GHS, RSD, SDG that are still active as I read in wikipedia (http://en.wikipedia.org/wiki/ISO_4217). I also get this exception for some other currency codes that are obsolete but still valid (XEU, ZAL, ...).
    It seems that java.util.Currency only supports a subset of the ISO 4217 currency codes. That makes it unusable as I have to work with the currency codes (Strings) to also handle these other (valid) currency codes. What is this class good for if it only can handle a subset and you can't create your own (new) Currency objects?

    yup. I guess the Currency class was someone's idea of a bright idea at the time, like so many things.
    But someone (probably that same someone) didn't think about the consequences of implementing it the way they did and now Sun's stuck with it.
    Can't remove it because someone may depend on it, and maintenance is expensive and never fast enough for some yet always too quick for others (who have come to depend on the exact content).

  • Norwegian Currency Validation using NumberFormat

    Hi,
    I have to validate a value which will be in a Norwegian Currency.
    So, I use the NumberFormat class like this:
    String noValue = "300,50";
    NumberFormat formatter = NumberFormat.getCurrencyInstance(new Locale("no", "NO"));
    After this one, I have to convert noValue from String to Double whether it contains only numbers. So, I give like this:
    double american = new Double(noValue).doubleValue();
    But it is throwing NumberFormatException.
    Can anyone help me how to validate Norwegian/Swedish currencies.
    Thanks & Regards,
    Bh

    hi,
    This is my code chunk:
    String noValue = "300,50";
    NumberFormat formatter = NumberFormat.getCurrencyInstance(new Locale("no", "NO"));
    System.out.println("noValue " + noValue);
    String formatted = formatter.format(noValue);
    double value = new Double(formatted).doubleValue();
    And this println prints:
    noValue 300,50
    After that it throws the IllegalArgumentException in formatter.format.
    Whereas, I tried like this also:
    String noValue = "300,50";
    NumberFormat formatter = NumberFormat.getCurrencyInstance(new Locale("no", "NO"));
    System.out.println("noValue " + noValue);
    double number1 = formatter.parse(noValue).doubleValue();
    But this is giving parse exception..Please help me..
    Thanks
    Bh.

  • JBO-35007 row currency has changed - can timeouts cause this?

    A user of mine (JDev 10.1.3.1 ADF BC/ADF Faces) is experiencing the famed JBO-35007 row currency has changed error message after a period of inactivity (~35 minutes).
    Suspiciously sounds like a timeout to me. Can the row currency validation be invalidated by a timeout in the ADF framework? What side of the framework tracks the row currency? I'm guessing it's ADF Business Components. Can the timeout of the AM cause JBO-35007?
    Any help appreciated.
    Regards,
    CM.

    Hi John,
    it depends on the fact the failover feature is enabled or not (jbo.dofailover).
    When enabled, the HttpSession cookie that is stored in the HttpSession will also be stored on the browser (browser cookie), so that the framework can re-establish the link between a new HttpSession and the pending session state.
    As 35 minutes is the default of the HTTP session timeout, I suppose that Chris is working in failover mode, and that BC4J has some problem to re-activate the current row (maybe its key ?) correctly.
    Regards,
    Didier.

  • Document Currency to USD problem

    In the Account Receivable cube we are using the Document Currency key figures and converting them to USD on a fixed date exchange rate. When checking the receivable balance at company code level, for one company code the result was *. On further analysis there was a message saying that there is no exchange rate available from USD to KWD. I do not understand this since we are converting from DC to USD and there is exchange rate available from KWD to USD. Then why is the message that no conversion available from USD to KWD. Of course on analysis I found out that one customer who has DC in EUR as well as in KWD. When I excluded this customer the balance value came all right without star. The other fact I noticed is that there are no conversion rates available from USD to any currencies and yet I did not receive any message for any other company codes whether multi document currencies are used. Since it appears to be only for KWD, is there any setting somewhere to be done so that it will not expect an exchange rate from USD to KWD and should be able to use the rate from KWD to USD.
    Thanks for your help
    Ram

    I solved the problem like this. Through SPRO I made an entry into table TCUTF -USD to KWD from factor 1 to factor 1 valid from 01/01/1800. Then in table TCURR made an entry for 01/01/2001 from USD to KWD exchange rate 0.304999 for rate type M.
    Once these entries were made my query runs all right and when converting KWD no more * comes. I am still curious why KWD is left out by SAP when I have  entries for type M from USD to all other currencies valid for 01/01/2001. Appears only KWD is left out. Our BW release is Bw3.5
    Ram

  • Validation for the transaction OY03

    Hi Experts,
      I want to add a currency validation in the transaction OY03, since OY03 is transaction for table maintenace I have to add an event to vaidate the data entered in the sm30 screen. Since it is a standard table SAP is not allowing me to add an event. Please let me know how to overcome this problem, is there any way to add events to a standard SAP table maintenace?
    Your suggestions are really appreciated.
    Thanking you in advance,
    Faar.

    Hi Rob,
    Thank you very much  for your reply.
    I tried to add an event in the maintenace using SE54 transaction, I am able create an entry for the event. but it is neither allowing me to include that particular part of code in any of the  available includes nor creating a  new include.
    This is the issue I am facing.
    Faar.

  • Number validation format mask...

    Can't find an example within the widget sample for the text
    field widget that illustrates how to use a regular expression to
    control the acceptable format of number value. I need to be able to
    allow users to enter up to 8 number similar to the comma_dot
    example. The exception is that I want to separate every 3 numbers
    by a comma while still only allowing one dot. Acceptable values
    will be "000,000.00"; "00,000.00", "000.00"; "00.00"; or
    "0.00".

    Hi FyiGuru,
    In think in your case using the currency validation with the
    'comma_dot' format, and maxChars=10 (8 numbers plus the separators)
    will do the trick.
    If you need more complex validations, you can do the
    validation with your own function:
    var field1 = new Spry.Widget.ValidationTextField("field1",
    "custom", {validation: customFunc});
    To see this in action, check the the 8th example on
    this
    page.

  • Standard Currency translation behaviour

    Dear All,
    We are using standard currency translation planning function for converting amounts from EUR to INR with exchange rate type M.
    In the TCURR table, I have exchange rates maintained from USD to EUR and from USD to INR. But, there is  no direct exchange rate maintained from EUR to INR.
    I would like to know, how the translation will be done in this case. I thought it would first convert from EUR to USD and then from USD to INR. But when I check the records after translation, this is not the case.
    Any suggestions?
    Regards,
    Srinivas Kamireddy.

    Dear Mayank/Srinivas,
    Maintained the reference currency as 'USD' for the currency translation exchange rate type 'M'.
    We are using the standard currency translation planning function to convert the currency values. Also converting the values based on the beginning of the month exchange rates.
    The values in TCURR are as follows:
    Client Exch.rate type From currency To-currency Valid from Exchange Rate Ratio (from) Ratio (to)
    100    M              USD           EUR         01.09.2007  0.73400               1            1
    100    M              USD           INR         15.03.2008  42.00000              0            0
    100    M              USD           INR         07.03.2008  35.00000              0            0
    100    M              USD           INR         03.03.2008  38.00000              0            0
    100    M              USD           INR         01.02.2008  45.00000              0            0
    100    M              USD           INR         05.12.2007  20.00000              0            0
    100    M              USD           INR         06.11.2007  20.00000              0            0
    100    M              USD           INR         05.10.2007  30.00000              0            0
    100    M              USD           INR         01.09.2007  41.02000              1            1
    The incoming record has the value 1,866.67 EUR for the period 001.2008. This value needs to be converted to INR. After running the currency translation planning function 1866.67 EUR is translated to 82,450.81 INR. Not able to trace how this calculation from EUR to INR has been done.
    Pls advise on how this conversion has taken place based on which exchange rates.
    Regards,
    Srini

  • How do I build a table that can be filled in by the user?

    I'm trying to build a form where the user can easily add a qty to order a size. I haven't been able to do this other than adding a text field for every option. Can you build a table that would do the same thing (see my sample below)? Even better, is there a way to get it to total? All ideas appreciated!
    Small
    Med
    Large
    XL
    Total
    Style A
    Style B

    Hi,
    You already have a good start at generating the table. All you need to do is change the cells from static text to either a numeric field or text field. You can do this by dragging a numericField from the Object Library and placing it inside the cell.
    Once you have the numeric field in place, you can edit the properties, font, alignment, currency, validation, etc. Then copy and paste the field into similar cells and change the names, for example A_small,  B_small etc.
    The "Total" numeric field could have a Formcalc in the calculate event:
    $ = A_small + A_med + A_large + A_xl
    This is on the basis of a static table where you design all of the rows that will be available to the user.
    You can also set up dynamic tables where the uer can add additional rows. There are plenty of good examples in the LC help and on the forums.
    Good luck,
    Niall

  • Cash Journal : How to set the limit for maximum payment of 20000

    Hi Gurus,
    Please tell me how can i set the maximum payment limit of 20000 in cash journal?
    Please revert asap.
    Thank You

    Hi
    Amount Limit
    Use
    You use these functions to define limit values for the FI cash journal; where these limits are reached and exceeded, the user is prompted (in an information dialog box) to run certain activities. The check is always performed in the first local currency of the company code.
    In the countries of the European Union, these functions are used to draw attention to the legal requirement for identifying the payer (money laundering law § 3 para. 1).
    Activities
    Company code:
    You do not have to enter a company code. The entry is then valid for all company codes within a client that use the currency specified as the first local currency.
    Currency:
    Each amount must be specified by the classification of the currency. If you specify a company code, the currency of the company code is entered in the currency field and you cannot change this.
    Date and amount:
    The amount limits are defined time-dependent ("Valid From").
    In addition to the above
    Input your company code,Currency,Valid from and the amount limit
    Good Luck
    Hari

  • PLEASE HELP REGARING VBOF A S AP

    Hi,
         I have to update the rebate agreement for a particular customer from 01.01.2007 to tilldate.I tried to do it in VBOF ,But I am getting a message after entering everything and executing "list contains no data".I have no cule how to go about it.Please let me know what to do in the screen and where to see the output.I have never done it before.Please help me.Please advice me what to enter in each field.What I am entering now is ,Rebate agreement Number,Rebate Recipient,Valid to date(Do we have to give todays date or the rebate agreement valid to date?),Posting date(Do we have to give todays date ? or actual billing document posting date?) and in error tab do we have to select drilldown option?Please advice me.This is very urgent.
    Regards
    Ram

    dear aram
    pleaes gothrough this
    REBATES
    Rebates are special kind of discounts that area paid to the customer on certain sales volume. Rebates are paid after rebate agreement period.
    ex : one year the customer should purchase specified if he purchased that specified sales value then only to be rebates are going to be paid by raising credit memo.
    Configuration Settings:
         Activate three controls
    Check the rebate processing active at the time of defining sales organization
    Activate check result at customer master pair
    Activate check relevant for rebate whole defining to billing document type Ex : F2
    Including Condition Type, BO02 with, subtotal =7, requirement = 24 and accounting key = ERB, Accrual Key = ERU, in V/08 B/N, Discount or after total discount value we have to put after discount value if we use rebate basis.
    (Requirement 24 excludes rebate condition type during sales order processing and including during the billing process)
    Create Rebate Agreements (VB01):
    Path: Logistic S&D  Master Data   Rebate Agreement    Rebate Arrangement  VB01 Create
    Specify Rebate Agreement   ex: 0002 – Material Rebate
    Inter, Specify the description, Rebate Recipient (Customer – Payer), “Currency” “Validity Period” 
    Agreement Status: Open & Verification levels
    F- Do play totals by payer – material
    *Click on Conditions maintain “ Sales Trees”, “Customer number”, “Material Number”, “Validity Period”, Amount”.
    *Select Condition line item, 40 to Scales maintain scales, save it.
    *note down the Rebate Agreement Number.
     Define Rebate Agreement Type:
    Path: Img  S&D   Billing  Rebate Processing  Rebate Agreement   Define Agreement type  Define Agreement types
    Choose Rebate agreement 0002 go to Details icon and maintain data as below
    *Default Values
     Proposed Valid from: Specify the beginning validity date which system automatically proposes. Ex: to days date
     Proposed valid to: the value of this field proposes how long this rebate condition record should remain in force. Ex-2
     Payment method: The value of this field determined how the payment going to be made ex: Cheque or cash etc.
    ->Default Status: It specifies Default status of the rebate agreement. The system automatically proposes when you create a rebate agreement. Ex: Open
    Control Data:
     Verification level: ex F – Display total by payer/material
    It how the information should be displayed or printed out for a Rebate Agreement.
     Check different Validity periods
    It specifies whether condition Records within Rebate Agreement must have exactly the same validity period as an agreement itself.
    Manual Accruals order type R4 (B4):
         Specify the sale doc type R4 when we perform manual posting of accruals for agreement.
    Ex: when the ;business wants to put worth of certain amount of product as a front of store display then business pays 10000 then business has to post this 10000 as accruals, system automatically creates credit memo request of this document type(R4).
     Check “Manual Accruals”: Accruals this field if you want to post manual accruals for this agreement.
    Manual Payment:
    Payment Procedure: A – Payment allowed up to accruals valid.
    Specify the value, if you want to allow manual payment for a Rebate Agreement To indicator specifies the amount which can be paid by using this indicator we can limit the manual payment to be the amount of accruals posted for each Rebate condition records when normal payment is carried out creation of credit memo. When system carried out final settlement all partial payments are taken into account.
     Partial Settlement: R3 (B3)
    Specify order type that should be used when we perform costing settlement for the Rebate Agreement. Ex: Customer wants partial Settlement for the Rebate Agreement, and then system uses this document type to settle the partial payment.
    Note: That request must be approved before creating the credit memo.
    Prerequisite: Make sure that in VOV8 R3 (B3) the Billing type field contains appropriate partial settlement value B3
    Check ‘Reverse Accruals’
         Check this field when we want accruals to be reversed when manual payment is made for Rebate Agreement.
    Use: System reverses the Accruals for the amount for manual payment. If the Cumulative Accruals are not sufficient then the system Reverse the accrual amount to which that system.
    Settlement: Final Settlement’ – B1
    Specify the Sales doc type that system uses as a default when final Settlement Takes places.
    Correction: B2     
         Specify doc type B2 the System automatically uses to convert the Value. Ex: Sales Volume on which Rebates is based. If the business has to create a condition record with staring date that is in the past, then the system needs to adjust the sales revenue of the customer, then system has to take the invoice that were processed but the retroactive starting date of the condition record and the  actual date on which we enter the Rebate Agreement.
    Minimum Status: B – Agreement released for settlement
    It specifies the minimum status that Rebate Agreement must have before the settlement an be calculated by default it B
     Save it, and Exit
    Activate Rebate Procedure infrastructure:  (S136):
    To update daily sales orders with synchronize updating.
    Path Img  Logistic general   LIS    Logistics date warehousing   Updating   updating Control  Activate updates   S&D   S136
    Double click on S136 and select ‘Synchronous updating’ in pop up box
     Save it
     Double Click ‘SD60’, Select ‘Day’ & with ‘Synchronous updating’ in pop up box
     Save it
    Go to OVA2 Assign sales document types B, B1, B2, R3, R4 to sales Area
    Go to VA01, VL01N, and VF01raise the sales order billing doc for 2 times and note down the ‘document numbers’.
    VA01: Go to Price condition screen & check rebate condition type Boo2 has been activated or not.
    Go to Change mode of the Rebate agreement (VB02). Note down the message as system unable to update sales volume in the Rebate agreement we have to run the program SDBONT06 in SE38 Transaction Code. Click on Execute(F8)  maintain Selection screen like Rebate Agreement number Rebate Recipient number, Sales Area, & check to error, check drill out,  uncheck test, check changed agreement, click on execute.
    rewards pls
    siva

  • FBCJ - 20000 Limit

    Hi Gurus,
    How can i set the limit of maximum payment on 20000 in FBCJ? I already set the currency, valid from and amount in Amount limit under cash Journal, but it is not working.
    please tell me how can i do this.
    Thank You

    Hi
    I am not sure why the config is not working for you when it works for me.
    Another way to fix it is write a validation for the same via OB28
    Do it at line item level
    <u><b>Prerequsite-</b></u>
    SYST-TCODE-Transaction code=FBCJ and BSEG-BUKRS-Company Code=XXXX
    <u><b>Check</b></u>
    BSEG-WRBTR-Amount=20000
    Message type-E and define a message as Cannot post more than 20000
    Hope atleast this will resolve your issue
    Good Luck
    Hari

Maybe you are looking for

  • Email is out of order

    Hi my e mail doesnt respond. the ikon doesnt work. i tried to turn off the machin and turn on but the  e mail ikon is still out of order. i cant read my emails. what can I do? Help!!

  • PROB INNER JOIN

    BELOW IS MY PROGRAM. AND I WANT TO SHOW THE WHOLE DATA OF ALL THE TABLE.SO HOW I WILL DEFINE TABLE IN DATA STATEMENT AND IN SELECT STATEMENT. PLZ IT'S URGENT TAHNKS.. SAM *& Report  ZTEMP_JOIN REPORT  ZTEMP_JOIN. TABLES: MARA,MARC,MARD,MSEG, MAST. SE

  • Java Connector Server - run as service on Windows

    Hi For whatever reason, I'm not able to install the java Connector Server as a service on my Windows server. It does give a successful message upon connectorserver.bat /install, but it does not show up. I can run and use it fine with the command conn

  • Re-install FC Studio Pro

    I get two messages that keep me from re-installing FCSP Fix alias & error code -8060 I read on several forums to uninstall & reinstall FCSP to get compressor working again. Now I have nothing to edit with. Any sugestion Any suggestion to the software

  • Sun One App Server - Oracle Database 10g

    Hi to all: I�m developing a web application that uses an Oracle 10g database and a I want to use Sun One Application Server 7, the problem that I have is when I have been deployed the war file into the server and acces to my application, specifically