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.

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

  • How to convert char(1) to int32 datatype in pl/sql

    Hello,
    I am trying to convert char(1) to an integer data type to be put into an int32 variable in C#. I tried several options such as TO_NUMBER ,CAST(.. AS INTEGER), and CAST(.. AS SMALLINT) but they all return int64.
    Is there a way to ensure the casting into a datatype that is compatible with int32 ?
    Thanks

    Oracle's SQL Datatypes are limited to NUMBER, BINARY_FLOAT and BINARY_DOUBLE.
    There's a few others through PL/SQL including BINARY_INTEGER.
    If you look in USER_ARGUMENTS you can see it is defined slightly differently.
    Don't know whether / how .Net infers datatypes, but it is worth a shot.
    create or replace function v (p number) return  binary_integer is
    begin
    return p;
    end;
    /

  • 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);
    }

  • Error message - ORA-00932: inconsistent datatypes: expected CHAR got NUMBER

    Here is my Report Query...
    select
    from   DW_RFA_JOBDATA
    where  FINISH_TIME >= :P1_START_DATE
    and FINISH_TIME < :P1_END_DATE
         AND RFA_FLAG = (CASE :P1_JOB_CLASSIFICATION WHEN '0' THEN 'LSF'
                                      WHEN '1' THEN 'NON-LSF'
                                      ELSE RFA_FLAG END)The column RFA_FLAG data type is NUMBER(*,0)... i am displaying LSF and Non-LSF in the select list box , but i get the error ORA-00932: inconsistent datatypes: expected CHAR got NUMBER >
    I have created static LOV with LSF display 0 return
    NON-LSF display 1 return..
    Could any body please help me in truble shooting the error ? how do i convert datatype into number i dont have any privileges to make changes to the table...

    Are there multiple columns in the table you are using from your LOV?
    Your LOV select is:
    select
    from   DW_RFA_JOBDATA
    where  FINISH_TIME >= :P1_START_DATE
    and FINISH_TIME < :P1_END_DATE
         AND RFA_FLAG = (CASE :P1_JOB_CLASSIFICATION WHEN '0' THEN 'LSF'
                                      WHEN '1' THEN 'NON-LSF'
                                      ELSE RFA_FLAG END)Maybe try this:
    select
    from   DW_RFA_JOBDATA
    where  FINISH_TIME >= :P1_START_DATE
    and FINISH_TIME < :P1_END_DATE
         AND TO_CHAR(RFA_FLAG) = DECODE(:P1_JOB_CLASSIFICATION,'0','LSF','1','NON-LSF',RFA_FLAG)

  • Any way to Convert CHAR(8)  field to QUAN(8)?

    Any way to Convert CHAR(8)  field to QUAN(8)?
    Thank-You.

    Hi
    The MOVE statament automatically converts the data format
    DATA: VAR_IN(8) TYPE C,
          VAR_OUT   TYPE P.
    MOVE VAR_IN TO VAR_OUT.
    It's important your char has only number and the point as separator of decimal part.
    Max

  • Converting Char to Quantity field

    Hi
    I want to convert the Char field calue to the Quantity.
    Please let me know how to do it.
    Thanks
    Kumar

    First verify that the field you want to convert is a number.  Try using the following function:
    data: v_char_field(100),
          v_qty_num type rl03t-pickm.
        call function 'MOVE_CHAR_TO_NUM'
             exporting
                  chr             = v_char_field
             importing
                  num             = v_qty_num
             exceptions
                  convt_no_number = 1
                  convt_overflow  = 2.
        if sy-subrc <> 0.
          "write/throw error message
        endif.

  • Char to number

    Hi all,
    Can anybody gimme some idea on converting char('1995-01-12') to number (19950112)
    Thanks in adv

    SwapnaPrerana wrote:
    Oho, its my reqirement.I've not come across any requirements from my business that ask me to store dates as numbers and therfore break all technical and sensible programming practices.
    Date should be stored as dates, not numbers, and not varchar's.
    If you store them as anything other than DATE you will end up with bugs in your code and problems with your data.
    Requirements shouldn't be dictating the technical way to achieve something, they should be specifying the business and logical requirements.

  • Converting char into dec

    Dear all,
    I have data as char for example: 3,52 as char, when i try to transform data directly into key figure as number dec, it gives error message saying: it can not be interpreted as number..
    Is there any easy way to convert data into number?
    thanks

    Hello John,
    First, I would try to replace comma sign in your char into dot, in abap routine, using REPLACE statement. According to what you wrote - 3.52 it returns 3,52 ok - it could work. After that, you can use formula to change it into number, if needed.
    Regards,
    Peter

  • Is there a way to convert skype online number cont...

    That was the general question, and here are my details:
    I have had a skype number for many years and it was great, around $5.5 a month to call all phones in North America from my laptop from any place in the world with internet. With time, I had a ccumulated a relatively large number of contacts (name of person or party & their phone number(s)). Now I decided that I finally need a regular "smart" cellphone with an AT &T 10c/minute and no data (that's the only way that I understand is not a rip-off, I'm counting on my really unlimited mobile hotspot to get wifi). Now, the company will have me purchase minutes every 30 days which doesn't look very bad considering that I don't have my wifi all the time.
    The problem I'm having is, how to transfer or convert the name/number list on skype to name/number list on my phone? so I can call the same numbers I used to call on slype with my AT&T minutes?
    Typing the numbers one-by-one to my phone may take days!! so, I figured out that there must be away to do it automatically, rather than manually.
    Any help is very appreciated

    Is there any answer skype people?????
    please!

  • 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 Date format - Evaluate

    Hi,
    Could anyone provide us the Evaluate formula to convert Char to Date format
    2009-06-20 should be converted to 06/20/2009
    Regards,
    Vinay

    Hi,
    Refer the below threads...
    Re: How to convert string to date format?
    how to convert character string into date format????
    Regards,
    Chithra Saravanan

  • Convert char to ascii code and vice versa

    HI
    Is there any function module to convert char to ascii code and vice versa.
    Thanks in advance

    Hi,
    be careful if you have unicode running in your system. URL_ASCII_CODE_GET is platform-dependent so it will return the internal HERX representation of the character in your system - which is hopefully and in most cases ASCII.
    Under unicode, we use double-byte characters here. I tried this function and the result CHAR_CODE is '00' regardless what character I specify for TRANS_CHAR. But the coding is so simple I corrected resultig in this sample code:
    [P]
    convert p_form to ASCII (internal) representation
      DATA:
        l_ofs TYPE syfdpos,
        l_len TYPE sy-linsz,
        l_ascii TYPE i.
      FIELD-SYMBOLS:
        <x> TYPE x.
      l_len = STRLEN( p_ascii ).
      DO l_len TIMES.
        l_ofs = sy-index - 1.
        ASSIGN p_ascii+l_ofs(1) TO <x> CASTING.
        l_ascii = <x>.
        WRITE: l_ascii.
      ENDDO.
    [/P]
    Here, for each character of string p_ascii, the internal (ASCII) representation is determined and written to the output list.
    Regards,
    Clemens

  • Convert Char to Date in SQL Server

    Hello Experts,
    I am trying to convert Char to Date but getting error in Universe designer. Can anybody advise please?
    Thanks,
    Ravi

    Hi,
    Try with CAST() and CONVERT() functions. For more information refer use this url : http://msdn.microsoft.com/en-us/library/ms187928.aspx.
    It is more easy to get solution if you can post your query.
    Cheers,
    Suresh Babu Aluri.

