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.

Similar Messages

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

  • 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

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

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

  • Removing leading zeros for the quantity field

    Hi all,
    In my script form there is a quantity field, of 13 and 3 decimals , on the out put its taking that much space un neccesarily,and messing up.
    how to make this adjustable in the provided space.
    It always 3 digits and 2 decimal points in our case.
    Please help me out,
    Thanks,
    Praveen

    Hi,
    For removing leading zeros
    &V_VARIABLE(Z)&
    Thanks,
    Naren

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

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

  • Removing Leading Zeros

    Hi Friends,
    I need to delete leading zeros from material while loading to ODS and have tried followings options:
    CONVERSION_EXIT_ALPHA_OUTPUT
    Shift Variable LEFT deleting leading zeroes
    Both the options did not work in my case. I need to delete leading zeros from material. For example if source has material as "00000000002213749R" I was to convert it as "2213749R".
    Following is the code I am using in transformation:
    DATA: LV_MATNR(18) TYPE C.
    LV_MATNR = SOURCE_FIELDS-/BIC/Z9AMATNR.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
         EXPORTING
              INPUT  = LV_MATNR
         IMPORTING
              OUTPUT = LV_MATNR.
         RESULT = LV_MATNR.
    Also I tried the following code for SHIFT:
    DATA: LV_MATNR(18) TYPE C.
    LV_MATNR = SOURCE_FIELDS-/BIC/Z9AMATNR.
    SHIFT LV_MATNR  LEFT deleting leading zeroes
    RESULT = LV_MATNR.
    I tried both the option but could not get the leading zeros deleted. Can some one let me know whats wrong with the code, or is there any other option i can try for?
    Thanks,
    Manmit

    Hi amitesh,
                 Please try this code
    DATA: LV_MATNR(18) TYPE C.
    LV_MATNR = SOURCE_FIELDS-/BIC/Z9AMATNR.
    SHIFT LV_MATNR LEFT DELETING LEADING '0'.
      RESULT = LV_MATNR.
    Hope this will help u.....
    Regards,
    Yuvaraj.
    Edited by: sap_yuvaraj on Dec 13, 2010 12:54 PM

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

  • 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

  • Removing leading zeros in a column

    Hi,
    I would like to remove leading zeros of a column in a table. My Questions :
    1. Is it possible?
    2. Where is it better to truncate, in RFC or Web Dynpro?.
    3. If Possible, How can I do that.
    I appreciate your input.
    Thanks,
    Sunita.

    Hi Sunita,
           Please specify the datatype of the column that contains leading zeros, because if the data type of the column is integer then the leading zeros are automatically taken care.
    If your RFC return you int and you are assigning it to a String then the leading zeros will appear.
    For example, see the below simple ABAP Program. Just copy and execute it. You will see the difference.
    data: a type mara-matnr,
          str type string.
    select single matnr from mara into a.
    write a.
    str = a.
    write / str.
    Hope it helps you.
    Regards,
    Maheswaran.B
    Message was edited by: Maheswaran B

  • XmltoQuery removing leading zero

    Hi,
    I have a function that takes in a raw xml and covert to query.  The problem is any leading zeroes are gone.  For example, 000123 will become 123.  Is there any way or function in CF that will stop from removing leading zeroes?
    Thanks,

    Oh, sorry.  It's not the XML to Query problem but it's the cfquery problem.  When I cfdump the data, it shows 000123, but when I use <cfquery> to insert the data into a dabase, it strips the leading zeroes and in the db table it shows only 123.  Is there a function or something to prevent this?
    <cfoutput query="get_xml_data">
    <cfquery name="test" datasource="db">
         INSERT INTO table (id, name)
         VALUES (#get_xml_data.id#, #get_xml_data.name#)
    </cfquery>
    </cfoutput>

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

  • How to update the Field by  Remove Leading Zeroes in Entire table

    Hi all,
    I need an SQL query to update the Table by upadating a particular field(column) by removing all the leading zeroes for all the rows corresponding to that column.
    Ex:;
    Existing To be changed to::(New Table)
    A B New A New B
    000011 1 11 1
    000012 2 12 2
    000013 3 13 3
    Thanks in Advance,
    plz do reply soon..

    Come on, it's not that hard:
    UPDATE your_table
       SET yourcolumn = ltrim(yourcolumn, '0')
    ;You are aware, that you have to commit those changes afterwards, right? If you don't know, what UPDATE / COMMIT in an Oracle database means, you may want to take a look at the user guides first.
    C.

Maybe you are looking for

  • One Library for multiple users?

    I did not realize that the library would be tied to a specific user on a computer. Is it possible for 2 users to share the same library? I created a library under my log in, but my wife can not see it when she logs in. If we can't have just one libra

  • How can I stop hidden purchases from telling me about updates?

    I've hidden a purchase because it is no good, but its updates keep appearing in my update list. How can I stop this?

  • Inquiry on apple lcd displays

    anybody know the amount of time between each new model of diplay apple has put out...also when was the 30" display released, im trying to get a general idea of when apple might update the 30" display

  • IPhone 3g Yellow Screen

    So my new 3g iPhone screen has a yellow tint. My original iPhone does not. Is this a problem? Any one else notice this?

  • Forbidden Po num was rejected

    Hi All, I have the issue with error message. I reprocessed couple of times it, but its showing the same error mesage. Please let me know the solution for why its getting error. I have checked the SAP/XI/Engine is Active.   <?xml version="1.0" encodin