HOW TO TRUNCATE LEADING ZEROS  [ URGENT ]

A PROGRAM TO GET THE LENGTH OF THE SRVPOS [ SERVICE NUMBER]
BUT IN OUTPUT IT IS GIVING 12 LEADING ZEROS WHAT SHALL I DO TO REMOVE LEADING ZEROS AND TO GET THE LENGTH OF  THE SRVPOS [ SERVICE NUMBER] AFTER REMOVING LEADING ZEROS
TABLES: ESLL.
DATA: BEGIN OF IT OCCURS 0,
      SRVPOS LIKE ESLL-SRVPOS,
      END OF IT.
DATA:LEN TYPE I VALUE 0,
     IT1 TYPE I,
     IT2 TYPE C VALUE 0,
     N(15) VALUE'1000000000000'.
SELECT SRVPOS INTO IT FROM ESLL .
       IT1 = IT MOD N.
       IT2 = IT1.
       LEN = STRLEN( IT2 ).
       WRITE: / LEN,IT2.
ENDSELECT.

Hi Shailendra
We can use SHIFT LEFT command in this case.
Eg: SHIFT LEFT <var> DELETING LEADING '0'.
or FM: CONVERSION_EXIT_ALPHA_INPUT
data: var(10) type c value '0000000123'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
  EXPORTING
    INPUT         = var
IMPORTING
   OUTPUT        = var.
Kind Regards
Eswar
Message was edited by:
        Eswar Rao Boddeti
Message was edited by:
        Eswar Rao Boddeti

Similar Messages

  • 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

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

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

  • How to delimit leading zero in vendor number in OO ABAP ALV without using conversion routine

    Hi,
    How to delimit leading zero in OO ABAP ALV without using conversion routine, because I have many fields like vendor, customer, material number etc..
    How to address this leading zero.
    I appreciate your quick response.
    Regards,
    Nalini S.

    Hi Nalini,
    Delimiting leading zeros in fields has to be done via conversion routines, as suggested by Vadamalai you need to pass on the conversion routine name in you field catalog variable.
    Now as to which object oriented approach are you using to have your table contents display in ALV as it matters  -
    Using FACTORY method of CL_SALV_TABLE class, or
    Using SET_TABLE_FOR_FIRST_DISPLAY method of CL_GUI_ALV_GRID class.
    Using FACTORY method of CL_SALV_TABLE will do your own work, no need to apply any conversion routines or set long/medium/short text for columns as we do in field catalogs!
    Cheers,
    Varun

  • 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

  • Urgent........How to add leading zeros to negative values.....

    Hi,
    I want to add leading zeros to negative values.
    <b>Present Value    :</b> -567
    <b>Expected Value :</b> -0000000567
    I know to adding leading zeros with the help of CONVERSION_EXIT FM.
    Thanks in advance.
    Regards,
    Kumar.

    Hi
    Use below FM.
    CONVERSION_EXIT_ALPHA_INPUT
    Try out below FM with the above one.
    <b>CLOI_PUT_SIGN_IN_FRONT</b>
    <b>ISJP_GET_SIGN</b>
    or you can use
    <b>WRITE variable USING EDIT MASK '-___________'.</b>
    or
    <b>CONCATENATE syntax</b>
    Hope it will solve your problem
    <b>Reward Points if it is helpful.</b>
    Message was edited by:
            ilesh 24x7
    Message was edited by:
            ilesh 24x7

  • Truncate leading zeros

    Hi,
        How to truncate the leading zeros of a field?
        e.g:  if the value is '000000000080004040', it should like '80004040'.

    Hi
    pls use the fm CONVERSION_EXIT
    like
    Use this code for adding leading zeros for a particular field.
    i have used for p_kunnr to suppress zeros replace and use ur variable
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = p_kunnr
    IMPORTING
    OUTPUT = p_kunnr.
    Use this code for removing leading zeros for a particular field.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
    EXPORTING
    input = p_kunnr
    IMPORTING
    OUTPUT = p_kunnr.
    regards
    sathish

  • How to retain leading zeros in module pool screen

    Hi experts,
    I have a ztable field of type NUMC4 being displayed on a module pool screen, the value in the field is '0001', but on the screen it displays value as '1' (without leading zeros), When I save the record, Even in the databse it stores as '1'.
    But I have checked in debugging the field always contains '0001' in the program execution and I have also used 'CONVERSION_EXIT_ALPHA_INPUT' in the PBO but no use.
    Pls suggest.
    Thanks,
    Deepak

    Check the screen attributes for the field. There is an option to show leading zeroes.
    edit.
    And how did you see it was stored a 1 and not 0001? Using SE16N? Mind you: with SE16N conversion-exits are executed automatically thus showing 0001 as 1.
    To make sure: double click on the record in SE16N and look if it's still 1 and not 0001.

  • How to add leading zeros to a packed variable

    Hi all,
    I have a to add leading zeros for a packed field.
    eg.
    Data : brgew like mara-brgew.
    brgew = '12.063'.
    but I have to display the field as '0000000000012.063'.
    How can we achieve this?
    Regards.

    Execute the code .
    REPORT zex13 .
    Data : brgew like mara-brgew.
    brgew = '12.063'.
    data:val(18) type c,
         in(13) type n ,
         dec(6) type c.
    data :  a type i ,
            b type i.
            a = TRUNC( brgew ).
            write:/ a .
    in = a.
    write:/ in.
            dec = frac( brgew ).
            write:/ dec.
            concatenate in  dec+2(4) into val separated by '.'.
            write:/ val.
    see if this works for u .
    regards,
    vijay

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

  • 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

Maybe you are looking for

  • XS066EA pavilion dv6-3140EE

    My hard drive fail, so i replaced it with sata 3 solid state drive, but i i'm sure that i'm geeting only sata 2 speed by intel rapid storage technology and by benchnmark testing. My question is: do my board support sata 3 ,( I have been told that it

  • "No DAD configuration found" in Solaris Portal 3.0.7.6.2

    I get that message in the browser when trying to access my installed Portal 3.0.7.6.2 on Solaris What's the problem ?

  • Invalid query key

    I have the following class hierarchy A has a one-to-many relationship with B, B has a one-to-one relationship with C, C has a one-to-one relationship with D and D has a one-to-one relationship with E. B, C, D, and E each have a derived class B1, C1,

  • Passing the OUT parameter in method call after connection

    Hi,     I have created the rfc connection through SAP.net Connector. Now when i want to show all the data of the particular RFC. i need to provide all the fields name and the tables name in method call. In that method call i need to provide one param

  • How to install a Bose Soundlink?

    Dear all, My problem is, that my MacBook Air is not able to find the Bose Soundlink (USB connection). The Bose Sound System shows always that a "Computer" has been found, but the transport from my music on the MacBook to the Bose Sound System does no