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

Similar Messages

  • Delete leading zeros for material in mapping.

    Hi,
    How to delete leading zeros for material like 0000000128736 if so I am expecting 128736 only.
    We need to consider if I get  material number is like RPG2389 .
    Thanks,
    Vinay.

    Hi,
    If you will be getting alphanumeric codes, it would be best to use a UDF with a regex-expression.
    UDF Type:
    ContextType
    imports:
    java.util.regex; (if you are using PI 7.1 you must remove the semicolon)
    arguments:
    input1
    Here's the code (courtesy of Sun Developer Network):
            Pattern p = Pattern.compile("[^a-zA-Z]");
            Matcher m = p.matcher(input1[0]);
            StringBuffer sb = new StringBuffer();
            boolean output = m.find();
            while(output) {
                m.appendReplacement(sb, "");
                output = m.find();
            m.appendTail(sb);
    result.addValue(input1[1]);
    Now to solve the leading zeroes, just add formatNumber: 0 after the UDF and it will work.
    Hope this helps,

  • Remove Leading zeros for Material in Transformation

    Hi Experts,
    I'm using DTP first time. I don't have much exp on DTP & Transformations.
    I'm creating infocube with some objects. I want to remove leading zeros for zmaterial.
    In 3.x writen update routines as fallows:
    data: zmat(18) type c.
    zmat = COMM_STRUCTURE-/BIC/ZMAT.
    shift zmat left deleting leading '0'.
    result value of the routine
      RESULT = zmat.
    I'm confusing in Transfermation where to write this routines.
    I'm writing in Transformation as fallows:
    data: zmat(18) type c.
    zmat = SOURCE_FIELDS-/BIC/ZMAT.
    shift zmat left deleting leading '0'.
    RESULT = zmat.
    But it's getting remove zero's.
    Anybody suggest on this.
    Siri

    Dear Sir,
    No confusion at all.
    Just double click on the Target Infoobjct i,e Material object in Transformation, you will see a wizard popping up.
    There you will see a option called "RULE TYPE" and the default value will be "Direct Assignment". In the same check box click on the drop down icon and select "Routine".
    The moment you select the routine option, it will open up ABAP workspace where in you can write your routine and get the desired result.
    Hope it helps.

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

  • Remove leading zeros for invoice lists to allow auto lockbox processing

    I have a change request for the following document at my job. but i am very new into it and do not know how to start and what to do exactly? can anyone please help me what to do in this matter.
    SAP auto posting process for lockbox checks was created to post cash with minimal manual intervention.
    Transaction FLB2 is used to import a lockbox file from Bank of America containing customer payment detail to auto match and clear invoices in the AR subledger. The auto post program tries to match an invoice number from the Reference field to the invoice # in the lockbox file which does not have any leading zeroes. In order to allow this match to happen a user exit was developed to remove any leading zeros from the Reference field in the invoices It works fine for regular invoices but not for the invoice lists u2013 invoice numbers in the 76xxxxxx range. The leading zeros are not removed there, so these invoices fall out of the auto posting process. It has been expressed that we need to improve our automated check posting hit rate for better efficiencies, and to do so we need to have these invoice list invoices fixed in the same way as the regular invoices are.
    please advise
    Vishal

    can anybody please answer it?

  • 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

  • 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

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

  • 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

  • Appending leading zeros to material number

    Hi,
    I want to form a object key for material number. so i need to append leading zeros to material number. but i am getting "TYPE CONFLICT" shot dump in FM 'BAPI_OBJCL_GETDETAIL'.
    The following code is giving the dump.
    data: wa_object(18) type c.
    wa_object = '100301010'. "Material No
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        INPUT         = wa_object
        IMPORTING
       OUTPUT        =  wa_object.
    CALL FUNCTION 'BAPI_OBJCL_GETDETAIL'
      EXPORTING
        OBJECTKEY              =  wa_object
        OBJECTTABLE            = 'MARA'
        CLASSNUM               = 'FINISHED_MATERIAL'
        CLASSTYPE              = '001'
        KEYDATE                = SY-DATUM
        UNVALUATED_CHARS       = ' '
        LANGUAGE               = SY-LANGU
      TABLES
        ALLOCVALUESNUM         = IT_ALLOCVALUESNUM
        ALLOCVALUESCHAR        = IT_ALLOCVALUESCHAR
        ALLOCVALUESCURR        = IT_ALLOCVALUESCURR
        RETURN                 = IT_RETURN
    but if I hard code to 18 characters, the following code is working fine:
    CALL FUNCTION 'BAPI_OBJCL_GETDETAIL'
      EXPORTING
        OBJECTKEY              =  '0000000000100301010'
        OBJECTTABLE            = 'MARA'
        CLASSNUM               = 'FINISHED_MATERIAL'
        CLASSTYPE              = '001'
        KEYDATE                = SY-DATUM
        UNVALUATED_CHARS       = ' '
        LANGUAGE               = SY-LANGU
      TABLES
        ALLOCVALUESNUM         = IT_ALLOCVALUESNUM
        ALLOCVALUESCHAR        = IT_ALLOCVALUESCHAR
        ALLOCVALUESCURR        = IT_ALLOCVALUESCURR
        RETURN                 = IT_RETURN
    Please tell me how to rectify the short dump which uses Conversion_exit_alpha_input.
    Thanks .
    Sankar

    Hi Shankar,
    When ever u pass parameters to any function module the type of parameters must match with the ones defined in function module. Here u defined ur object key like this
    data: wa_object(18) type c.(18 digits). But the in function module it referenced with BAPI1003_KEY-OBJECT (50 digits). So u have to define the variable with BAPI1003_KEY-OBJECT.
    Check this solution. It will work for u.
    data: wa_object(18) type c,
               wa_object1 TYPE BAPI1003_KEY-OBJECT.
    wa_object = '100301010'. "Material No
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    INPUT = wa_object
    IMPORTING
    OUTPUT = wa_object.
    wa_object1 = wa_object.
    CALL FUNCTION 'BAPI_OBJCL_GETDETAIL'
    EXPORTING
    OBJECTKEY = wa_object1
    OBJECTTABLE = 'MARA'
    CLASSNUM = 'FINISHED_MATERIAL'
    CLASSTYPE = '001'
    KEYDATE = SY-DATUM
    UNVALUATED_CHARS = ' '
    LANGUAGE = SY-LANGU
    TABLES
    ALLOCVALUESNUM = IT_ALLOCVALUESNUM
    ALLOCVALUESCHAR = IT_ALLOCVALUESCHAR
    ALLOCVALUESCURR = IT_ALLOCVALUESCURR
    RETURN = IT_RETURN
    Thanks,
    Vinod.

  • Leading Zeros for variable vlaues(Date)

    Hi,
    How to remove leading zeros for variable values.
    For example;
    Comapny Code by Auth: 007.2004(July 2004)
    How to take out the first two zeros or first zero.
    Any suggestions would be of great help.
    Regards,
    Suresh

    How is that related to sql develper?
    Did you read the forum title? - SQL Developer (Not for general SQLl/PLSQL questions)

  • 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

  • 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

  • CRM 7.0 Leading zeros on material in sales documents delta replication

    Hi
    During initial load of sales documents from ECC to CRM the item is replicated with leading zeros.
    The consequences is that CRM do not find the product and the crm order gets an error message that the product is not maintianed in product master.
    So my question is; how to replicate the order without leading zeros for items?
    BR
    Johan

    Hello Johan,
    You need to check txn:OMSL in ERP and you need to make sure that settings are in sync with CRM customizing path settings.
    SPRO>IMG>Cross-Applicaiton Component>SAP Product>Basic Settings-->Define O/P Format..
    Especially you need to check for the lexicographical flag.
    If this flag is set, then 0123 is different from 123.
    Hope this helps!
    Best Regards,
    Shanthala Kudva.

Maybe you are looking for

  • Time capsule not showing up in HD sidebar

    I have a Time Capsule, it is working but I can't seem to access it.  It used to be under Macintosh HD/devices but now it is not there.  What do I have to do to access it?  It is running through airport right now.  Do I need to reset it then start fro

  • Not receiving some emails

    I've had my Blackberry Curve 8330 (Verizon wireless) for just over a month.  Everyday my Blackberry doesn't receive some of my emails.   Here's an example of what happens.  I get of my emails sent to my blackberry & usually look at the right way, the

  • PSE 12 Photo Editor won't open

    Hi, I purchased PSE 12 in January 2014. It's been working just fine up until the other day. I went to open Photo Editor and it sent me to some other screen and asked me to login. Tried logging in and it said I wasn't connected to the internet yet I w

  • System preferences's not working

    system preferences wont open anymore, says that i cant open it because it may be damaged or incomplete 

  • Question About Multiple Choice/True/False Answer Alignment

    When I insert a multiple choice or true/false question, The second response (answer B for either question type, is mis-aligned with it's radio button: The Master Slide for these questions looks like this: I can't figure out how to align the answer wi