Gui_Download - Suppress leading zero in EXCEL

Hello,
in my scenario I need to build an excel file in which some of the information they need to be displayed in excel with the leading 0 in front (type-lqua lgort 0701 ) thing does not happen in my view.
I create the Excel file like this:
   CALL FUNCTION 'GUI_DOWNLOAD'
     EXPORTING
= BIN_FILESIZE
       FILENAME = filename
       FILETYPE = 'ASC'
APPEND = ''
      WRITE_FIELD_SEPARATOR = 'X'
     TABLES
       DATA_TAB = tb_out
I have read in some posts that just insert a character " ' "   to show everything as text, however, this does not fit in my case because my file is the input to another application (not mine) that reads the file with the FM' ALSM_EXCEL_TO_INTERNAL_TABLE '
How can I view the file directly without suppressing leading 0 ?
Thanks in advance

try this
instead of gui_download use this to download into excell file.
DATA: XL_itab type alsmex_tabline occurs 0 with header line.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
      FILENAME    = FILENAM
      I_BEGIN_COL = 1
      I_BEGIN_ROW = 2
      I_END_COL   = 3
      I_END_ROW   = 5000
    TABLES
      INTERN      = xl_itab.
* EXCEPTIONS
* INCONSISTENT_PARAMETERS = 1
* UPLOAD_OLE = 2
* OTHERS = 3 .
  IF SY-SUBRC = 0.
* MESSAGE 'DATA UPLOADED SUCCESSFULLY' TYPE 'I'.
  ENDIF.
  loop at xl_itab.
    case xl_itab-col.
      when '1'.
        <your workarea-fieldname> = xl_itab-value.
      when '2'.
         <your workarea-fieldname>  = xl_itab-value.
      when '3'.
         <your workarea-fieldname>  = xl_itab-value.
    endcase.
    at end of row.
      append<work area> to <internal table>.
      clear <workarea>.
    endat.
  endloop.
if you have more doubts just reply me

