Removal of leading zeros?

Hi,
if my infoobject value is 9999 it is updated into cube as 0000009999.
How to write the routine to remove the leading zeros before the value?
shilpa

Hi,
  U can either use this function module also
CONVERSION_EXIT_ALPHA_OUTPUT
or
SHIFT <yourField> LEFT DELETING LEADING '0'
or
try NO-ZERO option of WRITE statement
or
Another way is to create another variable of type I and assign the value into it
example:
DATA: L_NUMC(08) TYPE N.
DATA: L_INT TYPE I.
L_NUMC = '00000018'.
L_INT = L_NUMC.
Result will be = 18.
Regards

Similar Messages

  • How can I remove the leading zeros on jpg files?

    I'm looking for a way to remove the leading zeros on over 1000 jpg files, without changing the remaining digits in the file name. Is there some automated "batch" script?
    i.e going from 003405607.jpg  to  3405607.jpg

    You could write an AppleScript. but it will be easier to get and use a third-party file renaming utility. I use the freeware NameChanger which works quite well.
    https://www.macupdate.com/app/mac/21516/namechanger
    Regards.

  • Removing (only) leading zeros in a string

    Hello experts.
    I need to remove the leading zeros from the material name in Crystal Report for Enterprise. I stared with function Replace and Trim and it's fine in case I specify the number of zeros to be removed.
    In reality number can be 00001103 or 00455601 and there is no way to know how many leading zeros. If I choose not to specify the number of replacements, all zeros will be removed with result 113 and 445561 which is not desirable one. I should get 1103 and 455601.
    What syntax would remove only leading zeros?
    Thank you,
    Victoria

    hi Victoria,
    you could do something like
    if isnumeric({your field}) then
         totext(tonumber({yourfield}),0)
    cheers,
    jamie

  • Removal of leading zeros for material no. in report

    hi
    my issue is that i have to remove leading zeros for material number when displaying in alv grid.iam getting output.but leading have to truncated automatically.
    eg: 000000000000000102
    the ouput should be 102.
    please do provide solution for this or any function module.thanks in advance.

    Hi Sanjana,
    while populating the internal table use the conversion exit available for MATNR. this will remove the leading zeros.
    oter possible way, declare the internaltable by referring the data element MATNR, i hope if you do this, it will delete the leading zeros automaticallt.
    or if you declare the internal table field as charecter type, use the ALPLA_CONVERSION_EXIT_INPUT ot OUTPUT function module to remove the leading zeros.
    Reward the points if it is helpful..

  • Removal of leading zero in &*BSID-SGTXT&.

    Hi ,
    I need to remove the leading zero from my sacscript fileld &BSID-SGTXT&.  When its &BSID-SGTXT& I can put &(Z)BSID-SGTXT&.*
    Since i am using &BSID-SGTXT&  insertion of Z before is not compressiving zero.*
    How to compress leading zero in &BSID-SGTXT&.   case.*Thanks *

    Hi Kiro,
    Don't post Duplicate threads,
    You can continue here till your Issues gets resolved.
    Removal of leading zero from &*BSIS-SGTXT&
    &(Z)BSID-SGTXT&. " Instead of puttin z at initial position change as below
    &BSID-SGTXT(Z)&.
    how to delete leading zeros in sap script
    Cheerz
    Ram

  • Removal of leading zeroes

    Hi guys,
    I have an infoobject MELEM.  It has values like '000000001234'.  I want to remove the leading zeroes in the output for the ODS, which is feeding to Cube and finally to MP.  Please can some one write the code for this on the update rules.  The infoobject has length 40 CHAR.
    Thanks,
    Jenny

    Hi Kamaljeet,
    Can you be little bit more specific about where to write the code? is it on the infoobject transfer routine? or in the update rule in the cube? i tried to write in the update rule of the cube. I don't want to change the info object globally. Because it is specific to my cube only. So, I want to write in the start routine like this:
    DATA:   l_myobj  LIKE /bic/myobj.
    but it is complaining, because it doesn't have the master data.  i know the declaration is wrong.  I got the error message like this:
    E:Field "/BIC/MASMBLYPN" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement.
    Can someone please help me?
    Thanks,
    Jenny

  • Removal of leading zero from &*BSIS-SGTXT&

    Hi ,
    *I need to remove the leading zero from my sacscript fileld &BSID-SGTXT&. When its &BSID-SGTXT& I can put &(Z)BSID-SGTXT&.
    *Since i am using &BSID-SGTXT& insertion of Z before is not compressiving zero.
    How to compress leading zero in &BSID-SGTXT&. case.*Thanks *

    Hi,
    Please try
    &SYMBOL(Z)& Suppress leading zeros &SYMBOL(C)& Compress blank spaces
    Hope it helps.
    Regards
    Hiren k.Chitalia

  • Remove the leading Zero from the Query output in SAP BW ?

    Hi
    Experts,
    Vendor Number loaded  as   (0000010076) from R/3 to SAP BW.
    How to remove  Prefix  of Zero for  the Vendor Number(0000010076)  from Quey outpt.
    Regards.
    ASIT

    Hi,
    Please check out this thread.
    Remove leading zeros
    Also check if there is any conversion routine used for that particular infoobject.
    If ALPHA conversion is selected for your infoobject then it will automatically take away the leading zeros at query level.
    Regards,
    AL
    Edited by: AL1112 on Sep 16, 2011 9:15 AM

  • Limit to remove extra leading zeros

    Hi All,
    Could anyone help me how to remove the extra leading zeros.
    For i_ausp-objek , it currently have 18 digits number. eg:000000000000000014
    How I can limit to remove only infront 8 digits leading zeros to 0000000014. Please help to make changes to my current code. Thanks.
      LOOP AT i_ausp.
          WRITE i_ausp-objek TO i_out-objek NO-ZERO.
          SHIFT i_out-objek LEFT DELETING LEADING space.
          WRITE i_ausp-mafid TO i_out-mafid.
          WRITE i_ausp-klart TO i_out-klart.
          WRITE i_ausp-atinn TO i_out-atinn.
          WRITE i_ausp-atwrt TO i_out-atwrt.
          WRITE i_ausp-obtab TO i_out-obtab.
    endloop.

    hi,
    try with the function module CONVERSION_EXIT_ALPHA_OUTPUT.
    pass the value '00000000014' and you will get the output as 14.
    pls reward if it is helpful.
    Regards,
    Sangeetha.A

  • Is there a way to remove the leading zero from the 24 hour time display in iOS8?

    In the previous versions of iOS, the 24 hour time format for some regions dropped the leading zero from single digit hours: 1:23 for example.
    In iOS8, it appears that once 24 hour time format is toggled, the time is always displayed as four numbers: 01:23 for example.
    Is there a way to revert to this older format without leading zeroes?

    Yes, a colleague of mine was able to figure it out. Just double-click the chapter title in the .aggr project. It places it into edit mode and allows you to remove the ".swf" extension as well as make any other changes to the name that you want. It's so easy now that we know how to do it, but it was tricky to figure out since the chapter list does not appear editable at first.

  • Leading zeros remove from FB05 for assignment field in process open items b

    Dear expert
    At present i am using the electronic bank statement completed OT83 & OT51configuration, when i am running FF-5 the EBS soft copy has been uploaded and created batch input session.
    I executed  batch input session and the transactions has been posting through FB05 for outgoing payment clearing  with assignment field ( where check number is laying correctly and matching EBS soft copy cheque number and SAP outgoing clearing account line item assignment cheque number ) in case of outgoing clearing is happening correctly.
    but where as i have a problem incoming clrg cheque number which is displaying in assignment field and updated when client using FF68(check deposit / collections).
    the user is punching all collections from customers using t.code FF68 and cheque number is updated with 6 digit number in the variant. it is like a JV.
    after posting batch input session the cheque is number displaying in assignment field. the cheque number is updated with 6 digit number. but in the variant cheque number width 6 digit only  but after posting FF68 & SM35 the system automatically taking leading zeros for the remaining length. Cheque number standard length in SAP 13 in table .
    total 13 digit length but user punched only 6 digit only, because the cheque number 6 digit numberonly. so the remaining 7 digits it is occupaying 0000000.
    while executing FF_5 and SM35  (thr FB05) the assignment field cheque number (0000000586585) and soft copy cheque number 6 digit (586585) is not matching , because of that i am unable to clear the incoming collections or incoming payments clrg.
    so how  can i remove the leading zeros after cheque number ( actually displaying 0000000586585 , but i want without zeros only cheque number 586585) in assignment field in FB05 using FF-5 & SM35).
    is there any enhancement or user exit to remove leading zeros or any other way of work around .
    Regards

    Hi Amareswar,
    In your case, request your bank to provide cheque number with leading zeros in electronic bank statement as the leading zeros in the assignment field is SAP system behaviour.
    Alternatively, use 'Define Search String for Electronic Bank Statement' (refer http://help.sap.com/erp2005_ehp_05/helpdata/EN/6d/0cdf4b142e11d3963800a0c9426c73/frameset.htm for details) in the IMG, customize it to search for the cheque number provided in the note to payee field > then append leading zeros.
    The first method is the solution we are using and it is the most cost effective.
    Hope the above helps.
    Kind regards,
    John Chin

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

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

  • 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

Maybe you are looking for