How to keep leading zeros using SAP_CONVERT_TO_XLS_FORMAT

my leading zeros  drop when download using FM-SAP_CONVERT_TO_XLS_FORMAT, how to fix it?

Hi,
You can try as below.
Let's for the 10 digit numeric field, using the function module CONVERSION_EXIT_ALPHA_INPUT, you can get the 10 digit number with leading zeroes.
Now if you declare the char of 10 in length field in the internal table will be replaced with the above value.
Now it will be downloaded as required.
Regards,
Nishant Malhotra

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

  • 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 to add leading zero using the toString() function?

    Hi,
    I've looked in the user manual and I can't find any reference to toString() for syntax information.  Isn't there a parameter for me to use to specify the string lenght?  And whether to add leading zeros or not?
    Here's the code I need to add leading zeros:
    playbutt.addEventListener(MouseEvent.CLICK, playSound);
    function playSound(e:Event)
    SoundMixer.stopAll();
    var num:Number = Math.ceil(Math.random()*43);
    bigNum.text = num.toString();
    var path:String = "Track No" + bigNum.text + ".mp3";
    trace(path);
    var s:Sound = new Sound(new URLRequest(path));
    s.play();
    The files I'm trying to open starts at "Track No01".
    Any ideas?
    Ron

    Thank you for the code replacement.
    By the way, instead of having the user click a button to start a random music file (MP3), I'd like to get the music going as soon as one loads a webpage and once the first tune is finished playing jump to another randomly selected music file (MP3).
    I've search via Google for ideas but couldn't find anything that came close to what I need done.
    Any ideas?
    Regards,
    Ronald

  • How to keep leading zeros in numeric Keynote entries?

    When I try to enter numbers that start with zeroes in a table, Keynote removes the zeroes. For instance, I type 007 and it gets "corrected" to 7. Also, for instance, when i type false in lower case, it gets changed to FALSE.
    How do I stop this? I found the Auto-correction tab in Preferences, but everything is unchecked there except for the things that deal with email and hyperlink underlining.

    Ok, naturally I found it after I posted the question. I go to Table in the inspector window and change Cell Format from Automatic to Text.

  • How to delimit leading zero in vendor number in OO ABAP ALV without using conversion routine

    Hi,
    How to delimit leading zero in OO ABAP ALV without using conversion routine, because I have many fields like vendor, customer, material number etc..
    How to address this leading zero.
    I appreciate your quick response.
    Regards,
    Nalini S.

    Hi Nalini,
    Delimiting leading zeros in fields has to be done via conversion routines, as suggested by Vadamalai you need to pass on the conversion routine name in you field catalog variable.
    Now as to which object oriented approach are you using to have your table contents display in ALV as it matters  -
    Using FACTORY method of CL_SALV_TABLE class, or
    Using SET_TABLE_FOR_FIRST_DISPLAY method of CL_GUI_ALV_GRID class.
    Using FACTORY method of CL_SALV_TABLE will do your own work, no need to apply any conversion routines or set long/medium/short text for columns as we do in field catalogs!
    Cheers,
    Varun

  • How to remove leading zero from Material Number

    Hello Everyone,
    I need to figure it out how to remove leading zero from material number. Cureently extractor is sending material number as 100663. But when comes into BI i am getting as "000000000000100663" and similariy in report it is appearing as "000000000000100663". Now my client wants me to exclude preceeding zero for a material in all the reports.
    Is there any setting in query desinger to handle this issure or in the backend.
    Need your inputs.
    Thanks,
    Lasya.

    Hi
    you can use the function Module
    CONVERSION_EXIT_ALPHA_OUTPUT in the start routine
    to test this go to SE37  --- give the CONVERSION_EXIT_ALPHA_OUTPUT -
    >display -
    > F8
    in the input give 000000456
    and execute
    the out put will be 456
    for getting Zeros you can use
    CONVERSION_EXIT_ALPHA_INPUT--- to remove leading zeros
    Santosh
    Edited by: Santhosh Nagaraj on Oct 29, 2009 10:52 PM
    Edited by: Santhosh Nagaraj on Oct 29, 2009 10:54 PM

  • How to remove leading zeros from variable

    hi,
       how to remove leading zeros from variable like it_vbap-matnr.
    value in it_vbap-matnr is 000000000000000358
    i want to remove leading zeros so that it become 358
    regards
    deepak

    You can use Function Module <b>'CONVERSION_EXIT_MATN1_OUTPUT'</b>
    This Function Module will eliminate leading Zeros.
    For each MATNR Value read form DB Table,u can eliminate Leading zeros and then modify ur Internal table.
    I think u will not get leading Zeros into utr Internal table when u read from VBAP.
    Bcoz MATNR in VBAP itself have Conversion routine.
    If u r getting leading zeros,U can use following Logic.
    tables:
      vbap.
    data:
       t_vbap like standard table of vbap.
    select matnr
    from vbap
    into corresponding fields of table t_vbap.
    loop at t_vbap into vbap.
      CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'
          EXPORTING
            INPUT         =  vbap-matnr
          IMPORTING
            OUTPUT        =  vbap-matnr
      modify t_vbap from vbap transporting matnr.
    endloop.
    Hope this will work.....

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

  • Missing leading zeros using debug

    How we will find the particular record containing the missing leading zero and how we will add the missing leading zeroes using debug

    Hi,
    I would suggest to check out the psa. By sorting the data by different criteria you will see duplicates. Additionally you can filter the records based on different restrictions on each field and might be able to find the records containing or not containing fields with leading zeroes.....
    But anyway, some manual work has to be done.
    regards
    Siggi

  • How to remove leading zeros for an item number within quickviewer

    how to remove leading zeros for an item number within quickviewer. Pls help

    ask your abap guy to do  it. not portal guys business.

  • How to suppress leading zeros

    Hi,
            How to suppress leading zeros in a character string.
    Thank you.

    hi,
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
                EXPORTING
                  input  = str1
                IMPORTING
                  output = str1.
    Example:
    input = 00000000000123
    output = 123
    rgds
    Anver

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

  • Keeping leading zero of an integer

    Wondering if anyone can help me solve this small problem.
    Here's what I had:
    for(int i=01; i<13; i++) {
       String month = "2003" + i;
       System.out.println(month);
    }This gives me the following output:
    20031
    20032
    20033
    20034
    20035
    20036
    20037
    20038
    20039
    200310
    200311
    200312
    However, I want the output to be:
    200301
    200302
    200303
    200304
    200305
    200306
    200307
    200308
    200309
    200310
    200311
    200312
    Then I tried this:
    String year = "2003";
    String month = new String()
    for(int i=01; i<13; i++) {
       if(i<10)
          month = year+"0"+i;
       else
          month = year+i;
       System.out.println(month);
    }The code above gives me the results I want. However, I'm thinking that there has to be a better way to do this. Is there anyway to increment the variable i and kept it two digits? I mean keeping the leading zero until it gets to the number 10? Any ideas?

    the previous poster is right. It's also a little odd how you have things setup, in that you're expressing dates with an unusual approach (most people would use Date or Calendar), but, if you want to keep like you have it, I think this might be the easiest solution:
    int date = 200300;
    for (int i = 1; i < 13; i++ ) {
      System.out.println(date + i);
    }

