Converting char to number value specfically like '6.35'

I am facing a very peculiar problem, if i try to convert a FLOATING NO. in form of CHARACTER to NUMBER value , then to_number function gives VALUE-ERROR
eG. TO_NUMBER('6.35') is resulting in an error. But TO_NUMBER('6') works fine. My forms are working absolutely ok on 2-tier but not on 3-tier.Please Help.

<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Bogdan Dincescu ([email protected]):
Must have something to do with your NLS settings on your application server, something for the decimal separator. I guess to_number('6,35') would work OK.
I'm not sure exactly what settings you should have on the application server.<HR></BLOCKQUOTE>
Thank you for your reply, I guess it can be the problem becoz forms with such code are working fine on Win2000 but are giving a problem on NT , can u give me a clue why it is happening ???
null

Similar Messages

  • Is there any FM convert char to number ?

    Hi guys,
    Is there any FM convert char to number ?
    what are they? and how can I find them ?
    thx in advance.

    Hi
    data: wl_char(3) type c value '123',
          wl_num type n .
          CALL FUNCTION 'MOVE_CHAR_TO_NUM'
               EXPORTING
                    CHR             = wl_char
               IMPORTING
                    NUM             = wl_num
               EXCEPTIONS
                    CONVT_NO_NUMBER = 1
                    CONVT_OVERFLOW  = 2
                    OTHERS          = 3.

  • Converting char to decimal value format as defined in SU3(User profile)

    Hi Techies,
    Is there any FM to convert CHAR value into Decimal fomat as defined in SU3.
    If we use, WRITE statement for printing the value in decimal format , it shows the value in decimal format correctly
    in SU3 transaction , there are three different decimal format notations which can be user specific
    I would appreciate your valuable inputs ....
    Thanks
    Santhosh

    This is my code in a generic method to transform a table into a csvrow
    when 'P'.
            tmpstr = <p_field>.
            len = strlen( tmpstr ) - 1.
            tmpstr = tmpstr+0(len).
            if <p_field> < 0.
              sign = '-'.
            else.
              sign = ' '.
            endif.
            case decimalformat.
              when 'X' or 'E'.
                split tmpstr at '.' into int frac.
                ptmp = int.
                write ptmp to cp.
                shift cp left deleting leading space.
                replace all occurrences of '.' in cp with ','.
                concatenate
                  s
                  sign
                  cp
                  frac
                  delimiter
                into s in character mode.
              when 'Y' or 'D'.
                split tmpstr at '.' into int frac.
                ptmp = int.
                write ptmp to cp.
                shift cp left deleting leading space.
                replace all occurrences of ',' in cp with '.'.
                concatenate
                  s
                  sign
                  cp
                  frac
                  delimiter
                into s in character mode.
              when ' '.
                concatenate s sign tmpstr delimiter into s in character mode.
              when others.
                concatenate s '????????' delimiter into s in character mode.
            endcase.
    where pfield is a fieldsymbol type P. (honestly ist from type any, but determined by RTTI). I needed this cause i want to format the value from "outside" without taking the user settings in consideration as write...to.. is doing.
    What i'm doing is to use the write... to... clause modifying the result (change decimal point, thousand separator and sign) according to the demanded decimal notation.
    Edited by: Rainer Hübenthal on Oct 7, 2009 4:47 PM

  • Convert char to number

    I am using to_char("FOMS_DFL"."Adjustment Hours",'9999.9') to my desired format. But I am not able to sum the Adjustment Hours. Can i convert the to_char("FOMS_DFL"."Adjustment Hours",'9999.9') to number using any function.

    HI,
    hartford27 wrote:
    Actually I am using this in a reporting tool, so I have created a variable like
    to_number(to_char("FOMS_DFL"."Adjustment Hours",'9999.9')) and then I sum it in the bottom of the footer as Sum((to_number(to_char("FOMS_DFL"."Adjustment Hours",'9999.9'))). Can I do this.Try it and see.
    If "TO_NUMBER (TO_CHAR ..." doesn't cause an error, then all it will do is round the number from each row to the nearest tenth before contributing to the SUM. (That is, if you had 10 rows, each with .049, each row and the grand total would be 0.)
    Why not simply use the number? Your front-end tool probably has a way of displaying numbers in a given format.

  • Converting char to numeric value

    I have table with social security no. but application does not
    have any validation for data so i get all different kinds of
    data like...
    123-24-0988
    123458900
    n/a
    N
    f234-90-8877
    12 345 6789
    Now i want to remove all '-' and alpha char from value and just
    want to remain only nuemric characters so i can use it as where
    parameter.
    Is their any function that i can use for this or any other logic
    that i can use for this?
    Thanks

    As demonstrated in a previous discussion regarding checking for
    numeric values, translate does not produce the proper results
    when you translate it to a null value. However, you can achieve
    the desired results, by translating to spaces, then replacing
    the spaces:
    UPDATE table_name
    SET ssn = REPLACE (TRANSLATE (LOWER
    (ssn), 'abcdefghijklmnopqrstuvwxyz- ', ' '), ' ', '');

  • Convert a number value to a date

    Post Author: Jeremiah
    CA Forum: Formula
    I'm using Crystal Reports XI. I'm coming across a problem trying to convert a
    number value to a date.  I'm using formula below: if not isnull({qryStoreCheckIn.CHECKINDATE})  or {qryStoreCheckIn.CHECKINDATE}="0"the(stringvar MyDate:= ToText({StoreCheckIn.CHECKINDATE},0,"");cdate(2000 + val(left(MyDate,1)),val(mid(MyDate,2,2)),val(right(MyDate,2))))  
    For this line, I'm receiving an error msg of that "A month number must be between 1 and 12
    Here are some of the field's data examples
    70608
    70501
    0
    61231 Would anybody have any ideas on how to solve this?

    Post Author: SKodidine
    CA Forum: Formula
    You are getting the error "A month number must be between 1 and 12" because you are trying to convert 0 to a date.  The third data item in your field data.
    I suggest you default the date to some date when it is zero or eliminate 0 as a date from your formula such as:
    if not isnull({qryStoreCheckIn.CHECKINDATE})
    then(stringvar MyDate:= ToText({StoreCheckIn.CHECKINDATE},0,"")
    else
    If {qryStoreCheckIn.CHECKINDATE} = 0 then (stringvar MyDate:= "00101");  // If date is zero then it is set to 2000/01/01
    After this, you will not have problems with a zero date.

  • Function modules for converting Char value to hexadecimal value

    Hi All,
    Function modules for converting Char value to hexadecimal value.
    Thanks in advance

    Hi,
    use this function module:
    <b>RSS_UNIQUE_CONVERT_TO_HEX</b>
    regards
    Debjani
    Rewards point for helpful answer

  • How can i read every"number" value and not only the 1st?

    in the vi only the first "number" value(from the data acquisition)is read in the small loop.how can i make every value to be read?every value must be compared with the "numeric" constant,and,if greater the led must turn on.afterwards,when a value which is less than the "numeric" is found the led must turn off.please answer or send mail to [email protected]
    Attachments:
    oximet5.vi ‏152 KB

    The more I look at your program, the less I understand it.
    Why are you setting number = number in a case if SO2 = ""? number always equals number.
    In your sequence frames 1 and 4, you have no control over which write (date or time) happens first. Just placing one function to the left of another doesn't make it happen first if your wiring doesn't create data dependency. Review the section on Data Dependency in chapter 5 of the LabView User's Manual.
    It looks you're writing to and reading from the same file using Write File and Read Lines from File.vi. Why read back data you just wrote? You have the data on your diagram. If you want to convert it from string to numeric, use a Sring/Number Conversion function from the String palette.
    On Read Lines from File.vi (which I'm not sure you even need), you should use a shift register for the start of read offset rather than a local variable for mark after read (chars.). With a shift register, you can initialize it to 0 when the VI starts. Using a local, if you restart the VI, it will try to startup from where you left off the last time, but you just opened the file for create or replace.
    In your sequence frames 2 and 3, why do you wait for the number to be less than the numeric before writing a carriage return to the file? Also, LabView has a End of Line constant which adapts to the expected value for the operating system. That's generally more flexible than a Carriage Return.
    It looks to me like you're overusing control refnums. You don't need to use a control refnum and a property node to set or read a control's value if you can wire directly to the control's terminal.
    I really don't understand what you're doing with pause and variants. I may be missing the point, but it looks like you made this much more complicated than it needs to be. Why not keep it a boolean?
    For your pause-path, you open the file but never close it. You can lose data that way. You also open it using open function 3, create new file. You'll get an error if the file already exists.
    On a general note, your diagram would be easier to read if you were more selective in how you routed your wires: you have wires on top of wires, wires running under sub-VIs, wires running in the frame of a while loop, wires running under labels.
    I think there's a temptation to overuse sequences. I don't think you need one here. As I mentioned in my earlier message, case structures and shift registers will be more useful to you.

  • Convert CHAR to INT4

    Hi,
    Is there any FM that allowes you to convert a variable type char into another one type int4?
    I am working on SAP version 4.6C and haven't been able to find any except for 'CHAR_NUMC_CONVERSION' and 'MOVE_CHAR_TO_NUM', but none of them work with int4 type variables.
    I also tried to pass the value directly like this "int4 = char", but i got a dump since the char variable contains ','. And in this sap version there no "replace all occurences of..." so i really cant replace all the comas.
    Any answers will be appreciated.
    Regards,
    Roberto

    I did it like this:
      data: num type p.
      condense char no-gaps.
      call function 'MOVE_CHAR_TO_NUM'
           exporting
                chr             = char
           importing
                num             = num
           exceptions
                convt_no_number = 1
                convt_overflow  = 2
                others          = 3.
      int4 = num.
    Regards,
    Roberto

  • How to convert char to curr ?

    Hi gurus.
    Forgive me for the silly question.
    I have a problem with data conversion from char to curr with 2 decimal places.
    This is the scenario, I have a Z transaction which receives an excel file containing data from invoices and when the field contains a value such as 35,0 the program records the value 3.50 in the destination variable. But when the value is 35,45, it works.
    Here is the piece of code:
    WHEN '0007 '.
            TRANSLATE USING ITAB-VALUE. " '.
            ITAB-VALUE USING TRANSLATE',.'.
            CONDENSE ITAB-VALUE NO-GAPS.
            WA_OPER_MENORES-VL_BRUTO = ITAB-VALUE.
    If I format the column in the excel file for numeric value with 2 decimal places also works, because when the value is formatted 35,0 change to 35,00. But I can not tell all the users hey formatt your files before upload to SAP.
    To test I generate a simple report that reads the excel file and makes the conversion of the columns, like the code above, so I had no problems. I think there should be some configuration that has been changed in the transaction, but I'm new in ABAP, I come from "Java World" and I have no idea that could be.
    I could just use a quick and dirty solution, adding a zero at the end of the column, when there is the 2 decimal places, but I prefer a clean solution.
    Guys, is there any function module or class that does that kind of data conversion? If not, you could tell me what is the best practice to solve this problem?
    thank you very much,
    Ronaldo S. Vieira

    Follow this example to convert Char to Curr and Vice-Versa
    DATA iamnt(17) TYPE c VALUE '243567.00'.
    DATA eamnt TYPE p DECIMALS 2.
    DATA oamnt(17) TYPE c.
    MOVE iamnt TO eamnt.
    WRITE eamnt TO oamnt.
    WRITE oamnt.

  • How to convert exponent to number format

    Hi,
    how to convert exponent to number format.My column is in number and the data is in exponent format .for example  data is 2.44705130197009E18 .when i do field name haveing this data like
    select * from table name where filed name =2.44705130197009E18 ,field name  is of number (20) data type .but i am not getting any data fectched .
    your advice is at most appriciated .
    Regards,
    Suja

    Example of what I was saying...
    SQL> create table myexp (name number);
    Table created.
    SQL> insert into myexp values (2447051301970090001);
    1 row created.
    SQL> select name from myexp;
          NAME
    2.4471E+18
    SQL> col name format 9999999999999999999999999999999999999
    SQL> select name from myexp;
                                      NAME
                       2447051301970090001
    SQL>
    The number you are seeing as an exponent is not just the number that is stored with lots of 0's on it, there's other information you are missing, so you need to change your format to see the true value.

  • Convert any base number to decimal

    Is there a way to convert any number of base 2-16 into decimal?
    The numbers can be input using scanner
    Anyone has any code for this?

    Hey, guys this is what I got so far for this. But, of course there are issues
    1. I'm not sure how to show "invalid" message if a character or floating point number is entered
    2. I'm not sure about the code that will only allow the relevant numbers to be entered for each base.
    E.g - If base = 2 then number == 1 || 0
    This has to be repeated for all allowed base from 2-16
    Please help!!!
    import java.util.Scanner;
    public class BaseConverter {
    public static void main(String[] args) {
    int base;
    String number;
    Scanner scanner = new Scanner(System.in);
    System.out.print("Enter base value (Integer between 2 to 16): ");
    base = scanner.nextInt();
    if (base < 2 || base > 16) {                     // how to get same invalid message for character or float (e.g. -12.2)
    System.out.println("Invalid base. Please retry");
    return;
    System.out.print("Enter the number in base : ");
    number = scanner.next();
    if (scanner.hasNext()) {           // not sure how to validate in relation to entered base
    } else {
    System.out.println("Invalid number. Please retry");
    return;
    int decimalValue = 0;
    int step = 0;
    for (int i = number.length() - 1; i >= 0; i--) {
    char c = number.charAt(i);
    int cValue = Character.digit(c, base);
    decimalValue = decimalValue + (cValue * (int) Math.pow(base, step));
    step = step + 1;
    System.out.println("Decimal value: " + decimalValue);
    }

  • Bug in 1.5.1 Deleting number value in data grid

    Hello,
    it is not possible to set a number in a column to NULL by simply deleting the value
    DROP TABLE tab_test;
    CREATE TABLE tab_test(
    dat DATE
    ,num NUMBER
    ,var VARCHAR2(2)
    INSERT INTO tab_test (dat,num,var)
    VALUES (TO_DATE('01.01.2009','dd.mm.yyyy'),4,'ff');
    COMMIT;Open the table in SQL Developer and select data tab.
    Deleting the date value and commiting is ok
    UPDATE "RVS_FE"."TAB_TEST" SET DAT = TO_DATE('', 'DD.MM.YYYY') WHERE ROWID = 'AAA6Q0AAGAABHUlAAA' AND ORA_ROWSCN = '10443975276'
    Commit Successful
    Deleting the number value and commiting raises an error
    UPDATE "RVS_FE"."TAB_TEST" SET NUM =  WHERE ROWID = 'AAA6Q0AAGAABHUlAAA' AND ORA_ROWSCN = '10443975285'
    One error saving changes to table "RVS_FE"."TAB_TEST":
    Row 1: ORA-00932: inconsistent datatypes: expected NUMBER got DATE
    Rollback Successful
    Deleting the char value and commiting is ok
    UPDATE "RVS_FE"."TAB_TEST" SET VAR =  WHERE ROWID = 'AAA6Q0AAGAABHUlAAA' AND ORA_ROWSCN = '10443975285'
    Commit Successful
    Regards
    Marcus
    Edited by: Marwim on 26.11.2008 08:59

    Jim, I could reproduce and see the error, no change columns order.
    You can use the Marwim script's and, on the data grid, select the column DATE, delete value and commit.
    On the data grid, select the column var, delete value and commit.
    On the data grid, select the column num, delete value and commit -> get error.

  • Convert char to currency

    Hi all,
    i searched alot but couldn't find solution.
    i have l_value char(45) field value has 4560
    I need to convert this into vbak-netwr field in sales order user exit MV45AFZZ
    when i assign vbak-netwr = l_value.
    I am getting 45.60 in vbak-netwr field.
    when i try same login in report progam it is working fine but not in user exit.
    any suggestions?
    Giri

    Sample program to convert Char to Curr.
    data: curr type kna1-umsa1,
          char(254) type c.
    data: temp type p length 15 decimals 2.
    char = '1,405.25'.
    REPLACE ALL OCCURRENCES OF '.' IN char WITH space.
    REPLACE ALL OCCURRENCES OF ',' IN char WITH space.
    CONDENSE char NO-GAPS.
    temp = char.
    curr = temp / 100.
    write: 'CHAR = '.
    write :/ char.
    write:/ 'CURR = '.
    write: curr.
    << Removed by moderator >>
    Regards,
    Uttam Agrawal
    << Removed by moderator >>
    Edited by: uttamagrawal on Feb 22, 2011 9:21 AM
    Edited by: Neil Gardiner on Feb 22, 2011 9:01 PM

  • Convert char to dec

    Dear all ,
        I have to convert char to dec , my requirement is to covert  12344434 to 123444.34 .
    note i don't want 12344434 to 12344434.00 .
    Thanks in advance
    Debesh

    You can try like this.
    DATA : v_tot_len TYPE i,
            v_off_len TYPE i.
    DATA : v_off_text(50) TYPE c,
            v_dec_text(2)  TYPE c,
            v_fin_text(50) TYPE c.
    PARAMETERS : p_input TYPE text20 OBLIGATORY.
    START-OF-SELECTION.
    v_tot_len = STRLEN( p_input ).
    v_off_len = v_tot_len - 2.
    v_off_text = p_input+0(v_off_len).
    v_dec_text = p_input+v_off_len(2).
    CONCATENATE v_off_text v_dec_text INTO v_fin_text SEPARATED BY '.'.
    Here I am inputting the text to be converted.

Maybe you are looking for

  • If Statement in SAP Scripts

    Hi All, I have written the below If statement in  SAP scripts but when i execute the same the controll doent check the second line entries. If firtst line doesnot satisfy it goes to the else part. Kindly suggest what is wrong in this.. /:           I

  • Background job for auto lock user

    Dear Friends, Which background job i have to be schedule for auto locking user after every 30 days if then are not logged for last 30 days. Thanks, Regards, Sachin

  • Is there a way to remove the GNome border for Firefox in Fedora 20 (gnome desktop)

    Hi I have Fedora 20 with Gnome 3 desktop. The Firefox 31.0 has a bar above the tabs where it displays a bar and it shows the page title. Is there any way to remove it as it uses some space and I hate it. Is there any way to hide it or remove it. I ha

  • Safari Just Stopped Working for No Apparent Reason  -- What's Up?!

    Hi there I'm new to this group, and I really hope someone can help... For no known reason, the other day my Safari browser started to load VERY slowly and then eventually it quit. Apart from temporary trouble with broadband service, nothing has chang

  • How do I get a bumper or a build-in/out to end where I want it?

    I want to be able to cut it off or shorten it with the logo still showing - not having faded back to black. This means the Motion project would need to end where I ended it in Motion - not be 30-50% longer. It should be simple, shouldn't it? To end a