Taking leading zeros off

hi folks,
I need help in the abap code here.
data char type c.
  char = '0000000550'.
I need to take the leading zeros away (remember it is in the character format)
how can I do that?
thanks
Santhosh

silly question.
There are n ways to do this.
anyway oneway is like this
report zemm2466a.
data: char(20) type c,
     in_num type i.
char = '0000000550'.
move char to in_num.
Regards,
Ismail

Similar Messages

  • L_s_range-low not taking leading zeros

    Getting a value of '01111' from a source.
    Want to add the leading zeros of '00001' to '01111' to become '0000101111' and assign that to l_s_range-low.
    Tried CONVERSION_ALPHA EXIT_INPUT but there are too many zeros added.
    Tried translate, shift , and type N, but not get the leading zeros to populated onto the selection criteria screen for the field.
    Trying to use the source value to convert it to a profit center with leading zeros.
    Regular ABAP seems to add the leading zeros when WRITE, but l_s_range-low is not taking the leading zeros and displaying it on the selection criteria screen.
    How to populate leading zeros values for l_s_range-low?

    VAL001 = '00001'
    VAL999 = '99999'
    LOOP AT itab1.
           VALUE1 = itab1-field.    -
    > field has '01234' always start with a zero.
           CONCATENATE  VAL001 VALUE1 INTO VALUE3.
            CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
              EXPORTING
                INPUT         = VALUE3
             IMPORTING
              OUTPUT        = VALUE3               .
           L_S_RANGE-LOW = VALUE3.
           CONCATENATE VAL999 VALUE1 INTO L_S_RANGE-HIGH .
           L_S_RANGE-SIGN = 'I'.
           L_S_RANGE-OPT  = 'BT'.
           APPEND l_s_range TO e_t_range.
        ENDLOOP.
    Created a variable for 0PROFIT_CTR.
    Profit Center is CHAR 10.
    when running the query, Selection criteria screen has omitted 0 and only display 1234 for the low.

  • Leading zeros remove from FB05 for assignment field in process open items b

    Dear expert
    At present i am using the electronic bank statement completed OT83 & OT51configuration, when i am running FF-5 the EBS soft copy has been uploaded and created batch input session.
    I executed  batch input session and the transactions has been posting through FB05 for outgoing payment clearing  with assignment field ( where check number is laying correctly and matching EBS soft copy cheque number and SAP outgoing clearing account line item assignment cheque number ) in case of outgoing clearing is happening correctly.
    but where as i have a problem incoming clrg cheque number which is displaying in assignment field and updated when client using FF68(check deposit / collections).
    the user is punching all collections from customers using t.code FF68 and cheque number is updated with 6 digit number in the variant. it is like a JV.
    after posting batch input session the cheque is number displaying in assignment field. the cheque number is updated with 6 digit number. but in the variant cheque number width 6 digit only  but after posting FF68 & SM35 the system automatically taking leading zeros for the remaining length. Cheque number standard length in SAP 13 in table .
    total 13 digit length but user punched only 6 digit only, because the cheque number 6 digit numberonly. so the remaining 7 digits it is occupaying 0000000.
    while executing FF_5 and SM35  (thr FB05) the assignment field cheque number (0000000586585) and soft copy cheque number 6 digit (586585) is not matching , because of that i am unable to clear the incoming collections or incoming payments clrg.
    so how  can i remove the leading zeros after cheque number ( actually displaying 0000000586585 , but i want without zeros only cheque number 586585) in assignment field in FB05 using FF-5 & SM35).
    is there any enhancement or user exit to remove leading zeros or any other way of work around .
    Regards

    Hi Amareswar,
    In your case, request your bank to provide cheque number with leading zeros in electronic bank statement as the leading zeros in the assignment field is SAP system behaviour.
    Alternatively, use 'Define Search String for Electronic Bank Statement' (refer http://help.sap.com/erp2005_ehp_05/helpdata/EN/6d/0cdf4b142e11d3963800a0c9426c73/frameset.htm for details) in the IMG, customize it to search for the cheque number provided in the note to payee field > then append leading zeros.
    The first method is the solution we are using and it is the most cost effective.
    Hope the above helps.
    Kind regards,
    John Chin

  • Leading Zeros in SU Number

    We are using SU Managment
    How do we get rid of leading zeros in SU# number range. System is storing pallet ID # with leading zeros in the LEIN table. This is causing issues while we retrive SU data from the tables, systems ask to enter the SU#  number with leading zeros.
    My Pallet Tag is printed with out leading zeros SU # 1234567890 and when the user tries to put away using LM02 system does not read the pallet ID. It looking for 00000000001234567890.
    Even on desktop LS33 if I try to display a pallet with SU # 1234567890 system looks for SU Num. with leading zeros.  Is there a way to get the leading zeros off from SU#
    Appriciate your help

    Please check in SPRO whether the conversion exit is maintained for Storage Unit Management. Follow the below path to do so.
    SPRO -> Storage Unit Management - > Master Data - > Define Number Ranges. In the Pop Up choose "Conversion exit for storage unit number" .
    Here you can define the "length of SU Numbers "
    Regards,
    Kumaran

  • Cuts off leading zeros in a report column when "Download to Excel" function

    Hello
    When a text column contains leading zeros for example "000250" the download to Excel stores the string as "250" in the spreadsheet. I am using a column which is a string.(varchar)
    Can somebody suggest me , how to go ahead with it
    Thanks
    Edited by: user647228 on Sep 11, 2008 1:40 PM
    Edited by: user647228 on Sep 11, 2008 1:42 PM

    (To Vins) Actually, concatenating a space doesn't do it. When the file is downloaded into Excel, the leading space is ignored and it the leading zeroes are still trimmed.
    To user647228: A non-space character needs to be concatenated. Regarding what character to append, I would give the following consideration: If the users are content with seeing an added character to the "number," you can append say an underscore "_" and Excel will download the number properly. It's fairly unobtrusive and can be "visually ignored."
    If the end user insists on gettin rid of the extra character once the file is downloaded, I would append a character that is rarely, if not never, used in the report. (This ensures or mitigates replacing other instances of the character.) Then you can do a Replace All in Excel to replace the extra character with a single apostrophe. The single apostrophe will be interpreted by Excel to mean "text" and the appearance will change to exactly what is desired.
    Note: Replacing the extraneous character with a space for example, will result in the leading zeroes being again lopped off by Excel...

  • Download to Excel" function cuts off leading zeros in string

    When a text column contains leading zeros for example "000250" the download to Excel stores the string as "250" in the spreadsheet
    I am unable to find a log about this
    thanks Muthanna

    1) Click on the fx button of the column in question. Enter this:
    '<span style="display:none">&nbsp</span>' ||  columnname Between the double quotes, type display:none
    2) Click on the Data Format tab and change the type to HTML.
    Edited by: David_T on Sep 14, 2010 8:25 AM
    (Edited to make the instructions clearer.)
    Edited by: David_T on Sep 14, 2010 9:54 AM

  • Leading zeroes - switching off ALHPA conversion doesn't work

    Hi all.
    I have an IObj ZPARENT with compounding attribute ZATTR.
    While loading data into ZPARENT I got errors regarding duplicate records. Errors occur because I got leading zeroes in ZATTR and records like "1", "01", "001" become "0001" .
    I thought it is because of ALHPA conv. in ZATTR, so I deleted ZATTR master data, removed ALPHA conv. from ZATTR and tried to reload data. I got same duplicate key error and leading zeroes.
    I also examined my transformation. It doesn't have any ALPHA conversions. I do post data into ZATTR through simple routine:
         data: CATTR type c length 35.
         CATTR = SOURCE_FIELDS-REF_INF.
         REPLACE ALL OCCURRENCES OF '#' IN CATTR WITH ':'.
         RESULT = CATTR.
    The data in PSA looks fine - it doesn't have any leading zeroes in PSA, but than it comes to IObj. I got them.
    What I supposed to do to avoid leading zeroes in ZATTR??

    Hi,
    Below SAP Note may help you out.
    Note 447341 - values for ALPHA conversion routine
    check this note also...
    Note 1242892 - Leading zeros removed from the contract number
    Veerendra.
    Edited by: denduluri veerendra kumar on Jul 1, 2009 4:02 PM

  • IR truncating leading zeros in my popup window report

    Hello,
    I am using IR_columnname, for one of the columns in my report which is a popup window report.
    My problem is that IR_column search filter in my popup window is truncating the leading zeros.
    I am getting the value but it is truncating the leading zeros.
    like say if the deptno is something like 020 or 0020 in the parent window.
    the IR_columnname value is taking '20' (its truncating leading zeros) with this filter its not dispalying the result in my popup window.
    can anyone help me out with this.
    thanks.

    How are you passing values to the IR filter? There could be a possibility that you source logic is truncating the leading zeros.
    Thanks,
    Manish

  • Need help on how to code this SQL statement! (one key has leading zeros)

    Good day, everyone!
    First of all, I apologize if this isn't the best forum.  I thought of putting it in the SAP Oracle database forum, but the messages there seemed to be geared outside of ABAP SELECTs and programming.  Here's my question:
    I would like to join the tables FMIFIIT and AUFK.  The INNER JOIN will be done between FMIFIIT's MEASURE (Funded Program) field, which is char(24), and AUFK's AUFNR (Order Number) field, which is char(12).
    The problem I'm having is this:  All of the values in AUFNR are preceeded by two zeros.  For example, if I have a MEASURE value of '5200000017', the corresponding value in AUFNR is '005200000017'.  Because I have my SQL statement coded to just match the two fields, I obviously get no records returned because, I assume, of those leading zeros.
    Unfortunately, I don't have a lot of experience coding SQL, so I'm not sure how to resolve this.
    Please help!  As always, I will award points to ALL helpful responses!
    Thanks!!
    Dave

    >
    Dave Packard wrote:
    > Good day, everyone!
    > I would like to join the tables FMIFIIT and AUFK.  The INNER JOIN will be done between FMIFIIT's MEASURE (Funded Program) field, which is char(24), and AUFK's AUFNR (Order Number) field, which is char(12).
    >
    > The problem I'm having is this:  All of the values in AUFNR are preceeded by two zeros.  For example, if I have a MEASURE value of '5200000017', the corresponding value in AUFNR is '005200000017'.  Because I have my SQL statement coded to just match the two fields, I obviously get no records returned because, I assume, of those leading zeros.
    > Dave
    You can't do a join like this in SAP's open SQL.  You could do it in real SQL ie EXEC.... ENDEXEC by using SUSBTR to strip off the leading zeros from AUFNR but this would not be a good idea because a)  modifying a column in the WHERE clause will stop any index on that column being used and b) using real SQL rather than open SQL is really not something that should be encouraged for database portability reasons etc. 
    Forget about a database join and do it in two stages; get your AUFK data into an itab, strip off the leading zeros, and then use FAE to get the FMIFIIT data (or do it the other way round). 
    I do hope you've got an index on your FMIFIIT MEASURE field (we don't have one here); otherwise your SELECT could be slow if the table holds a lot of data.

  • Grep query - optional character, leading zeros & shortening words

    I have recently been taught (thanks to this forum) how to use Grep searches (wish I’d known about it years ago!). I still can’t get my head around some of the search strings - hoping someone can shed some light & explain what the components are doing so I can further utilise them?
    I have dates for a travel brochure, given to me sometimes separated by commas without the date (2, 3, 4, 5) & I need to put each date into its own cell in a table with the month next to them (with no space & going across left to right) + with a leading zero for single digits (02Jan /t 03Jan /t 04Jan /t 05Jan).
    How can I get it to add a leading zero for single digits & add the month to the last number that doesn’t have the comma (which I otherwise utilise in the search)? (The way I get it currently is  2Jan /t 3Jan /t 4Jan /t 5).
    I can’t seem to work out the optional character command.
    The other problem I have is that the months need to be shortened to just the first 3 digits & I’m not sure how to do that, either.
    Any light shed would be appreciated!
    Using current Indd on Mac.
    Message was edited by: Alleyna Lenton I have just found (through searching IndesignSecrets) how to do the optional comma: (\d+),?    ->    $1Mar\t  (although I'm not clear whether the '+' after '\d' represents more than 1 or any number of digits?) Just the other 2 probs I have - abbreviating words to first 3 characters & adding a zero to the front of single digits.

    Very good -- GREP is a useful tool to master! If you can't work out the last few things, do let us know. Make sure to list a couple of Before-After examples.
    The + after \d is indeed for "1 or more", that is, at least one and then as much as possible (I don't think there is a realistic upper limit). Contrast with * which is "zero or more" and ? for "none or exactly 1".
    Cutting off month names after the first 3 characters was asked not too long ago, but I cannot recall what the offered solution was. Try something like this:
    (?<=\bJan)uary
    (replace with nothing). The (?<=xxx) is a positive lookbehind: it will search the text "uary" and only match it if preceded by "Jan". By writing out all months in one long string, you can change all of them:
    (?<=\bJan)uary|(?<=\bFeb)ruary|(?<=\bMar)ch|(?<=\bApr)il
    ... etc., etc., where the vertical bar is an OR operator. (It's a bit long written in full, but remember you only have to write this GREP once and then you can save it.)

  • File rename doesn't add leading zeros to renaming files sequence? And a pat on the back to the LR de

    First of all, LR truly rocks. Any Adobe folk reading this, please take this note as a massive pat on the back for your team. There's a lot of childish and naive negativity from people posting in this forum. And I suspect from folk who are not really your key market for this app. I feed my kids by running a photography business and have been shooting digital since the early 90s...ya know...
    LR will be looked at as a massive sea change in the development of digital photography. The first time the entire workflow process is truly viable from end to end. What will make LR the ultimate winner in it's field is simply the integration with Photoshop. Aperture, Capture One etc cannot ever beat LR regarding this and so, just like the way that Excel and Word and Powerpoint all work together and everyone uses them, LR will inevitably become the de facto standard way of managing RAW images for pro photographers.
    Even with the few bugs (specifically file movingon Mac OS10.4.9) LR has shaved HOURS off our workflow. We shoot around 250 gigs of images a month in our weddings and event business. Now all of our editors use LR. No more Capture One etc for us.
    Here's the question - There seems to be no way to add leading zeros to a file rename command. So if you rename a batch of images they appear as 1,2,3,4,5,6,7,8,9,10,11,12 etc so now when I look at them in Bridge or other apps, they are now sorted 1,10,11, etc
    Now let me tell ya this is a pain.
    Any comments or comfort that is is a known issue would be appreciated. All we want is a way to have the rename add the leading zeros like most other apps do...
    Best to all
    William Henshall
    www.californiaweddingphotos.com
    PS By the way, I am a HARD *** about shoddy unstable software sold to pro photographers as the "prefect solution" that doesnt work as advertised...I am that guy that the tech support guys at certain companies dread. Yep, I simply expect an app to do what it says, just like the car I buy. I once resorted to sending the CEO of a certain software company an invoice for my time restarting, reinstalling the OS and bug finding another similar app. You can image, I got a personal call...heh...

    William-
    <br />
    <br />I just changed a folder of 85 images' names, and typed in 001 as my starting number. While no zeroes were prepended, the pix show up in order both in the Finder and in Bridge CS3.
    <br />
    <br />Say a bit more about file moving on your Macs.....
    <br />
    <br />
    <span style="color: rgb(102, 0, 204);">John "McPhotoman"</span>
    <font br="" /></font> color="#800000" size="2"&gt;~~ John McWilliams
    <br />
    <br />
    <br />
    <br />MacBookPro 2 Ghz Intel Core Duo, G-5 Dual 1.8;
    <br />Canon DSLRs

  • ABAP HR leading zero's for PERNR

    Hi,
    I am working on a report where I have select statements. When the pernr is given with out leading zeros its not taking it.. I need to make the pernr with leading zeros like
    if I hav pernr 35 its not getting data.. when i give 0000035 it gets.. so can i add the leading zeros to the pernr.
    if 3737 then it should be 00003737..
    how can i do this..
    Thanks.

    Hi Oscar,
    Use CONVERSION_EXIT_ALPHA_INPUT Function module.
    Please check this code...
    DATA: lf_pernr LIKE pa0000-pernr.
    MOVE '35' TO lf_pernr.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = lf_pernr
      IMPORTING
        output = lf_pernr.
    OUTPUT: 00000035
    Best regards,
    raam

  • Leading Zeroes are lost when convert from string to int

    What I'm trying to do is simple yet the solution has seemed difficult to find.
    I have a system that requires 4 digit numbers as "requisitionNo". The system uses JSPs and accepts the 4 digit number that the user inputs (fyi - duplicate handling is already managed). The input number (rNumber) is of STRING type and in the action (using struts) is converted to an int:
    int requisitionNo = Integer.parseInt(rNumber);At that very line the issue is that when the user inputs a number with leading zeros such as: "0001" the 3 leading zeros are chopped off in the INT conversion. The application validation kicks in and says: "A 4 digit number is required" which is by design. The work around has been that the user has been putting in number that start with 9's or something like that, but this isn't how the system was intended to be used.
    How do I keep the leading zeroes from being lost instead of saving a number "1" to the database how do I keep it saving "0001" to the database? Would I just change everything to STRING on down to the database? or is there another number type that I can be using that will not chop off the leading zeroes? Please provide short code references or examples to be more helpful.

    Yeah, I have to agree here that leading zeroes make no sense. I figured that out when I started to look into this problem. The only requirement that exists is that the user wants it to be a 4 digit number due to some other requirement they have themselves.
    So what I'm gathering from what I've read in the responses thus far is that I should change the validation a bit to look at the STRING for the 4 required digits (which are really 4 characters; maybe I should add CLIENT side numeric validation; currently its doing server side numeric/integer validation; or maybe change up the server side validation instead???) and if they are ALL GOOD then let the application save the int type as it wants to. IE: Let it save "0001" as just "1" and when I come back to DISPLAY this saved number to the user I should append the string of "000" in front of the 1 for display purposes only? Am I understanding everyone correctly?

  • Leading Zeros in Cost Center Account Creation

    Hi All,
    I am creating new cost centers using KS01. The problem I have is that the numbering system that my client requires have leading zeros for some of the cost centers, e.g. 00702. However, the system is not taking the leading zeros and creating them as 702 using my earlier example. Is there any way I can force the system to accept the leading zeros. Thank you for your responses.
    Regards,
    Yomi

    Hi,
    I do not think it is feasible... have a read on this OSS note :
    Note 106971 - FAQ: Automatic Leading Zeroes for Numeric Fields
    Hope this helps.
    Cheers,
    Gimmo

  • How to maintian leading zeros in BI ?

    Hi All,
    We have a requirement for one InfoObject called "0RPA_MEAN" EAN Assignment to Article for this info object i need to maintain a leading zeros as its coming from R/3 end?
    Ex: In R/3 side EAN 123 is different than EAN 0123,EAN 00123.
    But while extracting in BW end the the leading zeros is getting skipped off?How to retain the leading zeros?
    In rsa3 its coming with the same leading zeros but in psa its not showing it?
    This is very serious issue going on, need your valuable inputs on this?
    Many thanks in advance.
    *Points Assured*

    Hi Rakesh,
                       When you extract data to BI there won't be any leading zeroes. So in PSA there won't be any leading zeroes.
    To bring leading zeroes from PSA itself.
    Double click on your datasource in rsa1. Click on the 'Fields' tab. Type 'ALPHA' for the source system field under the column 'Conv. Routines'. I think that will solve the problem.
    To bring leading zeroes after PSA (ie. from transformation onwards)
    But when load data from PSA to further data targets using transformation we can add leading zeroes.
    So in transformation click on rule details for that info object. In the rule details you have to use a function module called 'CONVERSION_EXIT_ALPHA_INPUT'.  when you use this function module the leading zeroes will be added automatically.
    Thanking you,
    Jerry
    Edited by: jerryabap on Oct 14, 2010 5:52 AM

Maybe you are looking for

  • Synchronisation problems

    I have recently upgraded to windows 7 ultimate on tow of my laptops. The one is an HP 4510s and I have no problem synchronising with my Nokia N97 using PC suite 7.1.40.1. However when I try and synchronise with my other Laptop an Asus F5RL  with the

  • SYS.DBMS_AQ_IMP_INTERNAL.IMPORT_QUEUE_TABLE error during the import

    HI, while importing the 2 tables from production to lower env we are gatting the below error Processing object type TABLE_EXPORT/TABLE/POST_INSTANCE/PROCACT_INSTANCE ORA-39083: Object type PROCACT_INSTANCE failed to create with error: ORA-01403: no d

  • Save button grayed out

    Kartz, any answer to this yet?  I have the same issue,  I open a file, make some changes, and the standard SAVE button is grayed out.  An asterik appears in the file name, so I know that means my change is acknowledged, but the Save button stays gray

  • Data Warehouse issues

    Hi there. I'll try and be to the point as I can. I undertook an upgrade from SCOM 2012 SP1 to R2, this was successful. However after a few days had past, I noticed that the log file for the DW DB was growing rapidly, to the point where we hit a real

  • Issue with connecting the server from dreamweaver

    Trying to create "New Business Catalyst Site", but Im getting an error "There was an issue connecting to the server, try again later".