Maybe you are looking for

  • MDB behavior on failed deployment

    I have an MDB that is failing due to a user exception when WL first starts up and tries to initialize the free bean pool. WL seems to try twice and then gives up. The console shows that the JMS connection is active, but the Pooled Beans Current Count

  • Help is sql syntax

    Good day someone help me when i replace( :1 to &var , nn:='1,2' to null ) and run sql when type 1,2 the enter its work . the problem i'm not want to used &var i want to assiagn value to nn in block and nn pass its value to :1 whendo that it say note

  • Connect missing lines in image trace

    I am teaching myself Illustrator and I came across the image trace feature in CS6. I am able to to copy my drawing and do the image trace feature, but I am having trouble connecting missing lines to do a color fill without selecting the background ar

  • How to fetch substring using regular expression

    Hi, I am new to using regular expression and would like to know some basic details of how to use them in Java. I have a String example= "http://www.google.com/foobar.html#*q*=database&aq=f&aqi=g10&fp=c9fe100d9e542c1e" and would like to get the value

  • W2K crashes with PCI-GPIB

    I am using a PCI-GPIB card under W2K, with driver version 1.60. All diagnostics indicate that the card is functioning correctly, and there are no hardware conflicts. I am able to use WaveStar to communicate with the Tektronix 694C scope. When using E