Leading zeros in apex reports

Hi,
In an apex application, when user downloads data from an apex report into csv, it loses the leading zeros because excel thinks it is a number.
Is there a way to keep the leading zeros?
Thanks

I'm afraid but I think that the simplest way is to "quote" the string (so that Excel take it as "text").
Example:
SELECT
'="'|| c1 ||'"'
FROM
select 'MX190' c1 from dual
UNION ALL
select '00190' c1 from dual
Or, sometimes, I save the ".csv" file and load it with Excel's Wizard that allow to specify the column to be considered text ...
But for a normal user is a complex solution...
Thanks
Stefano Corradi

Similar Messages

  • Leading zero issue in Report

    Hi Xperts,
    i have report which has Plant ,Batch and Material.
    Now we found that the Batch that start with "0"  no longer has the leading zeros in the report.
    For Exp:
    Plant-X    Material-123     Batch-0012345
    But in report it is showing,
    Plant-X    Material-123     Batch-12345
    As i have checked in the respective Table and in Cube the batch Number (0012345)  is coming correctly with the leading zero.
    but why the leading zero is not showing in my report.
    Could any one please help me on this issue?
    Regards,
    satish
    Edited by: SAP534 on Mar 31, 2010 8:35 AM

    If your requirement is to show the leading zeros for the Batach, then i will suggest you to redesign the batch infoobject with the compunding objects of material and plant. 
    You have another option like to display the batch from master data in your report by making it as anavigantional attribute in your cube.
    We do have the similar requirement and our business prefered to have Batch compunded with material and plant. Check with your Business and go aheead with the changes.
    Hope this helps.
    Regards,
    Reddy

  • How to display leading zeros in a report

    Hi folks,
    I am doing a HR report and the users are very much used to seeing a two digit numeric value as the pay scale since their legacy days.
    In BW, I have the Pay Scale defined as a character (2) and it shows the values on the report as follows:
    Pay Scale
    0
    1
    2
    3
    11, etc.
    But the users would like to see 00, 01, 02, 03, 11, etc.
    Under the query properties, display tab, there are four separate options - display zeros, show zeros as, etc. I tried all the options but the pay scale still does not show the leading zeros. I remember seeing a SAP note a while back that talks about this. Does anybody know how to force the leading zeros on the BEx report.
    Thanks.
    Abdul

    Try removing the ALPHA Conversion from info object defintion.

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

  • Remove leading zeros in report

    Hi all,
    I do a clasical reoporting. Data in the internal table numeric types. But when writing in the report, is appearing as 000056 etc. I want to remove this leading zeros in the report output. Any helps?
    Regards,
    Mic.

    Hi Michael,
         u can use the function module for removing leading zeros
          CONVERSION_EXIT_ALPHA_INPUT (adding zeros)
          CONVERSION_EXIT_ALPHA_OUTPUT (removing zeros)
    Regards
    Nagesh

  • Excel copy drops leading zeros

    I have records with a part number that is a text field, but contains digits. When I export to excel, the excel spreadsheet drops leading zeros from the part number.
    How do I get the export to treat this as a text field and retain the zeros.
    No, I have no option to make this a number field.

    When the report is displayed on the screen initially for column "blah" the Conditional Display PL/SQL Expression "INSTR(NVL(:REQUEST,'YABBADABBADO'),'EXCEL') = 0" evaluates to TRUE because REQUEST does not have 'EXCEL' in it causing the value to display on the screen. For column "blah_excel" the Conditional Display PL/SQL Expression "INSTR(NVL(:REQUEST,'YABBADABBADO'),'EXCEL') != 0" evaluates to FALSE because REQUEST does not have 'EXCEL' in it causing "blah_excel" to not display.
    When the user clicks to download to CSV the page's REQUEST has 'EXCEL' in it. I think actual request value is 'FLOW_EXCEL'. For column "blah" the Conditional Display PL/SQL Expression "INSTR(NVL(:REQUEST,'YABBADABBADO'),'EXCEL') = 0" evaluates to FALSE because REQUEST has 'EXCEL' in it causing the value to not appear in the CSV. For column "blah_excel" the Conditional Display PL/SQL Expression "INSTR(NVL(:REQUEST,'YABBADABBADO'),'EXCEL') != 0" evaluates to TRUE because REQUEST does have 'EXCEL' in it causing "blah_excel" to appear in the CSV.
    http://mikerife.blogspot.com/2007/08/preserve-leading-zeros-in-apex-csv.html
    Mike

  • Display Leading Zeros in bex query

    Hi,
    I am new to BI and need to display leading zeros in bex report.
    There is an info-object billing number which is of type CHAR. The values, 00001 - 00010 has been given in the CSV file.
    when i generate the same in IP, the leading zeros are mentioned, but the same is not appearing in the bex query.
    I have tried ALPHA conversion but this has no affect on the output.
    How to achieve the same??
    thanks in advance for the answers

    Hi,
    To answer your question in detail, there is a  conversion routine at infoobject level( Tab- general ), that determines how the values are displayed in the front end. For ex, alpha conversion routine takes away the leading zeros when you display the value in query. ( 0001 displayed as 1 )
    Assuming this is custom infoobject, I would suggest you to remove the conversion routine from the infoobject. This will help you in displaying leading zeros in the report.
    However, you have to ensure that all the values loaded for this infoobject is properly alpha converted ( packed with leading zeros ) by adding a field routine in the transformation. This will avoid same values getting stored with different internal formats like 01,001 etc.
    Hope this explains.
    Thanks.

  • ALV Leading ZERO issue

    There is leading zeros in internal table passing to FM 'REUSE_ALV_GRID_DISPLAY'
    but i am not able to see the leading zero in alv report display. how fix this.

    hi
    check out
    have u added no_zero(1)     type c, in fieldcatalog.
    if yes than remove it.
    else
    pass the value by function module 'CONVERSION_EXIT_ALPHA_INPUT' .
    hope this will help u.

  • 0material leading zeros in analyser

    Hi,
    I want to hide 0material leading zeros in my reports. I'm using the Bex analyser and I didn't find any option in the query designer.
    It's maybe just a checkbox or something but i'm afraid it's not possible...
    Thank you for your answers.
    Nicolas

    Hello Akhan,
    it's weird, when i execute the MF CONVERSION_EXIT_MATN1_OUTPUT in test mode, with this input value:
    000000000000000008
    The output is the same.
    I think it's maybe due to my customizing in OMSL. I chose leading zeros... I thank it's only in BW and could be change for the reporting...
    Nicolas

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

  • 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

  • Report Builder: output to Excel removes leading zeros

    I'm trying to use the Report Builder to output a numeric
    field to EXCEL , but on numbers that start with zero EXCEL removes
    the leading zero's. ex. 00123 becomes 123.
    Is there something that I can put in the expression builder
    on the field to overcome this.
    I've tried concatonating a single quote on the front of the
    field but the single quote shows up on the output. I've tried this
    on both the SQL and on the expression builder.
    I've read on some of the posts where people have tried using
    'mso-number-format:"\@'" within a TD tag but I can't seem to get
    the syntax right inside the Expression Builder.
    Has anybody got any suggestions?

    Excel will remove leading zeros in a numeric field because it is treating the column as numeric. Putting a ' in front of the number forces Excel to treat the column as text.

  • Leading zeros getting truncated in plsql report

    Hi,
    I've a requirement of a plsql report with an excel output. When i see the output in excel, the leading zeros get truncated. Is there any suggestion for this, other than enclosing within ' '. Because this particular solution prints the output along with quotes which is not acceptable. Please help me with this.
    -Divya Goteti

    Just prefix with =" and " at teh end of column. like
    select '="' || bank_account_no || '"' from employee_bank_list
    but if you are using same report for pdf also then use decode in pre/postfix.
    Imran

  • Leading zeros in report.

    Hi,
    I have got a char Tracking number of type numc . I have loaded the data using alpha conv routine. So when i look at cube content my char is showing leading zeroes for the values. but in reports I am not able to see leading zeroes. what setting needs to be done and wher should I do it to obtain values with leading zeroes in report??
    thanks in advance.

    Interesting Issue...
    Jst in case are you looking at the same data/same selections ?
    Any Coding/VBA used to suppress zeroes ?

  • XL Reporter - item code starting with leading zeros was truncated

    Hi,
    Anybody knows how to prevent XL reporter from truncating the leading zero(s) in the item code?
    I had done a XL report where one of the field is to retrieve Item Code. In the report generated, the formula was as below:
    =ixDimGet("00100068")
    However, when MS Excel display it in the spreedsheet, the item code becomes "100068" where the leading zeros was truncated. The correct item code was supposed to be "00100068". I had tried to change the cell format to "text", "number", "general" and etc, but it doesn't work. Any method to correct the item code display in the Excel spreadsheet?
    Thanks,
    sianghing

    Chan,
    There is a simple solution for this.  Highlight the cell with the Item Code selection in it.
    Click the formula builder icon in Excel to open the formula builder
    In the bottom box, type TRUE
    This tells Excel that you want to display exactly what comes out of the database, without having to predetermine it with a Custom format, etc.
    I think that will solve your issue.
    Let me know if this needs further explanation.
    Regards,
    Brad Windecker
    [Orchestra Team|http://www.orchestrateam.com]

Maybe you are looking for