Remove zero and spaces

Hi All
I have a form with two fields
code and name
code           name
0100           vikas
01002         singh
10025           niki
2555            tomi want when i save data then no spaces will save in database in starting the name and in code spaces and zero
will remove automatically
Regards
Vikas

Hi,
your question isn't clear.
describe your table.
If code is data type of number, oracle doesnt store leading zero's , trims leading space.
SQL> create table t (x number);
Table created.
SQL> insert into t (x) values(001000);
1 row created.
SQL> commit;
Commit complete.
SQL> select *from t;
         X
      1000
SQL> insert into t (x) values(            100000);
1 row created.
SQL> commit;
Commit complete.
SQL> select *from t;
         X
      1000
    100000
SQL> select Length(x)len,x from t;
       LEN          X
         4       1000
         6     100000Edited by: user291283 on Sep 24, 2009 5:09 PM
Edited by: user291283 on Sep 24, 2009 5:12 PM

Similar Messages

  • How to padding the zeroes and space befoer sending from XI to R3 system.

    Hi Experts,
       How to padding the zeroes and space befoer sending any data from XI to R3 during mapping, how to write a java code to implement this logic, please help me with the coding or any other alternative.
    thanks
    dhanush

    to pad spaces you need to write a simple UDF
    for right padding use the following
    while( inputField.length() < Integer.parseInt(totalLength))
    inputField = inputField + " ";
    return inputField;
    for left padding use the following
    while( inputField.length() < Integer.parseInt(totalLength))
    inputField = " " + inputField ;
    return inputField;
    Note:in the above examples <i>inputField</i> will be the input to UDF i.e. the sender field which you need to pad and send to receiver , and <i>totalLength</i> will be a constant i.e length of the field you want on receiver side after padding.
    also i m not a Java expert so please check for syntax and semantics for code:) to me it looks correct
    Thanx
    Aamir
    Message was edited by:
            Aamir Suhail

  • Removing Commas and Spaces from Field

    I have a table called TableD1 in a database with a field called "Range".
    The ranges are like 1-1000; 1001-2000; etc. up to like 1000000-200000.
    That is how they are supposed to look, they are not numeric fields, just general, containing a low, a dash and a high all in the same field.
    I just discovered that quite a few of the entries have included commas and spaces, like 1-1,000 or 100000 - 200000.
    I need to write a Query that will remove all of the commas from the data in TableD1's "Range" field, then all of the spaces.
    I imagine they are some kind of Update statements but because of the potential to blow up the whole thing, I'm reluctant to experiment.
    Does anyone know what code I should use?
    Thank you in advance for any help.
    Gee

    Making sure you've taken a backup. Pull the data into temp table and do the testing. once you satisfied with the output then do the update on the main table.
    create table #temp
    Range varchar(100)
    insert into #temp values('1-1,000'),('100000 - 200000')
    select replace(replace(Range,',',''),' ','') from #temp
    --update #temp set Range=replace(replace(Range,',',''),' ','')
    Validate the the output of the select statement.
    --Prashanth

  • How to Take source value remove zero and use it In receiver Determination

    Hi
    I am working On IDOc to Soap channel.
    In idoc Fields ,I am using EMPST field from IDOC and accordingly I am putting Condition in Receiver Determination.
    IF EMPST 111 Then Revceive1
    IF EMPST 222 Then Revceive2
    IF EMPST 333 Then Revceive3
    But sometimes values also Come as 000111 or 00111 or 0111 same for Others.
    I have used follwong condition in Receiver Determination.
    IDOC/E1EDK01/EMPST u2248 *111
    But it working fime for leading zero.
    But if values come as 8111 or 78111 it is also routing message to Revceive1.
    same for others.
    Can you plz suggest solution?

    you can use enhanced receiver determination ,, where you can specify your logic in the mapping
    http://wiki.sdn.sap.com/wiki/display/XI/EnhancedReceiverDeterminationinSAP+XI
    http://wiki.sdn.sap.com/wiki/display/SI/StepbyStepguidetoExplainEnhancedReceiver+Determination
    in the UDF you can write the logic to  remove leading zeros if required:
    Re: removing leading zeros

  • Zero and space in Data

    Hi,
    I have Table
    If there is no value few fields are showing space(blank) and few fields are showing zero's.
    Please let me know what formatting option should i select to make same.
    Thanks
    Sudhakar

    If all fields in table are of type text then don't assign value to the field when it is ZERO(in the back end itself). If some are numeric and some are text then use the formula (formatting->custom) for numeric fields :
    if(@X==0,'',@X).

  • Removing zero and string in RSDS rutine

    Hi Experts!
    I need load transacitional data, and the material has values as "TER0000#1230" or "TER00123568".
    I need obtain only the last number  (1230 or 1235678)
    Can you tell me which is the abap code for this? (This aply on RSDS)
    Thanks in advance!

    HI,
    Write a routine and replace all alphanumeric charachters with space and condense them.
    In the field routine.
    DATA:T_VAR1(45) type C value '0123456789',
    temp(60) type c,
    cnt type i,
    length type i.
    clear : cnt,temp,length.
    break-point.
    temp = SOURCE_FIELDS-TXZ01. " Your Field
       cnt = 0.
       length = STRLEN( temp ).
       IF NOT temp CO T_VAR1.
         WHILE cnt < length.
           IF NOT temp+cnt(1) CO T_ALL.
             CLEAR: temp+cnt(1).
             ENDIF.
           cnt = cnt + 1.
         ENDWHILE.
       ENDIF.
       translate temp to upper case.
    RESULT = temp.
    Thanks,
    Arun
    Edited by: Arunkumar Ramasamy on Oct 6, 2009 11:16 PM

  • Remove zeros before integer

    Hi,
    I have an integer like "000123" i wanted to remove zeros and want to get just integer value.
    Thanks in advance.
    Regards
    Khizer

    String.valueOf( Integer.parseInt( strInteger ) );This brings another advantage: you'll get a NumberFormatException, if your String includes not only unwished zeroes, but also letters ...
    You robably haven't built this string yourself but get it from outside.
    So you should also proof the correctness of its format.

  • Removing leading zeros and leading blank spaces from an input field

    Hi All,
    I have an input field which is alphanumeric and i need to remove the leading zeros and blank spaces in it , but intermediate spaces should be kept .
    so i used the UDF
            String output = input.replaceFirst("^0+","");
            return output;
    but this code does not remove the leading blank spaces . Can anybody help in modifying this code so that even the leading blank spaces along with leading zeros  can be removed .
    Regards ,
    Loveena .

    lets say input is a
    then
    int len = a.length();
    for(int i;i< length;i++)
    if(a.substring(0,1).equals(" ") || a.substring(0,1).equals("0"))
    a = a.substring(1,len);
    return a;
    hope you got the logic so that you can enhance it better

  • MBP unresponsive and zero free space available

    Many people using this MB nobody cared to let me know we were running out of space. Today I was downloading a big file (1GB) when I got the "running out of space" alert message. Went to open info in the HD and saw there was only 255MB!!! I opened Trash but before I could hit "empty trash" the system froze. I can see there is "zero bytes" as available space... Nothing is responding, nneither the trackpad not the keyboard. SOS! I don't know what to do... It has been frozen for 1/2 an hour now..
    What should I Do? MBP is running Mavericks.

    Step 1   
    The first step in dealing with a startup failure is to secure the data. If you want to preserve the contents of the startup drive, and you don't already have at least one current backup, you must try to back up now, before you do anything else. It may or may not be possible. If you don't care about the data that has changed since the last backup, you can skip this step.
    There are several ways to back up a Mac that is unable to start. You need an external hard drive to hold the backup data.
    a. Start up from the Recovery partition, or from a local Time Machine backup volume (option key at startup.) When the OS X Utilities screen appears, launch Disk Utility and follow the instructions in this support article, under “Instructions for backing up to an external hard disk via Disk Utility.” The article refers to starting up from a DVD, but the procedure in Recovery mode is the same. You don't need a DVD if you're running OS X 10.7 or later. 
    b. If Step 1a fails because of disk errors, and no other Mac is available, then you may be able to salvage some of your files by copying them in the Finder. If you already have an external drive with OS X installed, start up from it. Otherwise, if you have Internet access, follow the instructions on this page to prepare the external drive and install OS X on it. You'll use the Recovery installer, rather than downloading it from the App Store.
    c. If you have access to a working Mac, and both it and the non-working Mac have FireWire or Thunderbolt ports, start the non-working Mac in target disk mode. Use the working Mac to copy the data to another drive. This technique won't work with USB, Ethernet, Wi-Fi, or Bluetooth.
    d. If the internal drive of the non-working Mac is user-replaceable, remove it and mount it in an external enclosure or drive dock. Use another Mac to copy the data.
    Step 2
    You might be able to start up in safe mode even though you can't start up normally. Otherwise, start up from an external drive, or else use the technique in Step 1b, 1c, or 1d to mount the internal drive and delete some files. According to Apple documentation, you need at least 9 GB of available space on the startup volume (as shown in the Finder Info window) for normal operation.

  • How do you remove the extra space from the top margin when printing from a website? Already reset Firefox and checked my settings. Using Firefox 18 & Windows 8

    I have a 2" space at the top of pages that I print from websites. How do I remove the extra space? My margin settings are at .5"

    laderamacguy took a look at it and added a black shape over the tab. he suggested i use a different template next time, such as the black template.

  • How do I remove the white space from the bottom and side of my document?

    How do I remove the white space from the bottom and side of my document? (I'm not talking about printing, just viewing it on the screen.) There are about 6 inches of white space at the bottom and at the right hand side. I don't like this. On a blank new spreadsheet it's triple that amount of white space.

    The infinite canvas convention doesn't make a lot of sense for Numbers. When I'm viewing a spreadsheet and mistakenly scroll into white, empty space I think, "this is ridiculous - all of my content is fits on one screen. there's nothing over there."
    A (relatively) infinite canvas is logical for Microsft Excel because it's one big table. There are 256(?) columns by default and hundreds of rows on a sheet - there are cells outside what a user is looking at to see. However, when viewing a Numbers spreadsheet with a single 10 column 10 row table that fits on the screen, there's nothing else on it to scroll to.
    Numbers should distinguish between viewing a spreadsheet and editing one. When I'm just viewing, when there's no content outside the window it shouldn't scroll there. This window behavior is beyond annoying for Numbers on my iPad and iPhone.
    (Adding user-defined canvas size setting to my view mode / edit mode thinking would probably be the most complete solution to this now that I think about it.)
    Until now the way scrolling worked in Numbers has defied logic. Actually it still does lol. That said, thank you Yellowbox for providing a clear explanation. Much appreciated.

  • To remove leading zeroes and take directly from IDOC(Segment field) to file

    Hi SapAll.
    i have got a simple requirement in a idoc to file Interface.
    here in a sender Idoc there will be one segment with one field,the requirement is to remove leading zeroes and take directly the data from this field and map to one of the field in  reciever  file structure.
    i had used the formatnumber (under arithmatic functions)in PI 3.0 but now when iam using it in PI7.1 it was raising some jave exception error.
    it would be preferable if any body can give me the solution without user defined functions.
    regards.
    Varma.

    from your first post:
    i had used the formatnumber (under arithmatic functions)in PI 3.0 but now when iam using it in PI7.1 it was raising some jave exception error.
    use the same formatting that you used in 3.0 .... try with just a # in the FormatNum function.
    Regards,
    Abhishek.

  • How to remove leading zeros and leading blanks from numc

    Hi experts,
             i wanted to show personal number into my smartform..The field name is PERNR(8) which is of type N. But, in my smartform I get output as (000234)..if I use &pernr(Z)& leading zeros r removed but then the output is (   234)..Now, I wanted to remove this leading space also...
    please tell me the solution for this...
    thanks

    Hi Ujjwala,
    You can use SHIFT.
    DATA: V_CHAR(10) VALUE '00000'.
    SHIFT V_CHAR LEFT DELETING LEADING '0'.
    Regards,
    Ramesh
    *award the points if answer was helpful

  • Removing Leading And trailing Zeros

    Hi Guys ,
    Can You help me out in UDF for removing leading and Trailing zeros
    Ex :  0123.234000000
    And it must satisfy below conditions .
    1 ) If value as Null we need 0.0 in target
    2) if the value is 0.0 we need 0.0 in target
    Thanks in Advance

    One more option:
    Input will be "str" of type string.
    Execution type: single value.
    mapping:
    Input -> mapwithdefault(0.0)->UDF->output
    if( !str.equals("0.0"))
    char[] chars = str.toCharArray();
    for (int index=0; index < str.length();index++)
    if (chars[index] != '0')
    str =str.substring(index);
    break;
    int length,index1 ;
    char[] chars1 = str.toCharArray();
    length = str.length();
    index1 = length -1;
    for (int in1=index1-1; in1>0;in1--)
    if (chars1[in1] != '0')
    str=str.substring(0,in1+1);
    break;
    return str;
    else
    return "0.0";
    http://wiki.sdn.sap.com/wiki/display/Java/RemoveLeadingandTrailingZerosfroma+String

  • Remove char(160) and space in SSIS

    Hi everyone,
    I'm using SSIS package to import from excel source to SQL db , before do that, i want to remove all space and char(160) if any .
    But with this : REPLACE(REPLACE(APP_ID_TRANSACTION,"& chr(160)","")," ","") , i can only remove space , cant remove char(160) .
    Any ideas for this ?
    Many thanks,
    Hong

    Hi, with excel i can use this :=SUBSTITUTE((SUBSTITUTE(C2,CHAR(160),""))," ","") , to remove all of space on any field, but in SSIS, i still cant remove char(160) ..
    Pls help me..

Maybe you are looking for

  • How to create a client console to connect to server in windows service using c#

    my code is error can you check the code please client console code partial class Program : ServiceBase         public static void Main(string[] args)             serverservice ss = new serverservice();             ss.myserver();                 TcpCl

  • WRT54GS v6 - Port Forwarding Field Colors (Yellow vs Green)?

    WRT54GS v6, Firmware 1.52.0 Can anyone explain the color coding for the text field backgrounds under the "Port Forwarding" section? I have severally seemingly normal port forwarding entries with green backgrounds, and then one entry whose text fields

  • Process number

    Hi Sometimes, the number of processes ( select count(*) from v$process) anormally increase. How can I find which session or user or sql have the most process?

  • Strange problem...has anyone seen this?

    Hi, my iPod 5G video is behaving strangely... after not using it for a few days, it will ask me to use iTunes to restore the iPod when I try to turn it on. Then I reset the iPod by holding Menu+center button. After a brief moment everything in the iP

  • PEAP in Wireless Enterprise Network

    I am trying to user PEAP on my AP's in the Enterprise. It works fine when used as WPA2. But when i use dot1x it gives me error 'auidentified server identity'. I am using ACS 3.3 & using self signed cert. on the ACS. The same cert. i have installed in