Removing zeros at the begining

hi,
How to remove zeros at the begining of a variable value irrespective of the length of that number
for example,
data:var type int4.
var = '0000012434'.
var= '0003423365'
var= '0436509843'.
I want to remove all zeros at the beginning.
the purpose is I am passing this to a function module which can not allow intial zeros.
Please help me with code

Hi,
CONVERSION_EXIT_ALPHA_OUTPUT
converts any number with zeroes right into a simple integer.
Ex:
'00001234'-->1234
CONVERSION_EXIT_ALPHA_INPUT
converts any number into a string fill with zeroes, with the number at the extreme right
ALPHA conversion is used especially with account numbers. During conversion from the external to the internal format, the system checks to see if input in the INPUT field is purely numeric, that is, if this input consists only of numbers, possibly with spaces before and after them. If this is the case, then the number string is inserted right- justified in the display field OUTPUT and all spaces to the left of the value are filled with zeroes ('0'). If the input is not purely numeric, it is inserted in the display field from left to right and all extra spaces are filled with blanks.
Example:
(Input field and output field are both eight characters in length)
'1234 ' --> '00001234'
Regards,
Omkaram.

Similar Messages

  • Removing zeros on the excel download

    I wanted to know how we can remove zeros from the kebtr at the excel download through ALV without converting it to a type c. for now I am converting it to type c and then validating it this way :
    if tb_main-kebet = 0.
        tb_main1-kebtr = space.
      endif.
    But because of this the formats are not ok and user insists that it should be a numberic field for him.
    Thank you very much.

    Hello Kris,
    I am able to see the data properly in XLS File.
    Use fieldcatlog no_zero = 'X'.
    Now run the transaction -> click on XL Icon ( if you do not get the data properly using navigation),now see the results here.
    you can save same xls file into local machine too.
    Thanks
    Seshu

  • Appending a zero in the begining

    Hi All,
    I have a table1 with a field zip of varchar2 type
    The data now is as following.
    zip
    1123
    76668
    11423
    33174
    2169
    What I need to do is the zip should be 5 digits. So I need t0 change all four digits zip like this
    zip
    01123
    76668
    11423
    02169
    any Ideas?
    Thanks,
    G.

    Hi,
    Well, you can even concatenate a zero at the beginning as a where clause is used in the UPDATE statement which is restricting the update to happen on only those rows which are of 4 character length.
    But if you want to update all the rows with variable lengths then you LPAD will be more efficient.
    SQL> select zip, lpad(zip, 5, '0'), concat('0',zip) from zip_tab;
    ZIP   LPAD( CONCAT
    1     00001 01
    12    00012 012
    123   00123 0123
    1234  01234 01234
    12345 12345 012345Regards

  • Removing punctuation from the beginning and end of a string

    I am working on a project for a "spell checking" program. So far the StringHash class is made, and the dictionary is read into a hash table. Then the document to be checked is specified via command line, the document scans through each word and checks to see if it is in the dictionary, if it is do nothing, if it is not then display it to console. The problem I am having is with a method in the main class. The method (I will post what I have so far) is called removePunct. The method should remove any punctuation from the beginning and the end of the string, nothing from the middle. Here is what I have so far:
    public static String removePunct(String word){
              StringBuilder wo = new StringBuilder(word);
              int x = (word.length()-1);
              if(!Character.isLetter(wo.charAt(0)))
                   wo.deleteCharAt(0);
              if(!Character.isLetter(wo.charAt(x)))
                   wo.deleteCharAt(x);
              return wo.toString();
    Any help would be much appreciated, I'm pretty certain the solution is either something completely different, or something so simple that I just missed it.

    The easiest way to do this is to just show you the actual file to be spell checked:
    -- outline --
    This directory contains Bison skeletons: the general shapes of the
    different parser kinds, that are specialized for specific grammars by
    the bison program.
    Currently, there are only three supported skeletons:
    - yacc.c
    It used to be named bison.simple: it corresponds to C Yacc
    compatible LALR(1) parsers.
    - lalr1.cc
    Produces a C++ parser class. It is still very experimental, and not
    yet supported. Please, subscribe to [email protected].
    - glr.c
    A Generalized LR C parser based on Bison's LALR(1) tables.
    These skeletons are the only ones supported by the Bison team.
    Because the interface between skeletons and the bison program is not
    finished, we are not bound to it. In particular, Bison is not
    mature enough for us to consider that ``foreign skeletons'' are
    supported.
    Copyright (C) 2002 Free Software Foundation, Inc.
    This file is part of GNU Bison.
    GNU Bison is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2, or (at your option)
    any later version.
    GNU Bison is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with Bison; see the file COPYING. If not, write to
    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
    What I need the spell checker to do is read each word, and strip any beginning or ending punctuation, e.g. (c) would become c. Pretty much punctuation consists of anything that is not a letter, hence the use of isLetter. I can easily modify the method to remove all punctuation using regular expressions, but I only want the beginning and end characters removed.
    Example of words:
    -yacc.c would become yacc.c and is not in the dictionary so it would be printed.

  • Removing zeros after the decimal point       Reply with quote

    I want to remove the zeros after the decimal point, that this be done?
    Например, Example,
    120.000 => 120 120.000 => 120
    120.300 => 120.3 120,300 => 120.3

    hiiiiiiii sweetsoni,
    try this may it helpful for you
    SHIFT string RIGHT DELETING TRAILING '0'.
    SHIFT string RIGHT DELETING TRAILING '.'.
    for example
    DATA: v1 (6) TYPE c VALUE '100 .000 ',
    v2(6)  TYPE c VALUE '100.200'.
    SHIFT v1 RIGHT DELETING TRAILING '0'.
    SHIFT v1 RIGHT DELETING TRAILING '.'.
    SHIFT v2 RIGHT DELETING TRAILING '0'.
    SHIFT v2 RIGHT DELETING TRAILING '.'.
    ultimately
    v1 = '100',
    v2 = '100.2'.
    Moderator message: question and answer copied from external source, points deducted, do not repeat!
    Edited by: Thomas Zloch on May 19, 2010 2:14 PM

  • Replace Function removing Zero from the end.

    Hi ALL,
    I'm runing following query
    select REPLACE(52000.50,'.') from dualwhich is giving me output as
    *520005*
    But I need last zero also in the output. like *5200050*
    Please help me if you have any solution.

    user2988171 wrote:
    Thanks it worked only small chane in the above query..
    select REPLACE(to_char('52000.50','999999.99'),'.') from dual Edited by: user2988171 on Jul 30, 2010 4:38 PMYou broke it again.
    If you have a string and not a number right from the beginning then there is no reason to use TO_CHAR.
    Simply run
    select REPLACE('52000.50','.') from dual;Or use the correct version from Toon if you enter a number value.
    Btw. If it is a number you could also simply muliply it by 100.
    select 52000.50 * 100 from dual;Edited by: Sven W. on Jul 30, 2010 2:58 PM

  • Removing zeros from the application

    hi, we have several users that have loaded zeros instead of blanks or #missing into their webforms and have lots of zeros that are taking up needless space. i was originally thinking of locking and sending #missing where there are zeros, but have realized this will be a very long chore. we have mitigated the issue with users by changing "0" into blanks in user's excel sheets before pasting results in their sv webforms but i'm most concerned about data already in the db.
    what would be the best course of action? could we create a calc script that could replace the "0"s with #missing? that seems like an easy solution if we know the correct syntax and all that good stuff. i pose this question as i imagine others have seen this issue and probably know a really good fix.
    we are on planning and EAS 9.3 as our administrative tools. please let me know if you need additional info.
    thanks, tom

    There are two options that come to me
    1. Export the data in column format and create a rules file that converts zero values to #missing when loading. This way you have a backup in case anything goes wrong
    2. Write a calc script on a dense member where it divides by itself. Something like Local = Local/Local * Local; Any division by zero is #missing. Of course you have to pultiply by the value to get the original value back
    5/5 * 5 = 5
    0/0 * 0 = #missing
    If you do the first option, you would have cleared the database so the reload will defrag it. IF you do the second option, you will need to run a forse restructure to reep the benefits.

  • Remove zeros in LOVs of BW Infoobjects on Webi report

    Dear Experts,
    My BW infoobjects(0GL_ACCOUNT) showing preceding zeros in the BI4.1 WEBI Prompts LOVs, so user don't want the zeros and they need only values and also they compare BEx analyzer with BO since BEx analyzer LOVs shows only values without zeros.
    Is there any function or setting either in BO or BEx designer to remove zeros in the BW infoobjects? so that in BO LOVs display only values without zeros.
    Currently values is 0000123456 in BO LOVs and user want only 123456 as per BEx analyzer.
    BEx query as semantic Layer
    Platform: BI4.1 SP01
    BW: BI7.3 SP6
    Please help
    Thanks in advance.
    Regards
    Karuppiah N

    Hi
    Try to make use of custome display fomrat option in business layer.
    Find the below link for custome date format...same process for Numeric objects also
    BI4.1 Business Layer Enhancements - Create Display Format

  • Removing zeros from data stream

    Hi
    I have incoming data (plz see attached diagram which shows the 2 states of the for loop '0' and default) which is a 1-D array of 64 bit real data .....it goes through the loop which removes zeros from the array.
    As I have 3 elements in the 1-D array (call them x,y,z ), the loop works very well for all values of 'y' and 'z' .
    However when x gets towards 1 and below say 10e-3 (it never is a negative number), the loop is rounding everything to 1 and then when the value gets between 1 and 0 (10e-3 for example) the loop leaves it out altogether and I just get y,z  values saved.
    Plz help me sort this out .
    Cheers
    Baz
    Attachments:
    zeros.PNG ‏25 KB
    zeros.PNG ‏25 KB

    If you want a tolerance comparison, try the attached VI.  I rewrote it from one in vi.lib after an earlier post.
    This account is no longer active. Contact ShadesOfGray for current posts and information.
    Attachments:
    CheckForEquality(DBL).vi ‏23 KB

  • How to remove characters/lines from the beginning of an InputStream

    Hi,
    I have a program which receives several InputStreams. From each of these streams I have to remove 2 lines from the beginning. After the lines are removed, all the streams are combined to one with SequenceInputStream and read in one chunk. Is there an easy/simple way of doing this?
    One option I thought would be to read the char by char until 2 end of line chars have been detected and then read the rest of the data to a buffer. And the create a ByteArrayInputStream out of this buffer. Problem with this approach is, that the amount of data can be large, so putting all the data in to memory might cause problems.
    Another option is to use BufferredInputStream and use the readline() method twice to get rid of the lines that are not needed. After this I would write the data to some output stream, which is then converted back to input stream. Propably would work, but sound too much of work for a simple thing like this. There has to be better way.
    To make it simple, what I need is a method that looks like the following, or something similar
    *  Removes n number of lines from the beginning of a InputStream.
    *  @param is InputStream where the lines are removed
    *  @param numberOfLines int value to indicate how many lines whould be removed
    *  @return InputStream where lines have been removed.
    public InputStream removeLines(InputStream is, numberOfLines);Thanks.

    Here's the code, feel free to use it. Comments are also welcome.
    public InputStream removeLinesFromTheBeginning(InputStream is, int numberOfLines) throws IOException
              char c = 'c';
              int i = 0;
              for(int n = 0 ; n < numberOfLines ; n++)
                   do
                        c = (char)is.read();
                        System.out.print(c);
                        if(c == (char)-1)     // end of stream reached before any newline characters were found.
                             return null;
                        i++;
                   while(c != '\n');
                   System.out.println();
                   System.out.println("Characters removed:" + i);
                   System.out.println("n: " + n);
                   i = 0;
              return is;
         }Edited by: dave_spaghetti on Jun 16, 2009 5:42 AM
    Fixed a bug.

  • Remove the leading Zero from the Query output in SAP BW ?

    Hi
    Experts,
    Vendor Number loaded  as   (0000010076) from R/3 to SAP BW.
    How to remove  Prefix  of Zero for  the Vendor Number(0000010076)  from Quey outpt.
    Regards.
    ASIT

    Hi,
    Please check out this thread.
    Remove leading zeros
    Also check if there is any conversion routine used for that particular infoobject.
    If ALPHA conversion is selected for your infoobject then it will automatically take away the leading zeros at query level.
    Regards,
    AL
    Edited by: AL1112 on Sep 16, 2011 9:15 AM

  • How do I remove residual frames at the beginning and end of a video?

    I'm making a short clip with black slugs at the beginning and end. But there are two or three residual frames from the incoming clip after the black clip that stay at the beginning and end of the video and I can't remove them.  I've tried trimming the beginning and end of the video several different ways, and the frames won't disappear. They stay in the video when I make a DVD. The very first and very last frame have sprocket holes in them on the edge of the frame. I'm baffled. Is this an artifact of using the trial version?

    chances are they are from a fade.  have you zoomed in really really close and checked if there is a small fade in or fade out?  happens to me all the time, and with the fade out, you can't do anything to fix it (that I've found) except replacing the clip from your Browser.  See my similar question here:
    https://discussions.apple.com/thread/3589714
    Hope that helps.

  • How to remove leading zeros from the screen?

    Hello friends,
    I am working on dialog programming.
    I have a field with is NUMC 13. so when value is populated, It removes the leading zeros.
    How can I display the my value with leading zeros on the screen painter?

    Call SE51, layout, double-click on field, attributes, tab Program, check Leading zeros.
    Regards,
    Raymond

  • A query on removing additionally padded zeroes from the pernr.

    Hi ,
    How can i remove the padded zeroes from the pernr, Ex pernr is 8 chars and if pernr has 6 chars it has to remove appended 2 zeroes from the left and should only print the 6 chars with no appended zeroes
    Thanks

    Hi Khaleel,
    Use FM <b>CONVERSION_EXIT_ALPHA_OUTPUT</b>
    Reward if useful.
    Thanks
    Aneesh.

  • BAPI to remove leading zeros from the serial number

    Hi All ,
    plz can anybody suggest me the alternative BAPI for 'BAPI_SERVNOT_MODIFY_DATA ',whose function is to delete the leading zeros,from the serial number.
    Thanks.

    Perhaps instead of using a BAPI you can code it like this.
    DATA:serial(10) TYPE n VALUE '0000340078',
    pos TYPE i VALUE 1.
    START-OF-SELECTION.
      WHILE pos <= 10 AND serial+pos(1) = 0.
        pos = pos + 1.
      ENDWHILE.
      REPLACE ALL OCCURRENCES OF '0' IN serial(pos) WITH space.
      WRITE serial.

Maybe you are looking for

  • Trying to use 3 PCI express cards on P6N Diamond

    On the diamond I have 4 PCI express slots.  I use a dual monitor setup and currently have 2 nvidia 6800XT video cards that I use for them.  It works fine if these are the only two cards installed, but I wanted to use the cards in SLI mode for my main

  • EXIF Data not showing up

    I have a new iMac and I am trying to consolidate close to 40,000 photos into iPhoto. Initially everything was fine, but while importing a larger batch, the program locked up overnight. I had to force quit iPhoto. Of course this screwed up the library

  • Import Informix data into Oracle

    Hi. We have an Informix 7.25 SE database and we need to schedule daily imports of some of its tables into an Oracle 10g database on Solaris. The databases are on different machines. Thank you for your help.

  • Updating AD Attributes via OIM user forms

    Hi, I have configured an AD connector. Firstly, I did a trusted recon to create the OIM. Next, I did a user recon to link the AD user to the OIM user. After that I have configured to pre-populate to show the AD attributes onto the OIM user form. Now,

  • How to insert section marks and paragraph symbols?

    Using Ipad keyboard or pages app?