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.

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

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

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

  • Receiver File Adapter: Keep original Filename in E-Mail Attachment

    Dear All
    On our SAP-XI 7.0.1 (EHP 1, sp 4) we have the following scenario:
    (1) SAP-XI picks a FlatFile from the R/3 application server. This file should be forwarded unmodified to the e-mail receiver.
    (2) In the Sender channel I have set the option "Set Adapter-specific Message Attributes" including the FileName.
    (3) In the Receiver channel I have set the message protocol = XIPAYLOAD. In the "Mail Attributes" I do NOT use the mail package yet marked the flag "Keep Attachments". No module has been added to this channel.
    Result: The original file "dollytest1" is sent as e-mail attachment "Untitled.xml".
    QUESTION: Is there a (simple) solution which allows the e-mail attachment to keep its genuine filename ("dollytest1") without any suffix?
    Regards
      Uwe

    Hi Uwe,
    check this wiki page too
    http://wiki.sdn.sap.com/wiki/display/stage/DynamicEmailAttachmentnameforReceivedMails
    Regards
    Suraj

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

  • 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

  • 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

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

  • String to double conversion, but keeping leading zeros?

    Hopefully a simple one for you gurus,
    double theValue = Double.parseDouble(aString);works fine, but the input string is say, "08.00", then theValue = 8.0, I want 08.00, how would I go about implementing this?
    tia.

    You will get ur question answered at the following webpage:
    http://java.sun.com/docs/books/tutorial/java/data/decimalFormat.html
    --DM                                                                                                                                                                                                                                                                               

  • How to keep same sender file name for receiver mail attachement

    Hi,
      i am working with File to Mail scanario. There i want to pick a flat file from native file system and then send it as email attachment. Now i am able to send the file but the flat is getting converted as an xml file. is there any method to keep the same sender file name and type for receiver mail attachment. i am not using any mail package. i am using XI payload and keep attachments.
    Thanks in advance.
    -Siva

    Hi,
    Yes,With out using the mail package u can send the Mail Attachments to the receiver side,
    In that case no need of Integration Repository objects.
    Chck this links.
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    /people/community.user/blog/2006/09/07/email-reporting
    /people/community.user/blog/2006/09/08/email-report-as-attachment-excelword
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    /people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
    If u dont get ur requirement then let me know ur Mail id i will send u a Doc.
    Regards,
    Phani
    Reward points if Helpful

  • Facing problem with the code for sending an .xls attachment via email, a field value contains leading zeros but excel automatically removes these from display i.e. (00444 with be displayed as 444).kindly guide .

    Facing problem with the code for sending an .xls attachment via email, a field value contains leading zeros but excel automatically removes these from display i.e. (00444 with be displayed as 444).kindly guide .

    Hi Chhayank,
    the problem is not the exported xls. If you have a look inside with Notepad or something like that, you will see that your leading zeros are exported correct.Excel-settings occurs this problem, it is all about how to open the document. If you use the import-assistant you will have no problems because there are options available how to handle the different columns.
    Another solution might be to get familiar with ABAP2XLS-Project. I got in my mind, that there is a method implemented, that will help you solving this problem. But that is not a five minute job
    ~Florian

  • Excel file attachment withiout losing leading zeros

    Hi Expert,
    Can anybody tell me how to create the Excel file attachment for email generation without losing the leading zeros.
    Regards,
    Jyotsna

    Hi,
    If you want to pass a variable with leading zeros to excel sheet, please use the following:
      CONCATENATE  '=TEXT('  l_variable ',"000")'  INTO g_errcode1.
    It will display the leading zeros in excel sheet. I have done the same way in one of my program and it is working fine..
    Thanks & Regards
    Rocky Agarwal

Maybe you are looking for