Download to EXCEL - Problem with truncating leading zeros

Hello Experts
I have Reqs-
When i download data into EXCEL some of the fields like PERNR lets say if the valus of the PERNR is 01000032 then in the excel it is displaying it as 1000032 or esle if a DATE field with value 02/03/2007 (obtained by concatenating MM / DD / YYYY) it is displaying in the excel as 2/3/2007.
I dont want the truncating of zeros to happen.
Any INPUT will be rewarded with points.
Thanks
Vj

Hi,
Try to use this FM.
There are two very important functional modules ,which are used to add zeroes(‘0’)  & Remove zeroes(‘0’)  from  numeric string input respectively.
The functional module ‘CONVERSION_EXIT_ALPHA_INPUT’ comes handy in this situation.           
Another functional module ‘CONVERSION_EXIT_ALPHA_OUTPUT’ is used to reverse the Operations performed by the above FM.
Let us look up the first case.
Function Module: CONVERSION_EXIT_ALPHA_INPUT
PARAMETER:
Importing Parameter: Input   of  type ‘C’
Exporting Parameter: Output of type ‘C’.
This function module is use to add zeroes (‘0’), to the left of the  numeric string input ,after making the input  numeric string right justified .
If the input string is non-numeric (including alphanumeric) , string is stored as left justified ,with blanks towards the right.
If the string is numeric say  vehicle number , vlcvehicle-vhcle( 10 char)
INPUT  :  ‘123456’              
OUTPUT : ‘0000123456’
Whereas if string is non-numeric
INPUT :    ’ABCD’              
OUTPUT:  ‘ABCD’.
Hope this will solve your problem.
Regards
Balaji

