How to remove leading ' in workbook?

Hi,
we are reporting queries via workbooks.
Yet, all values in the workbook (in the data area) start with 'xxx. eg. Instead of showing 3 it's showing: '3 as the content of excel cell.
How can I change my workbook in such a way (maybe via Format -> Style) that it automatically removes this '?
Regards,
Hans

Hi Hans,
In my experience, this is not true for every value in the query results.  Key Figures report as values.  Characteristics report as text.  Right?
This is only a problem when someone wants to do some calculations or comparisons on the data.  Which means that the user is adding either functions or macros to the workbook.  Functions or macros should be able to readily make the transformation of a number displayed as text to a number.
For example, if I have a credit limit that is displayed as '200.00 in cell B15, Excel will let me write an equation such as =B15+0.  The result will be a number in Excel.  A similar transformation will occur in Visual Basic.
I do not think you really want to do this for the results of every Characteristic.  If you think otherwise, you can use this to convert every cell in the query results:
Sub SAPBEXonRefresh(queryID As String, resultArea As Range)
Dim c As Range
    For Each c In resultArea
        If IsNumeric(c) And Not c = "" Then c = c + 0
    Next c
End Sub
- Pete

Similar Messages

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

  • 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 remove leading zeroes of a coloumn in a table

    can someone tell me how to remove the leading zeroes in a table's coloumn .... its a NUMC  data type..
    i tried with abap statement shift leading zeroes, but its not working for me.... the sorting is missing..
    in properties is there any option to remove the leading zerores>
    niraja

    Hi Niraja,
    I am displaying a table with information from SFLIGHT. The CONNID field is of type NUMC and so it too used to contain the leading zeroes.  I so deleted the leading zeroes in my WDDOINIT method before binding the internal table to the context node. The table now does not display the leading zeroes as earlier. Find my coding as shown below:
    METHOD wddoinit .
      DATA: lr_node TYPE REF TO if_wd_context_node,
            wa_sflight TYPE ig_componentcontroller=>element_node,
            lt_sflight TYPE ig_componentcontroller=>elements_node.
      SELECT * FROM sflight INTO TABLE lt_sflight.
      LOOP AT lt_sflight INTO wa_sflight.
        SHIFT wa_sflight-connid LEFT DELETING LEADING '0'.
        MODIFY lt_sflight FROM wa_sflight TRANSPORTING connid.
      ENDLOOP.
      lr_node = wd_context->get_child_node( name = ig_componentcontroller=>wdctx_node ).
      lr_node->bind_table( new_items = lt_sflight ).
    ENDMETHOD.
    Regards,
    Uday

  • How to remove leading zero in a inputfield

    I have a inputfield UI element which is bind to a NUM type context.  When it display a number, it always come with leading zero, like '001'. Can anyone teach me how to remove the leading zero.

    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/3a/2232666aeb45f4b759848a4caf9c8b/frameset.htm
    Use the Display leading zeros formatting option in the context attribute properties.
    The other option is to use a data dictionary domain for the field that has a built in field conversion exit. The ALPHA conversion exit is commonly used on NUMC fields like Sales Order number to suppress leading zeros.  The WD runtime will automatically use the underlying DDIC Domain Field Conversion Exit.  You don't need to do anything except use that DDic to define the context.

  • How to remove leading zeros

    I have a field 'Bill No.' of Character(10) type in my dialog program. Once I input and save value e.g. '1' in this it gets saved as 1 but in the internal table it gets stored as '0000000001'. Pls let me know how to remove these leading zeros: perhaps I'll have to use LTRIM but I am not sure.
    deepak.

    Hi
    Use the fm CONVERSION_EXIT_ALPHA_OUTPUT.
    DATA: P(10) VALUE '0000000001'.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
         EXPORTING
              INPUT  = P
         IMPORTING
              OUTPUT = P.
    WRITE P.
    Max

  • How to remove leading zeroes of string

    Hello All,
    I have a scenario where Partnumber string type shows 00000000012345 format, I want to remove leading zeroe and displ only 12345 .
    How to do it,
    Suggest

    Hi Pradeep,
      Please go through this wiki. [https://www.sdn.sap.com/irj/scn/wiki?path=/display/java/remove%252bleading%252band%252btrailing%252bzeros%252bfrom%252ba%252bstring]
    It explains how to remove zeros from strings.
    extract from the wiki. This is an efficient way.
    public java.lang.String removeLeadingZeros( java.lang.String str ){
         if (str == null){
               return null;
          char[] chars = str.toCharArray();
          int index = 0;
          for (; index < str.length();index++){
               if (chars[index] != '0'){
                    break;
         return (index == 0) ? str :str.substring(index);
    If you want to show this string in a table instead of the ones with zeros you can create a calculated attribute  of type string on the same node and in the getter method read the string with zeros using getAttributeValue() api and pass the string to the above method and return that string value.
    You can also have another approach if you will only have numbers in your string. Have a calculated attribute of type int. In the getter method read the String using getAttributeValue() api and then convert it to an int using Integer.parseInt(String) and return the int value.
    Regards,
    Sanyev

  • How to remove Leading zeros from MATNR "at Database Level"

    Hi,
    When we create a material in MM01 , we can either create material as Internal Material No. or External Material No. (By Explicitly entering a material No.)
    Our requirement is that: When we create an Internal Material , there should NOT be any Leading Zeros in MATNR.
    and for External Material No.  , Leading Zeros Should be there.  (In Database)
    1) Now , we can create the No. Range for material in such a way that it will allow only AlphaNumeric entries for Internal Material , and Only Numeric Entries for External Material No.
    This should slove the Purpose.
    But According to the Client's requirement , Material No can be Numeric OR Alphanumeric for Internal As well as External Material No.
    2) We can Add or Remove leading zeros from MATNR at application level.  i.e.  we can find some BADI / Enhancement where we will Use the Conversion FM (CONVERSION_EXIT_MATN1_OUTPUT or  CONVERSION_EXIT_ALPHA_OUTPUT) and remove Leading Zeros from MATNR. But these changes will NOT reflect at Database Level , Because in MATNR Domain , there is a conversion Routine  , That will Add Leading Zeros in MATNR While saving in the Database.
    3) While Displaying the Material In SE11 , we can also set the "Display Format" as With leading Zeros OR Without Leading Zeros.
    But we dont want to Just "Display" material with OR Without Leading Zeros.  we want to actually create materials in that way.
    What can we do , so that at Database Level our changes are Reflected.
    Thanks and Regards,
    Anand Gore
    Edited by: anandgore on May 18, 2011 3:47 PM

    That will Add Leading Zeros in MATNR While saving in the Database.
    That is because you have it configured that way.  You can configure the storage as you desire.  The default is the behavior you are describing.  You, or your functional analyst, need to review the documentation on the MM config settings for material master number storage.
    Never use CONVERSION_EXIT_ALPHA_OUTPUT for material conversion.  Also keep in mind that the MATN1 functions have their own BADI for extended formatting...

  • How to remove leading Zeroes in all fields in Payload

    Hi,
    How can I remove the leading Zeroes in every Filed I have in whole Payload Structure.there are around 10000 fields that have to be removed the leading Zeroes.any good idea please.
       <POSNR>000010</POSNR>
      <MATNR>000002465640</MATNR>
      <ARKTX>000012 KG D107</ARKTX>
      <MATKL>00030010000</MATKL>
      <WERKS>0000ORGC</WERKS>
      <LGORT>0000GC55</LGORT>
      <CHARG>000TEST</CHARG>
    like this mutliple segments and multiple Fields.so  I can take as whole payload with multiple fields should not have leading Zeroes.I can handle if they are 10 0r 20 fileds,but not like whole pay load/1000 fields right.
    thank you,
    Prem

    Hi
      You can have an additional XSLT mapping, to your existing one..
    use copy-of & apply-templates to copy the whole tree & make changes recursively.
    below is a sample code , the marked line is where you need to try your logic of trimming Zeros. (this code does upper case)
    add this below code in your interface mapping object, as XSLT mapping, which does the job (only try putting your logic)
    <xsl:stylesheet
                      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                      version="2.0">
                <xsl:output  method="xml"
                            indent="yes"
                            omit-xml-declaration="yes"/>
                <xsl:template  match="*">
                      <xsl:copy>
                            <xsl:copy-of  select="@*"/>
                            <xsl:apply-templates/>
                      </xsl:copy>
                </xsl:template>
                <xsl:template  match="text()">
                      <xsl:value-of  select="upper-case(.)"/>
                </xsl:template>
          </xsl:stylesheet>
    hope this fixes your issue
    Regards
    Vishnu

  • How to remove leading 'S' in target field

    hi
    i have to remove the leading 'S' in the target field, can some on help me with this reqmnt.
    regards
    manoj

    Hi Manoj,
    Check out : http://help.sap.com/saphelp_nw04/helpdata/en/d9/3033f96c79674f90e3ab8d101a595b/frameset.htm
    Activities
           1.      To create a new user-defined function, choose Create New Function (This graphic is explained in the accompanying text) in the data-flow editor at the bottom of the screen, on the left-hand side.
           2.      Specify the attributes of the new function in the subsequent window:
    Name:
    Technical name of the function. The name is displayed in the function chooser and on the data-flow object.
    Description:
    Description of how the function is used.
    Cache:
    Function type (see above).
    Arguments:
    In this table, you specify the number of input values the function can process, and name them. All functions are of type String.
           3.      In the subsequent window, you can create Java source code:
                                a.      You can import Java packages to your methods from the Imports input field, by specifying them separated by a comma or semi-colon:
    You do not need to import the packages java.lang.*, java.util.*, java.io.*, and java.lang.reflect.* since all message mappings require these packages and therefore import them. You should be able to access standard JDK and J2EE packages of the SAP Web Application Server by simply specifying the package under Import. In other words, you do not have to import it as an archive into the Integration Repository. You can also access classes of the SAP XML Toolkit, the SAP Java Connector, and the SAP Logging Service (see also: Runtime Environment (Java-Mappings)).
    In addition to the standard packages, you can also specify Java packages that you have imported as archives and that are located in the same, or in an underlying software component version as the message mapping.
                                b.      Create your Java source text in the editor window or copy source text from another editor.
           4.      Confirm with Save and Close.
           5.      User-defined functions are limited to the message mapping in which you created the function. To save the new function, save the message mapping.
           6.      To test the function, use the test environment.
    The new function is now visible in the User-Defined function category. When you select this category, a corresponding button is displayed in the function chooser pushbutton bar. To edit, delete, or add the function to the data-flow editor, choose the arrow next to the button and select from the list box displayed.
    Thanks,
    Pooja

  • How to remove leading zeros from the screen?

    Hello friends,
    I am working on dialog programming.
    I have a field with is NUMC 13. so when value is populated, It removes the leading zeros.
    How can I display the my value with leading zeros on the screen painter?

    Call SE51, layout, double-click on field, attributes, tab Program, check Leading zeros.
    Regards,
    Raymond

  • How to remove connect and workbook link after pressing Save as,Print,Export

    I have to remove the connect link and workbook link which appear AFTER pressing Save as,Printable Page,Export in a discoverer viewer report. I had already removed the link in the report itself with changing the uix files, but after pushing the link for export, save as or print the link Connect and Workbook still appear.
    I know that I have to change something in UIX Files, but which one and what I have to change...? Have anyone an idea? Thanx for fast reply, it´s a urgent problem.
    in addition: In metalink,otn and google were no solution...

    If the tone really is a single (or at least narrow band) frequency like the picture shows, I'd try the Notch Filter on the Audition/Effects/Filter and EQ menu.  It might take some playing around to get the exact frequency and tweak the amount of cut you apply vs. the effect it will have on surrounding frequencies--but if you can get the right balance, you can then easily apply this to the whole of every file.
    Sorry, can't help on the Premiere Pro question since I only use Audition.

  • How to remove lead selection in table dynamically

    I have a table in webdynpro which allows multiple selections of row. I have a button which is supposed to be clicked after selecting single or multiple rows. After clicking on the button I want to remove the lead selection of the  selected rows (which is shown in golden color for each selected row) .
    I tried REMOVE_SELECTED ELEMENTS and it works fine but only if i select the row by pressing CTRL. If i had selected a single row by just a mouse click (without ctrl) then it wont work.
    THANKS

    Hallo Amber,
    If_wd_context_node has static attribute no_selection. use that to clear the lead_selection_index.
    node->set-lead_selection_index(  if_wd_context_node=>no_selection ).

  • How to remove leading zeroes on form.

    Hi all,
       Is there a way that I can remove the leading zeros that come along with the Serial number from showing in my form.
    i.e for example: the value of &QALS-EMATNR&
    Actual value in the databse table is : "0280012380",
    Printing value on the form is            : "000000000280012380",
    Now I should get the actual value of the field EMATNR
       I had tried with the ways like..
    &QALS-EMATNR(Z)&
    &QALS-EMATNR(CIZ)&
      Is there any aternatives???
    Thanks,
    Surender.

    Hi
    If you print 000000000280012380 it means the value in the variable QALS-EMATNR is 000000000280012380.
    The field EMATNR has MATNR as domain, this is a type char long 18, it has the routines  MATN1 for input/output convertion and that routine doesn't delete the leading.
    I think the option Z works for type number only, so u need to delete the leading zero before printing the data.
    So just as somebody said u can use the fm CONVERSION_EXIT_ALPHA_OUTPUT in order to convert the output format, u should use it in driver program:
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
           EXPORTING
                input  = QALS-EMATNR
           IMPORTING
                output = QALS-EMATNR.
    If you can't change the program, u can create a routine (form) in a new program and call it by the sapscript:
    /: PERFORM DELETE_LED_ZERO IN PROGRAM ZPROGRAM
    /: USING       &QALS-EMATNR&
    /: CHANGING &QALS-EMATNR&
    /: ENDPERFORM
    * &QALS-EMATNR(Z)&
    So create the new program where defining the routine
    FORM DELETE_LED_ZERO TABLES IN_TAB   STRUCTURE ITCSY
                                                            OUT_TAB STRUCTURE ITCSY.
      DATA: MATNR TYPE MATNR.
      READ TABLE IN_TAB  WITH KEY NAME = ' QALS-EMATNR'.
      IF SY-SUBRC = 0.
        MOVE IN_TAB-VALUE TO MATNR. 
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
              EXPORTING
                   input  = MATNR
              IMPORTING
                  output = MATNR
        READ TABLE OUT_TAB  WITH KEY NAME = ' QALS-EMATNR'.
        IF SY-SUBRC = 0.
           MOVE MATNR TO OUT_TAB-VALUE.
           MODIFY OUT_TAB INDEX SY-TABIX.
        ENDIF.
    ENDIF.
    ENDFORM.
    Max

Maybe you are looking for