Similar Messages

  • Display key and text in dropdown box & suppress leading zeros in material #

    Hi Everyone,
    I have some questions on how to ....  Can anyone help me?  Here they are:
    How to show material # and description (key and text) both in dropdown box list? 
    How to suppress leading zeros in material #, i.e. 0000000012345678 only show 12345678 ?
    How to show a date with format mm/dd/yyyy not yyyymmdd?
    Thanks alot, Jin
    Edited by: Jin Freda on Mar 25, 2008 4:47 PM

    Hi,
    What type control you are useing for date .
    If you are useing Input field of date type or Date picker control you should get this option in the control properties.
    Can you tell me what are  tabs are appaering in the conrtol properties.
    2.When you you are using the formula Round(@material) ,Are you typing it or draging Field from right side in to  the formula .If you did not drag it you will get Message:Formula has errors.
    One more probelm is there if the Data type of field where you using formula is not Number type.
    Check all above and get back to me.
    3.You are not able to give 6 points for all because its a resrticed one you execeded giving6 points option now you can give only 10 points.
    Regards,
    GOVINDU

  • 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

  • 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

  • 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

  • Suppressing Leading Zeroes in the Query output

    Hi,
    I have selected a data field(0MATERIAL) as a free characteristics, It displays text and key and the key has leading zeroes.
    In the infoobject 0MATERIAL, ALPHA conversion routine is not selected, I can't change and insert the ALPHA right now because it would end up with reloading a large volume of data in different targets. To avoid this or to reduce the impact, in the reverse way,
    Could it be possible to suppress this leading zeroes at the query level? I was hoping that there would be a change that I could make at the query level, since it is 0Material and am looking at the point of minimal impact.
    Thank You.

    Hi Senthil,
    create InfoObject ZMATERIAL like a copy of 0MATERIAL, delete all the attributes and insert ALPHA conversion.
    Insert this ZMATERIAL like display attribute of 0MATERIAL. In InfoSource for 0MATERIAL map also ZMATERIAL with the same field that is feeding 0MATERIAL (MATNL). In your query insert 0MATERIAL and ZMATERIAL, and then hide 0MATERIAL (you need to insert also 0MATERIAL because ZMATERIAL is only in display), you will see only the values of ZMATERIAL, that is the material without the zeros in front.
    You can also decide to transform ZMATERIAL like navigational attribute, but in this case you have to change all the structure where do you want ZMATERIAL, because you need to flag it like navigational in that specific structure.
    Ciao.
    Riccardo.

  • Leading zeros in excel

    Hi,
         I am trying to load a flat file in .csv format but whenever I open the file I am losing the leading zeros. It is very cumbersome for me to do those changes in notepad.
    Does one know how to keep the leading zeros even when I open in excel and edit and save? I changed the format of that column to text but if I close the file and next time I open the file, it is again back...
    ANy suggestions please?

    Hi,
      In excel, make the columns as text and save it. Then save as .csv format. But dont open the csv file becoz if you open, it will get its orginality back. So if you want to see whether it is in text format or not just open the csv file in notepad format. Now you can see leading zeros in the notepad. Without opening the csv file only, load the file.
    Regards,
    Bindu

  • Suppress leading zeros for ALV column

    Hello,
    I have an ALV with a column mapped to a context attribute of type NUMC and would like to suppress the leading zeros being displayed.  My initial solution was to change the attribute to a char/string type and remove the zeros in my code, but then, the sort functionality no longer works correctly.  Any ideas if the ALV can use a 'hidden' field to do the sorting for a certain column... that way, I can display the number as a char/string without the zeros and when the user sorts the column, the ALV will use the hidden NUMC type field.
    Thanx for any directions...

    Hi,
    You can follow the following way which i implemnted for one of my application. Here i am setting this property for the context attrubute. May be this will work. But in ALV there is no separate method for this type of setting.
    **This method is used to display the Leading zeros for the Lot Number in Step-1
      DATA:
        node_do_not_change                  TYPE REF TO if_wd_context_node,
        node_d0130_sapmf05a                 TYPE REF TO if_wd_context_node,
        node_pstap                          TYPE REF TO if_wd_context_node,
        node_info                           TYPE REF TO if_wd_context_node_info,
        ls_fprops                           TYPE wdy_attribute_format_prop.
      node_do_not_change = wd_context->get_child_node( name = wd_this->wdctx_do_not_change ).
      node_d0130_sapmf05a = node_do_not_change->get_child_node( name = wd_this->wdctx_d0130_sapmf05a ).
      node_pstap = node_d0130_sapmf05a->get_child_node( name = wd_this->wdctx_pstap ).
      node_info = node_pstap->get_node_info( ).
      ls_fprops = node_info->get_attribute_format_props( 'VALUE' ).
      ls_fprops-null_as_blank = if_wd_context_node_info=>c_format_null_as_BLANK.
      node_info->set_attribute_format_props(
        name              = 'VALUE'
        format_properties = ls_fprops ).
    Warm Regards,
    Vijay

  • Suppressing Leading Zero in Date

    We are currently having a problem when running a query in BEX.  The date which displays as MM/DD/YYYY is suddenly displaying with the leading zero in the month and day supressed, for example "3/5/2006" instead of "03/05/2006".  This is interfering with macros in our workbook.  We recently implemented support packs but don't know if this is related.  Does anyone know how to fix this?  When running the same query from the Query Designer the dates display correctly, without the leading zeros suppressed.

    Hi adadms,
    Plz check ur system settings.
    Go to control panel : regional options-Date
      check with short date format.
    it may be d/m/yy.
    Thanks,
    sekhar.

  • How To Suppress Leading Zeroes

    Can someone give a new modeler a tip on how to suppress the leading zeroes in a field? Order number, for example, is returned with many leading zeroes, and each dynamic expression I choose doesn't seem to work.
    Thanks in advance!

    As I said before, the easiest way I know to do this is to take your data, order number string "0000000000001234567", translate it to an integer - 1234567 - then re-translate that to a formatted string.
    I have actually come up with an answer, but am not sure that I like how it has to be done. First, I changed the Control Type for field VBELN (order number) to "None". Then I created two additional fields in the output table view. The first is named fmtOrdNum. Its Control Type is "None", meaning it won't be displayed, and its default value is INT(@VBELN). The second field is named fmtOrdNum2. This field is displayed, and has a default value of NSTR(@fmtOrdNum, 'P'). The resulting output is what I wanted to see - leading zeroes are suppressed.
    The reason I'm not happy with this is that I'm not sure that two additional fields should have to be created. I'm looking for the place to tell VC to manipulate (format, in this case) the fields it's received from the BAPI before it places them on-screen. So additional questions remain:
    1. How do you instruct VC to apply formatting to a field before placing it on-screen? Is this done on Control Properties, and where?
    2. Can expressions be nested - e.g. NSTR( INT(@@), 'P') - and to what level?

  • Suppressing leading zeroes during mapping

    Dear All,
    I am having one requirement in which i want to compress all the leading zeroes for the material no only eg 0000123450 shuld be converted into 123450.
    Is there any standard function available which compresses the leading zeroes???
    Waiting for your valuable response.
    Regards,
    N.Jain

    Write a UDF like this ..
    public class test {
    public static void main(String[] args) {
      System.out.println(args[0].replaceAll("^0*",""));
    Also you can use XSLT for this.
    Try the XPath function number($string) in your XSLT and see if it does what you want. Since it turns any XPath object into a number, the leading zeros  won't appear.
    Use it ike this
    <xsl:variable name="a">
             <xsl:call-template name="removeLeadingZeros">
                 <xsl:with-param name="phone">
                     <xsl:value-of select="EVENT/ContactPhone"/>
                 </xsl:with-param>
             </xsl:call-template>
         </xsl:variable>
    <xsl:template name="removeLeadingZeros">
             <xsl:param name="phone"/>
             <xsl:message>
                 <xsl:value-of select="$phone"/>
             </xsl:message>
             <xsl:choose>
                 <xsl:when test="starts-with($phone,'0')">
                     <xsl:call-template name="removeLeadingZeros">
                         <xsl:with-param name="phone">
                             <xsl:value-of
    select="substring-after($phone,'0' )"/>
                         </xsl:with-param>
                     </xsl:call-template>
                 </xsl:when>
                 <xsl:otherwise>
                     <xsl:value-of select="$phone"/>
                 </xsl:otherwise>
             </xsl:choose>
         </xsl:template>
    Regards
    Aashish Sinha
    PS : Reward Point if Helpful

  • Suppressing Leading Zero's in an EvDRE Report

    Hello Experts,
    I am trying to create an EVDRE that suppresses any data that is less than 1 (For example, I have a .01 and a .05) and will prevent it from showing up in the report.  Does anyone know the best way of doing this?
    Thank you so much!
    David

    Dear David Flacks,
    BPC Excel could suppress null value automatically, null zero is no record in database. For your example (the signeddata=0.1), I do not think so. If you would like to suppress null value, please you give the value of Suppress Zero is Y in your Expansion settings table. And for the value 0.1 maybe you can use VBA Macro which runs after expansion all. a VBA macro contains logic for delete a particular cell base on value.
    Kind Regards,
    Wandi Sutandi

  • Leading Zeros Missing - When exporting data from ALV grid display to Excel

    Hi,
    Am exporting the data from ALV GRID DISPLAY to Excel sheet using standard toolbar icon 'Local file'
    the leading zeros displayed in the ALV output is missing in the EXCEL sheet.
    (eg)  in ALV o/p - 0029. 
            in Excel - Only 29 is appearing.
    As per the requiement i have to show the leading zeros in excel also.
    Pls help on this issue.
    Thanks in advance..

    Hi ,
      Please set the property  :
      wa_fieldcat-lzero = 'X' .
    when you are creating field catalog for display alv data .
    your prob will solved .
    Regards ,
    Nilesh Jain

  • Leading zeros in downloaded excel

    Hi,
    I'm facing a problem with truncated leading zeros in downloaded excel. Can anybody suggest me how to get those leading zeros in excel.
    I tried Function modules XXL_FULL_API and WS_DOWNLOAD, both did not work.
    Regards,
    Praveena

    Hi Praveena,
    check the following code.
    data : begin of itab occurs 0,
             matnr  like mara-matnr,
             maktx  like makt-maktx,
             matnr2 like mara-matnr,
           end of itab.
    itab-matnr  = '00000011111'.
    itab-maktx  = 'test1'.
    itab-matnr2 = '00000011112'.
    append itab.
    itab-matnr  = '00000033333'.
    itab-maktx  = 'test2'.
    itab-matnr2 = '00000044444'.
    append itab.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
      BIN_FILESIZE                  = ' '
      CODEPAGE                      = ' '
        FILENAME                      = 'D:\c.xls '
        FILETYPE                      = 'WK1'
      MODE                          = ' '
      WK1_N_FORMAT                  = ' '
      WK1_N_SIZE                    = ' '
      WK1_T_FORMAT                  = ' '
      WK1_T_SIZE                    = ' '
      COL_SELECT                    = ' '
      COL_SELECTMASK                = ' '
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
      TABLES
        data_tab                      = itab
      FIELDNAMES                    =
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_WRITE_ERROR              = 2
      INVALID_FILESIZE              = 3
      INVALID_TYPE                  = 4
      NO_BATCH                      = 5
      UNKNOWN_ERROR                 = 6
      INVALID_TABLE_WIDTH           = 7
      GUI_REFUSE_FILETRANSFER       = 8
      CUSTOMER_ERROR                = 9
      NO_AUTHORITY                  = 10
      OTHERS                        = 11
    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,
    nagaraj

  • 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

  • Table error - Context Path Cannot Be Resolved (Last Node Is Empty)

    Hi All, I am dynamically building up a context node called PoList which is used to hold the contents of a table. My BAPI is called and a routine transfers the contents of the BAPI context node across into the POList context node. This is rendered cor

  • Sound is very quiet !

    Hi I recently bought a zen mp3 from 32 GB but now I've put some songs on it and the sound is very quiet, even when I put it on 25 ! my brother has a zen mp3 of 8 GB and his sound is very loud at 25. Does anyone knows how i can get the songs to play l

  • How do I set my iTunes to start from current song on my iPhone 5?

    How do I set my iTunes to start from the current song on my iPhone 5?

  • Facing an error when change the sysadmin password

    hi expert, when i am going to change the sysadmin password i m facing the below error on linux  in production environment. i cant understand why this error occured. i change the sysadmin password many times but never get any error. when going to chan

  • How to store images on Data Base?

    Could anyone write a simple example about storing images on database? Just write on this example: create table image_test image_item (type?) insert into image_test values (?); Thx!!