Similar Messages

  • 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

  • ALV download to Excel--Problem with Column Headers

    Hi,
    I have created a dynamic internal table and displaying it as ALV using SALV classes. Problem is that  when I download this ALV to Excel I'm not getting Column headings same as they are in ALV display.
    I mean in Excel it is showing Column headings taken from domain or data element.
    While creating dynamic table i'm passing short/ Medium & Long text too. Still it is not working.
    Any kinda help is appreciated.
    Thanks & Regards,
    Vivek Gaur
    Edited by: Vivek  Gaur on Nov 4, 2009 2:04 PM

    Look I cant actually post the code as it is divided in some global classes and main program. But i can elaborate the steps little further:
    1: I have created a field catalog for Dynamic internal table. In it i have passed every necessary field along with short/medium/Long texts.
    2: I fill up this dynamic table with data.
    3: I assign a field symbol to this dynamic internal table.
    4: I pass this field symbol to the factory method of CL_SALV_TABLE  Class.
    Thats it buddy..Hope u have understood my problem.

  • 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

  • Truncating Leading Zeros & Displaying Decimal Positions in a Webdynpro

    Hi All,
    I am new to webdynpro and assigned with some issues in webdynpro application, the issues goes like this. i  already have a webdynpro application where in i am trying to display a PO as in transaction ME23 with Header and Line Items, In Line Items, i want to Truncate Leading Zeros for material Number & Item Numbers. In the net price i want to display decimal values even if our price don’t have any decimal value. For Example if the net price is 33.33 then i am able to see the value as 33.33. If it’s 33.00 then i am able to see values only as 33. I want to see the exact value as 33.00. Let us know how to over come those issues. 
    Thanks in advance,
    With Best Regards,
    Prabahar N.R

    Hi Santhosh,
    I failed while executing the steps you mentioned, kindly look into below description for more understanding.
    We have an issue like the decimal positions are truncated when the value of decimal places are Zero. For Example if the net price is 99.98 then i am able to see the value as 99.98. If it’s 99.00 then i am able to see values only as 99. I want to see the exact value as 99.00. The values are populated from an RFC Table, which is coming from a Standard BAPI.  I find in the implementation, the attributes uses a method called bindText() available in com.sap.tc.webndypro.clientserver.uielip.standard.api.IWDtextview.  Below is the piece of code,
    com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTextView NetPrice_editor
    = (com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTextView)
    wdAlterEgo.createElement(com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTextView.class, "Net_Price_editor");
    NetPrice_editor.setHAlign(com.sap.tc.webdynpro.clientserver.uielib.standard.api.WDInputFieldAlignment.valueOf("left"));
    NetPrice_editor.setWrapping(true);
    NetPrice_editor.bindText("bapi_po_getdetail_input.Output.Po_Items.Net_Price");
    NetPrice.setTableCellEditor(_Net_Price_editor);
    Table.addColumn(Net_Price);
    I can see from R/3 back end the values coming with decimal values even if the decimal positions are null. Any suggestions will be very helpful.
    With Best Regards,
    Prabahar N.R

  • Stacked 100% bar chart - Problem with datatips for zero value data points

    I have a stacked 100% bar chart that shows datatips in Flex 4.   However, I don't want it to show datatips for
    data points with zero values.   Flex 4 shows the datatip for a zero value data point on the left side of a bar if the data point is not the first in the series.
    Here's the code that illustrates this problem.    Of particular concern is the July bar.    Because of the zero value data point problem, it's not possible to see the datatip for "aaa".
    Any ideas on how we can hide/remove the datatips for zero value data points ?        Thanks.
    <?xml version="1.0"?>
    <s:Application
    xmlns:fx="
    http://ns.adobe.com/mxml/2009"xmlns:mx="
    library://ns.adobe.com/flex/mx"xmlns:s="
    library://ns.adobe.com/flex/spark"creationComplete="initApp()"
    height="
    1050" width="600">
    <s:layout>
    <s:VerticalLayout/>
    </s:layout>
    <fx:Script><![CDATA[ 
    import mx.collections.ArrayCollection;[
    Bindable] 
    private var yearlyData:ArrayCollection = new ArrayCollection([{month:
    "Aug", a:1, b:10, c:1, d:10, e:0},{month:
    "July", a:1, b:10, c:10, d:10, e:0},{month:
    "June", a:10, b:10, c:10, d:10, e:0},{month:
    "May", a:10, b:10, c:10, d:0, e:10},{month:
    "April", a:10, b:10, c:0, d:10, e:10},{month:
    "March", a:10, b:0, c:10, d:10, e:10},{month:
    "February", a:0, b:10, c:10, d:10, e:10},{month:
    "January", a:10, b:10, c:10, d:10, e:10}]);
    private function initApp():void {}
    ]]>
    </fx:Script>
    <s:Panel title="Stacked Bar Chart - Problems with DataTips for Zero Value Items" id="panel1">
    <s:layout>
    <s:HorizontalLayout/>
    </s:layout>
    <mx:BarChart id="myChart" type="stacked"dataProvider="
    {yearlyData}" showDataTips="true">
    <mx:verticalAxis>
     <mx:CategoryAxis categoryField="month"/>
     </mx:verticalAxis>
     <mx:series>
     <mx:BarSeries
    xField="a"displayName="
    aaa"/>
     <mx:BarSeries
    xField="b"displayName="
    bbb"/>
     <mx:BarSeries
    xField="c"displayName="
    ccc"/>
     <mx:BarSeries
    xField="d"displayName="
    ddd"/>
     <mx:BarSeries
    xField="e"displayName="
    eee"/>
     </mx:series>
     </mx:BarChart>
     <mx:Legend dataProvider="{myChart}"/>
     </s:Panel>
     <s:RichText width="700">
     <s:br></s:br>
     <s:p fontWeight="bold">The problem:</s:p>
     <s:p>Datatips for zero value data points appear on left side of bar (if data point is not the first point in series).</s:p>
     <s:br></s:br>
     <s:p fontWeight="bold">For example:</s:p>
     <s:p>1) For "June", eee = 0, mouse over the left side of the bar to see a datatip for "eee". Not good.</s:p>
     <s:br></s:br>
     <s:p>2) For "July", eee = 0 and aaa = 1, can't see the datatip for "aaa", instead "eee" shows. Real bad.</s:p>
     <s:br></s:br>
     <s:p>3) For "Feb", aaa = 0, datatip for "aaa" (first point) does not show. This is good.</s:p>
     <s:br></s:br>
     <s:p>4) For "Mar", bbb = 0, datatip for "bbb" shows on the left side of the bar. Not good.</s:p>
     <s:br></s:br>
     <s:p fontWeight="bold">Challenge:</s:p>
     <s:p>How can we hide/remove datatips for zero value data points?</s:p>
     <s:br></s:br>
     </s:RichText></s:Application>

    FYI.
    Still have the issue after upgrading to the latest Flex Builder 4.0.1 with SDK 4.1.0 build 16076.   
    Posted this as a bug in the Adobe Flex Bug and Issue Management system.     JIRA
    http://bugs.adobe.com/jira/browse/FLEXDMV-2478
    Which is a clone of a similar issue with Flex 3 ...
    http://bugs.adobe.com/jira/browse/FLEXDMV-1984

  • Problem with truncate table in procedure ora -00054

    hi do anybody know where is mistake ???
    the procedure has problem with truncate table
    ora - 00054: resource busy and acquire with NOWAIT specified
    ora - 06512 at "POVAPSYS.HMAN_P_REFRESH", line 6
    ora - 06512 at "POVAPSYS.POVAPSYS", line 6
    ora - 06512 at line 1
    this is my procedure....
    AS
    BEGIN
    execute immediate 'TRUNCATE TABLE hman_t_max';
    INSERT INTO hman_t_max SELECT * FROM hman_v_max;
    COMMIT;
    END;

    2.MAKE SURE THAT OTHER THAN YOU ANYBODY IS TRYING TO
    COMPILE AND RUN THE PROCEDUREShould he make sure that anybody is running the procedure?
    3.MAKE SURE THAT ANY PARALLEL QUERY IS RUNNING IN THE
    SERVER SIDE,THATS KEEPS THE RESOURCE BUSYShould he make sure any parallel query is running in the server side to keep the resource busy?
    Gita,
    I COULDN'T RESIST HAVING ONE SUGGESTION FOR YOU. Please look at the impact of your English in the reply before posting. Check if that sends reverse message!
    Cheers
    Sarma.

  • Truncating leading zeros for the data

    hi ,
      I am doing a conversion project from oracle source system(DB2) to BI system. I have a situation here:
      I am extracting material numbers from source system(DB2) into a ZXXXX characteristic and in the transfer structure i checked the conversion as well and for infoobject ZXXXX, i am using ALPHA conversion. but the data i get is truncating material numbers. For example, 050302 is coming as 50302 and truncating leading zero. I am not sure what needs to be done here.
    Please advise..
    Thanks in advance...

    Hi J Dorson,
    This is the expected bahaviour if your InfoObject is configured to have ALPHA conversion. If the zero's in front of the material number is needed, then turn-off ALPHA conversion in your InfoObject (e.g. by removing the conversion exit).

  • I cant export my pdf to excel - Problem with conversion

    I cant export my pdf to excel - Problem with conversion
    Somebody is having this problem?

    Hi,
    May i know what is the challenge you are facing?
    Check with another file.
    You can try with different browser as well.
    Regards,
    Florence

  • Grid Download to Excel truncates leading zeros

    We are on tools 8.51. The download feature for a Grid now removes the leading zeros when the grid is downloaded to excel. Has anyone found a way to fix this issue ? Thanks in advance

    When you download from PS query, the output is created as a true binary xls file, but when you download from a grid in PT 8.51 the output file is html, even though the filename is ps.xls. You can open this file in a text editor.
    If you have all numeric data in a column, it will be stored as <td>nnnnnn</td> in the html file. if the column has mixed numeric and text data, it will be stored as <td>=&amp;quot;nnnnnn&amp;quot;</td>. The leading zeroes are still there in both cases, but when excel imports the first form it will convert the result to numeric, the second it will treat as text.
    Other than logging a case with Oracle, the only workaround I could think of would be to save the file to disk and run the macro directly against the html. Of course, this would likely be a major redesign.
    Regards,
    Bob

  • Cfselect with bind truncates leading zero

    Banging my head against this one. I have two cfselect menus using bind. The first one populates the second. It's working fine except for this one wrinkle: the second select menu gets populated with zip codes. If they have leading zeroes (e.g. 02842) the zero gets clipped. The datatype in MySQL is char(5).
    If I just throw a regular query on the data and dump it it comes back with the zeroes fine.
    Bug? Workaround?
    CF8 BTW.
    Thanks.

    Here is an example of related selects without using binds.  http://www.pathcom.com/~bracuk/code/RelatedSelects.htm
    It may or may not be appropriate for your situation.  I remember something on these forums a few years back about performance problems if you used this approach with too much data.

  • ALV download to excel problem

    Dear Gurus a problem in alv report downloading to excel:
    on executing the report works fine but when downloading to excel there last digit of bpvno is getting truncated.
    ex: actual bpvno:'4000010' but excel o/p shows as '400001'
    I have declared a field in final internal table as:
    data: bpvno as bseg-belnr,
    (in field catalog)
      fieldcatalog-fieldname   = 'BPVNO'.
      fieldcatalog-seltext_m   = 'BPV No.'.
      fieldcatalog-seltext_L   = 'BPV No.'.
      fieldcatalog-col_pos     = I1.
      fieldcatalog-emphasize   = 'X'.
      append fieldcatalog .
      clear  fieldcatalog.
      I1 = I1 + 1.
    but after specifying the  REF_TABLENAME & REF_FIELDNAME the downloaded excel o/p is correct.
    My questions is:
    1) i want to know what all are mandatory fields to be specified in fieldcatalog & is it compulsory to specify REF_TABLENAME & REF_FIELDNAME .
    if not complusory why the downloaded excel value is being truncated ???
    plz dont send materilas on alv and answer specific to the question....

    Hi,
    I wrote a small program, and for me it worked. My assumption about the seltext was wrong. And I also didn't use output lenght.
    Here is the code.
    REPORT  ZALVTOEXCEL                                                 .
    type-pools slis.
    data : gt_fcat type slis_t_fieldcat_alv.
    data fieldcatalog like line of gt_fcat.
    types : begin of t_belnr,
            bpvno like bseg-belnr.
    types end of   t_belnr.
    data gt_belnr type table of t_belnr.
    data gwa_belnr type t_belnr.
    gwa_belnr-bpvno = '4000010'.
    append gwa_belnr to gt_belnr.
    fieldcatalog-fieldname = 'BPVNO'.
    fieldcatalog-seltext_m = 'BPV No.'.
    fieldcatalog-seltext_L = 'BPV No.'.
    fieldcatalog-col_pos = 1.
    fieldcatalog-emphasize = 'X'.
    append fieldcatalog to gt_fcat.
    clear fieldcatalog.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       IT_FIELDCAT                        =  gt_fcat
        I_SAVE                            = 'A'
      TABLES
        t_outtab                          =  gt_belnr
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    regards,
    Advait.

  • Truncating Leading Zeroes

    Hi,
    What is the best method to truncate the leading zeroes of an alphanumeric data item? Is there an expression editor function that could do this?
    I have come up with a logic involving 3 - 4 actions that could do this for a specific data item. The problem is I have got about 5 different data items in the same transaction that need leading zeroes truncated. Whats the best thing to do here?
    Do I need to build a custom action or expression editor function?
    Regards,
    V M.

    Well, there are equivilants in every database. I think Oracle has something like LTRIM(value, '0')
    If your application doesn't use any databases and you are on 12.0 + you could estabish a connection to the neweaver db.
    You could also look into and xsl solution using the XSL Transformation action.
    I often do this to create/format lists for query filters or similar tasks.
    For some background this issue often comes up when pulling data from standard SAP interfaces. In sap Order and Material numbers are typically trimmed automagically by the gui. But when pulling those data elements from sap you get the full monty. This is ok because you often need the full untrimmed value to use with other interfaces, but users still expect the values to be trimmed when displayed. There are a lot of solutions to this issue in regards to the front end (xsl, Javascript, SQL in cases where the data is stored/cached in a local database ) but it would be convienent to have this level of formatting built into the link editor. Maybe even something that accepts a regular expression?
    Regards,
    Christian

  • SaveAsCSV() truncating leading zeros

    Hi
    We have used applet call saveAsCSV() and are experiencing the typical "leading zero" truncation since the value is being treated as numberic.
    I would like to know if there is any way of specifying certain fields as text other than inserting a character to force it to be a text field
    Thanks
    Deepa

    Hi Deepa
    This is actually a Microsoft Excel issue.  You cannot save a leading 0 in an csv file.
    I have tried doing this external to xMII and got to the conclusion that the file type CSV does not allow for leading zero's (I think this is the case with special characters in CSV files as well).
    Your best bet is to call a function to add leading zero's (something like a padding/stretch function) once you open the saved file.
    Regards

  • Download to excel problem

    Hi Friends,
    DATA lo_nd_hr_update TYPE REF TO if_wd_context_node.
      DATA lt_hr_update TYPE wd_this->elements_hr_update.
      DATA ls_hr_update TYPE wd_this->element_hr_update.
    navigate from <CONTEXT> to <HR_UPDATE> via lead selection
      lo_nd_hr_update = wd_context->get_child_node( name = wd_this->wdctx_hr_update ).
    @TODO handle non existant child
    IF lo_nd_hr_update IS INITIAL.
    ENDIF.
      lo_nd_hr_update->get_static_attributes_table( IMPORTING table = lt_hr_update ).
      DATA text   TYPE string.
      DATA xtext  TYPE xstring.
      LOOP AT lt_hr_update INTO ls_hr_update.
        CONCATENATE text ls_hr_update-mandt
                    ls_hr_update-pernr
                    ls_hr_update-effdt
                    ls_hr_update-upddt
                    ls_hr_update-ename
    ls_hr_update-aedat
    ls_hr_update-aenam
    ls_hr_update-sigempno
    ls_hr_update-signame
    ls_hr_update-emailid
    ls_hr_update-rejuvem
    ls_hr_update-rejuvey
    ls_hr_update-enrich1
    ls_hr_update-enrich2
    ls_hr_update-offdt
    ls_hr_update-status
    ls_hr_update-accdt
    ls_hr_update-tedempno
    ls_hr_update-tedname
    ls_hr_update-skill1
    ls_hr_update-skill2
    ls_hr_update-skill3
    ls_hr_update-skill4
    ls_hr_update-comments
    ls_hr_update-letter_rel
    ls_hr_update-reldt
    ls_hr_update-practice
    ls_hr_update-practext
    ls_hr_update-location
    ls_hr_update-email
    ls_hr_update-bill_date
                    cl_abap_char_utilities=>newline INTO text SEPARATED BY
                    cl_abap_char_utilities=>horizontal_tab.
      ENDLOOP.
      CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
        EXPORTING
          text   = text
        IMPORTING
          buffer = xtext.
      wdr_task=>client_window->client->attach_file_to_response(
    **path to the word file
          i_filename = 'WDP.xls'
    String Variable
          i_content =  xtext
    File Type
          i_mime_type = 'EXCEL' ).
    The problem is i'm facing is i'm unable to download all the contents.
    Is there any restriction on string size.....whether i need to increase string size....
    Is it the problem with table size it has more than 25 fields & around 150 reocrds but every time when i use above code getting arnd 11 rows of data.
    Kindly reply.
    Thanks.

    Hi,
    I did as folllow changes in my code .....
      DATA text   TYPE string.
      DATA text_s TYPE string_table.
      DATA xtext  TYPE xstring.
      LOOP AT lt_hr_update INTO ls_hr_update.
        CONCATENATE text ls_hr_update-mandt
                    ls_hr_update-pernr
                    ls_hr_update-effdt
                    ls_hr_update-upddt
                    ls_hr_update-ename
    ls_hr_update-aedat
    ls_hr_update-aenam
    ls_hr_update-sigempno
    ls_hr_update-signame
    ls_hr_update-emailid
    ls_hr_update-rejuvem
    ls_hr_update-rejuvey
    ls_hr_update-enrich1
    ls_hr_update-enrich2
    ls_hr_update-offdt
    ls_hr_update-status
    ls_hr_update-accdt
    ls_hr_update-tedempno
    ls_hr_update-tedname
    ls_hr_update-skill1
    ls_hr_update-skill2
    ls_hr_update-skill3
    ls_hr_update-skill4
    ls_hr_update-comments
    ls_hr_update-letter_rel
    ls_hr_update-reldt
    ls_hr_update-practice
    ls_hr_update-practext
    ls_hr_update-location
    ls_hr_update-email
    ls_hr_update-bill_date
                    cl_abap_char_utilities=>newline INTO text SEPARATED BY
                    cl_abap_char_utilities=>horizontal_tab.
        APPEND text TO text_s.
        CLEAR text.
      ENDLOOP.
      CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
        EXPORTING
          text   = text_s
        IMPORTING
          buffer = xtext.
      wdr_task=>client_window->client->attach_file_to_response(
    **path to the word file
          i_filename = 'WDP.xls'
    String Variable
          i_content =  xtext
    File Type
          i_mime_type = 'EXCEL' ).
    but it wil through type conflict error in fm 'SCMS_STRING_TO_XSTRING'
    pls suggest.......