Maybe you are looking for

  • Screen goes black (dark) after applying a video effect

    I've been trying to apply some fairy dust to part of a clip, and it works great in preview. But as soon as I "apply" it, the clip goes dark, so that when i play the movie the part where there should be a special effect is dark. Any ideas? Thanks p.s.

  • Ipod mini opens auto run, not in itunes

    I have he problem that the ipod mini opens as a storage device G-drive, not in itunes, and the autoplay box opens up but does not allow you to choose itunes. To make it open in itunes I often have to restart my computer, open itunes then it opens. Th

  • How to get the unicode escapes for characters outside a characterset

    Hi! I'm tryiing to edit into a RTF file and have been fairly successful so far. But living outside the U.S i need some characters outside ASCII. Those characters are supposed to be escaped as unicode-escapes, eg \u45. But I can't find a way to get th

  • How to make agency-level HTML banner ads

    I've done a ton of Flash banner ads at agency-level over the years, but I'm trying to figure out how to create html banners now, in addition. Here are the HTML Ad Spec requirements: - HTML code cannot exceed 3k - 2 images maximum, total file size of

  • Cannot Fill a form in 9.2.  Security setting is fill forms allowable.

    I have a document filled that is time sensitive.  When I try to type, the I-Beam does not move.  I checked the security property settings it shows that filling of forms is allowed.