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

Similar Messages

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

  • 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

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

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

  • Reg:ALV, how to supress leading zeros

    Hi,
    Presently I am doing a report with ALV,
    Here I am getiing the ouput properly,that is i am able to display  emlpoyee number correctly but with leading zero's.
    I want to suppress this leading zero's as per the requirement.
    How to solve the problem.
    Thanks in Advance
    Irfan Hussain

    Hi,
    This is my field catalog decleration.
    Can just help me out with it.
    Still the problem is persisiting.
    DATA:RT_FCAT   TYPE SLIS_T_FIELDCAT_ALV,
         LS_FCAT   TYPE SLIS_FIELDCAT_ALV,
         POS TYPE I VALUE 1.
    CLEAR LS_FCAT.
    POS = POS + 1.
    LS_FCAT-COL_POS       =  POS.
    LS_FCAT-FIELDNAME     = 'PERNR'.
    LS_FCAT-TABNAME       = 'PA0001'.
    LS_FCAT-REF_FIELDNAME = 'IT_PA0001-PERNR'.
    LS_FCAT-REF_TABNAME   = 'IT_PA0001'.
    LS_FCAT-SELTEXT_M = 'Emp. Number'.
    APPEND LS_FCAT TO RT_FCAT.
    Regards,
    Irfan Hussain

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

  • 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

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

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

Maybe you are looking for

  • How do I add variables to different checkboxes without using the 'Export Value' and then add them together (if checked)?

    Hello, I am very new to JavaScript.  I would like to create a checkbox with a numerical value variable activated if the box is checked.  Unfortunately, I cannot use the 'Export Value' because I already need to use it for something else. Any help is r

  • MM related doc

    Dear All, anybody can send the configuration setting & basic setting document (MM) to below mail ID, Thanks Govardhan

  • Cannot receive art work "after" Cd's installed on I TUNES

    Hello! XP user here. 1) Installed entire library of CD's on ITUNES (very time consuming). 2) Then set up my account. 3) Then permitted the automatic updates. No album covers. Seems that the only way I can get it is through down-loading the CD's "all

  • Anyone using iZotope Ozone 3 to master?

    Is anyone using iZotope Ozone 3 to master? Dual 1.8Ghz G5 PB G4 1Ghz LP7.1.1 Motu 896   Mac OS X (10.4.5)   Reaktor 5.1 Reason 3.0.4 Live 5.0.2 Battery 2.1.1 Recycle 2.1 DFH 1.5.3

  • IPhone 5 Touchscreen Issues??

    Ever since I took my phone off of airplane mode after getting of a plane, the touch screen has been acting up. When I press the lock button to unlock my phone the touchscreen seems to be locked so i have to lock and unlock again in order to put in my