Maybe you are looking for

  • My Phone Sorta Bricked Itself, Any Ideas?

    So here's my odd string of events. About a year ago, a good customer of mine gave me his 1st Gen iPhone when he got his 3G phone. This was very nice of him, although the phone wasn't in perfect condition. The back was a little dented and the hold but

  • PrevFrame() buttons in a swf file inserted in html not working in Firefox

    Hi! I have a very weird problem. I have created a photo gallery using AS3 in Flash CS5. I have used prevFrame() and nextFrame() actions for "previous photo" and "next photo" buttons as well as for "previous thumbnails" and "next thumbnails" buttons.

  • Problem with a form in the portal.

    Hi Masters, I'm getting this error in the portal when I'm executing a form. I'm the basis here but I need a hand because I can't find the solution to this. Thanks for the help! com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Error during

  • Twelsh0802

    I am getting an error message that says " There is a problem with adobe reader/acrobat. If it is running please exit and try again (0:104). It is not running I have uninstalled and reinstalled, same message. anybody have any suggestions

  • DVD pixelation since 10.4.5 update

    I think this has started since I did my last update, but DVD playback seems to be quite pixelated. Has anybody else noticed this? Or is it just me? It no longer smooths the pixels in fullscreen mode, it merely resizes them. The result is quite blocky