Keeping leading zeroes in flat file

I am loading data from a flat file to a DSO.
One of the columns in the flat file is data type CHAR with a length of two. The data values will be either 01, 02 or 03.
When I load the data, the leading zeroes are dropped. Thus, I see 1, 2 and 3 in my DSO. How can I prevent this happening?

Hi,
Right Click on that column in Excel file and Formate Cells >Custome> Under Type give "00" and then give the values in column like 01 , 02 .... and save as .csv and close it, immediatly load it, DON"T OPEN FILE, because , if you open it will reset to 1, 2... SO again you need to Right click.....and formare cells..
Thanks
Reddy
Edited by: Surendra Reddy on Jun 24, 2010 4:28 PM

Similar Messages

  • How to keep leading Zeros in a CSV file

    Hi All -
    I am trying to keep leading zeros in CSV file. Ex. I need 00001 but not just 1. I tried formatting the cells but not getting saved. Any advise please.
    Thanks.

    Dear Super Man  ,
    Try using ALPHA Conversion Routine
    ALPHA Conversion Routine
    The ALPHA conversion is used in the BW system for each presetting for character characteristics. The ALPHA conversion routine is registered automatically when a characteristic is created. If you do not want to use this routine, you have to remove it manually.
    The ALPHA conversion routine is used, for example, with account numbers or document numbers
    For more details
    http://help.sap.com/saphelp_nw04/helpdata/en/9b/f9c18f5a07f0459127e9676ae22a54/frameset.htm
    Hope it helps
    Regards
    Bala

  • Leading zeros when loading file into BPS

    Hi all,
    i'm trying to load a flat file into BPS cube via sap GUI according to the indication of the correspondent "How to paper".
    As first column i have cost center (10 ch lenght). Usually in the File the leading zeros are not specified and in the paper it's specified to pay extra attention to those zeros.
    So the question is:
    HAVE i to include leading zeros in the file (for cost center)? Is it a mandatory task?
    Thanks in advance.
    Fabio

    Hi Anand,
    Is it possible to load Excel or CSV file into BPS using the standard function module ?
    If we use CSV format, then the leading zeros should be wiped out anyway.
    I tried both format. None of them working. Is only TXT format allowed ?
    Your help is much appreciated.
    Regards,
    Manish Jain

  • 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

  • Leading zeros in CSV file.

    Hi Team,
    I need to retain leading zeros in CSV file.
    I could eliminate this problem in XLS file by using this tag in the RTF Template:
    <fo:bidi-override direction="ltr" unicode-bidi="bidi-override"><?XML_ELEMENT?></fo:bidi-override>.
    So, when i do an Export from Publisher for excel document its gives me correct values. i.e zeros are retained.
    But when i select "CSV" and then hit Export , it gets saved in txt file and the txt file has the zeros.
    but when i rename it to ".csv" and open it does not retain zeros.
    Can you please let us know how can we achieve this.
    Thanks for help!
    Bhupendra Gupta

    Hi Bhupendra,
    If its a number the leading zeros will be eliminated in CS in the default CSV .can't do much on this.
    But if use the delimiter e-text and get the output file, you can get the leading zeros as needed..
    Follow this
    http://winrichman.blogspot.com/2009/09/delimiter-based-e-text.html
    http://winrichman.blogspot.com/search/label/BIP%20E-text

  • Convert hex to Decimal and keep leading zeros..

    Hi,
    I hope you can help?
    How to convert hex to Decimal and keep leading zeros
    I read 002C, hex, and I want to convert it to 0044 decimal.
    sscanf (MyNum, "%4x", &DecNum); will only give me 44.
    It have been working up till I started to get leading zeros.
    We will always have a 4 digit hex input in a range
    We must have the leading 00 in this case.
    How is this best done?
    Thanks for the help
    Simon
    Solved!
    Go to Solution.

    Hi,
    I don't really understand your problem. Is this stuff what you need ?
    int main (int argc, char *argv[])
    const char MyNum[] = "002C";
    int DecNum;
    sscanf (MyNum, "%4x", &DecNum);
    printf ("%04d", DecNum);
    getchar ();
    return 0;
    "0044" appears on standard output when printf function executes...

  • Help keeping leading zero String- Long

    Hello
    I wonder lets say I have a String "09090" how do I convert this String to a Long and keeping leading zero so the Long is 09090?
    /D_S

    Numeric types like Long (or long) are numbers, not strings, so they have no formatting notions like leading zeroes. If you want to maintain the string "09090" keep the string around, even if you have to parse it as well. By the way, you forgot to describe what your goal is, what you are trying to do and what it has to do with leading zeroes.
    One more: Why does this print false?
    System.out.println(07070 == 7070);Hint: this generates a compile-time error:
    System.out.println(09090 == 9090);

  • Leading Zeros in Excel file

    Hello,
    I am downloading few fields from HR infotypes into Excel sheet, I'm using cl_ABAP_char_utilities=>Horizontal_tab to separate the fields. I'm not getting leading zeros. I have tried with 'DAT', 'CSV' and 'WK1' file formats instead of 'ASC', but the flat file format is changing. I have tried ' ' ' symbol. I am getting leading zeros along with that symbol. Now, I need to remove the symbol. Any suggetions...
    Thanks and regards,
    PNM Raju

    dude,
      it's just a regular concatenate statement using a non blank space like the old HTML &nbsp.
    It doesn't show properly in the editor here on SDN. Just try it n see if it executes by putting a space there.
    I think it would wind up looking something like CONCATENATE ' ' MEAN-EAN11 INTO Z_L_ITAB-EAN11.
    If you're on a laptop or a keyboard without the 10key plus on the right, you'll probably have to hold the [[fn]] key down too.
    So in ABAP type CONCATENATE '<-- right here put the [[fn]][[ALT]]0160 and you should see it place what looks like a space right there.
      Try it

  • Keeping leading zero intact  in mail attachment

    Hi All,
    I am sending the excel document into recipients mail id but the leading zero's in the data get truncated.
    I have read so many posts in the forum but did not find any answer to get this done. Some trails i did as follow:
    1. Adding  apostrophes ( ' )  doesn't satisfy my requirement.
    2. Data is good before passing it to mailing function module.
    3. All function module i have tried like SO_NEW_DOCUMENT_ATT_SEND_API1, SO_DOCUMENT_SEND_API1 etc.
       None of them satisfy my requirement.
    Can someone tell  the exact solution?
    Thanks in advance.
    Rudhir Bhaskar

    That's not an SAP email issue though.  I'm sure you'll find that if you open the sent file from a text editor, either from the email client directly or after saving it, that the leading 0's are intact.  Excel is simply interpreting the field as a numeric field upon opening and dropping them.  You need to run the text import wizard and specify the fields as text in order to keep them.

  • Export jsp content to Excel -- how to keep leading zero?

    Hi:
    I am trying to export a JSP content to Excel by using
    response.setContentType( "application/vnd.ms-excel" );
    response.setHeader( "Content-disposition", "attachment; filename=pc.xls" );
    it was working great except my jsp has a field whose value consist of leading zero. i.e. 000XXX. Excel strips the leading zero, but I would like to keep them. Please advise.

    hi Chang,
    Can you please check my thread http://forum.java.sun.com/thread.jspa?threadID=737238&tstart=0
    I think you might know the answer since it is similar functionality but for text files.
    Thanks !

  • How can I remove the leading zeros on jpg files?

    I'm looking for a way to remove the leading zeros on over 1000 jpg files, without changing the remaining digits in the file name. Is there some automated "batch" script?
    i.e going from 003405607.jpg  to  3405607.jpg

    You could write an AppleScript. but it will be easier to get and use a third-party file renaming utility. I use the freeware NameChanger which works quite well.
    https://www.macupdate.com/app/mac/21516/namechanger
    Regards.

  • Leading Zero in CSV File

    Hello,
    I have a report which shows the customer details and the report is working fine, but when I download this report to CSV format the leading zeros doesn't show up on the Customer_ID.
    How do I fix this? Please Advice..Thank you.
    - Abhi.

    The problem is with Excel reading the CSV file. It considers fields with leading zeros to be numeric, not string, and thus removes the leading zeros.
    One of the simpler cheats is to put a single quote in front of the leading zeros. The leading zeros remain, but so does the single quote until the user goes into each cell and hits the [Enter] key.
    Another option is to push the data into an excel spreadsheet right in PeopleSoft and deliver it to the user (binary operation, not CSV). Look at the query viewer for examples on how this is done with existing query results.

  • Preserve leading zeros in CSV file.

    Hello...
    I am creating a file on the fly and attaching with email.
    emp_no starts with 0001,0002,0003 ...etc.
    When file write emp_no to csv file...i looses leading
    zeros...what is best solution to preserve zeros?.
    In excel file creation, i am using
    style="mso-number-format:0000;" to preserve leading zeros.
    But by using cffile, i am not able to use style.....Is there
    any other way to preserve leading zeros?
    <cffile action="write" file="#dirname#/emp_mon.csv"
    output="List of Employees" addnewline="Yes">
    <cfoutput query="emp_q">
    <cffile action="append" file="#dirname#/#filename#"
    output="#emp_no#,#e_name#,#e_address#,#sal#" addnewline="Yes">
    </cfoutput>

    I'd suspect your CSV is fine, ie. if you open it in WordPad
    or NotePad you will see 0002. The problem is with whatever you're
    importing it into. Excel? If something else I don't know. If Excel,
    your Import spec, saved or on-the-fly needs to say Text on that
    field rather than the default General which simply means make a
    number (zero-suppressed) whenever possible. Single or Double quotes
    (on each field that needs it) are a workaround provided you specify
    them as "Text Qualifier", but you don't seem to want to do that, so
    Text is the only other method.

  • Exporting Numbers file with leading zeros as csv file

    When I export a list of mobile phone numbers with leading zeros (086* etc.) from Numbers as a csv file, the leading zeros are stripped out, although the cells are previously formatted as text. What can I do about this?

    "When I export a list of mobile phone numbers with leading zeros (086* etc.) from Numbers as a csv file, the leading zeros are stripped out, although the cells are previously formatted as text. What can I do about this?"
    Well, the first thing you could do would be to post your question in one of the forums for Numbers.
    Click Discussions to get to the Discussions index page, then the section for the version of iWork you're using, then the Numbers forum in that section.
    In AppleWorks (which doesn't offer an opportunity to Save as or Export as csv) I'd force the application to see the phone numbers as text by inserting some non-numeric characters into the string of digits.
    Examples: 000-123-4567, 000 123 4567
    It may also be a function of the application you are using to open the csv file.
    When I did a brief test of the suggestion above with Numbers '09, I got this result on opening the file in Text Edit:
    ,1234567890,num
    ,123-456-7890,tex
    ,0123456789,num
    ,012-345-6789,tex
    ,0001234567,num
    ,000-123-4567,tex
    Note that both the examples entered as a string of digits only (num) and those entered with inserted hyphens (tex) kept the leading zeroes. Cell format for the column containing the phone numbers was set to Text.
    Regards,
    Barry

  • Keeping leading zeros

    I have a series of reports that use Account segmentations that are based on a string of numbers. Unfortunately some of these strings of numbers have leading zeros. (eg. 0023, 0123)
    When the reports are downloaded to excel these leading zeros are lost. Any words of wisdom on how to keep these leading zeros in the report when downloading to excel?

    How would I put the value into double quotes?
    Would this be done under Edit Column Formula?
    If so, I must be doing something wrong. The current column formula is:
    Campaign."Source Code"
    If I change it to:
    "<Campaign."Source Code">"
    I get the following error.
    [nQSError: 10058] A general error has occurred. [nQSError: 27002] Near <Code>: Syntax error [nQSError: 26012] . (HY000)
    SQL Issued: SELECT "<Campaign."Source Code">", Campaign."Campaign Name", Campaign.PICK_0, Campaign.PICK_1, Campaign.PICK_2, Campaign.PICK_3, Campaign.PICK_4, Campaign.PICK_5, Campaign.PICK_6, Campaign.PICK_7, Campaign.PICK_8, Campaign.PICK_9, Campaign.Status, Campaign.TEXT_31, Campaign.TEXT_32, Campaign.TEXT_33, Contact."Contact First Name", Contact."Contact Last Name" FROM "Campaign Response Analysis"
    Please advise.

Maybe you are looking for

  • The touchpad does not work properly

    I just bought this used Excite tablet only to find out that the touchpad is malfunctioning.  Sometimes the pad responds to the touch, other times it is just dead.  WHen I try to type my wifi password in, it takes the first two characters then randoml

  • ITunes after 10.8.3 combo update doesn't play video, only audio with a black screen

    My iTunes has been randomly playing really old QuickTime files as I've had iTunes start in 32 bit mode.  That worked for a while, but like I said, it has stopped working and iTunes is back to not playing older QT movie files.  Fine. Now, however, iTu

  • Problem with social apps.

    yes mee too . i cant open my social applications , and i download facebook but it closing down. i try to reset all. but nothing happens. Solved! Go to Solution.

  • Using JScrollBar with JTextArea

    hey! i'm using JDev 10g, creating a Swing Application i have a JTextArea and a JScrollBar (both which I have dragged down from Component Palette) how to I use JScrollBar with the JTextArea, such that the JScrollBar response to the JTextArea help me o

  • Quantity field as input field in purchase templates

    Hi SDN, we are on WAS 700, SRM 5.0. SRM Server 5.5 I am facing an urgent change request, which is a modification of standard templates and dynpros. The Task: When I create a shopping cart via "Old Purchase Orders and Templates" I want the quantity fi