BADI to add leading zero to material in DP

Hello,
I wanted to check if there is a BADI that can be used while generating CVC (/sapapo/mc62) that will add leading zeros to the product number (9amatnr) while uploading CVCs from FLAT FILE.
Thanks,
Sanju

Hello,
I am basically trying to create CVC from a TAB delimited file using tcode /sapapo/mc62. The file will be loaded on Application server and  /sapapo/mc62 will pick up the tab delimited file in background. I want a FM or BADI that can pad leading zero in front of the material Characteristics when CVCs are generated.
Please advise.
I am not planning to load the file into infocube and generate CVC from infocube.
Thanks

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,

  • Add leading zero to matnr in a conversion program

    Hi All,
    When uploading matnr from a text legacy file , should i add leading zeroes to the sku value. For ex the data from the lagacy is 1000123456 (10 digits length). The values are always numbers. The matnr in SAP is 18 chars. Should my program transform it into 000000001000123456 before saving it into mara-matnr?
    Regards, Oli

    Are you sure that in configuration, the Indicator for lexicographical material numbers is unchecked?  If it checked, then SAP will not then the all numeric material numbers will not get leading zeros by default.   =====>
    Indicator for lexicographical material numbers
    Defines the way numeric material numbers are stored in the database.
    Use
    Caution
    It is only possible to set or reset (cancel) this indicator if no numeric material numbers have been used yet in the system since they would no longer be interpretable after setting or resetting this indicator.
    If this indicator is not set, numeric material numbers are padded with leading zeros and stored right-justified

  • 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

  • File rename doesn't add leading zeros to renaming files sequence? And a pat on the back to the LR de

    First of all, LR truly rocks. Any Adobe folk reading this, please take this note as a massive pat on the back for your team. There's a lot of childish and naive negativity from people posting in this forum. And I suspect from folk who are not really your key market for this app. I feed my kids by running a photography business and have been shooting digital since the early 90s...ya know...
    LR will be looked at as a massive sea change in the development of digital photography. The first time the entire workflow process is truly viable from end to end. What will make LR the ultimate winner in it's field is simply the integration with Photoshop. Aperture, Capture One etc cannot ever beat LR regarding this and so, just like the way that Excel and Word and Powerpoint all work together and everyone uses them, LR will inevitably become the de facto standard way of managing RAW images for pro photographers.
    Even with the few bugs (specifically file movingon Mac OS10.4.9) LR has shaved HOURS off our workflow. We shoot around 250 gigs of images a month in our weddings and event business. Now all of our editors use LR. No more Capture One etc for us.
    Here's the question - There seems to be no way to add leading zeros to a file rename command. So if you rename a batch of images they appear as 1,2,3,4,5,6,7,8,9,10,11,12 etc so now when I look at them in Bridge or other apps, they are now sorted 1,10,11, etc
    Now let me tell ya this is a pain.
    Any comments or comfort that is is a known issue would be appreciated. All we want is a way to have the rename add the leading zeros like most other apps do...
    Best to all
    William Henshall
    www.californiaweddingphotos.com
    PS By the way, I am a HARD *** about shoddy unstable software sold to pro photographers as the "prefect solution" that doesnt work as advertised...I am that guy that the tech support guys at certain companies dread. Yep, I simply expect an app to do what it says, just like the car I buy. I once resorted to sending the CEO of a certain software company an invoice for my time restarting, reinstalling the OS and bug finding another similar app. You can image, I got a personal call...heh...

    William-
    <br />
    <br />I just changed a folder of 85 images' names, and typed in 001 as my starting number. While no zeroes were prepended, the pix show up in order both in the Finder and in Bridge CS3.
    <br />
    <br />Say a bit more about file moving on your Macs.....
    <br />
    <br />
    <span style="color: rgb(102, 0, 204);">John "McPhotoman"</span>
    <font br="" /></font> color="#800000" size="2"&gt;~~ John McWilliams
    <br />
    <br />
    <br />
    <br />MacBookPro 2 Ghz Intel Core Duo, G-5 Dual 1.8;
    <br />Canon DSLRs

  • 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

  • Add leading zero's function

    Hey,
    can anyone tell me what is the java function for add leading zero's in xi mapping.
    TX

    Hi Zevik,
    As other threads mentioned used FormatNum and double click and put Zeros. Like if the lenght is 10 then put 10 zeros. Here one thing you should analyse is, if your input value has a string value it will fail in FormatNum becuase it expects only the numeric value.
    So if you dont know whether your input has numeric or alphanumeric then go to UDF. So create a udf with name AddZeros and as Value with one argument as input.
    Imports:  java.*;
    Then add this code:
    int len=input.length();
    for(int i=0; i<10-len;i++)
    input="0"+input;
    return input;
    Here I am assuming the total length is 10. If yours is 20 then put 20 instead of 10 in the second line of the code.
    Regards,
    ---Satish

  • How to add leading zeros to a characteristic in CT04

    The business is requesting that we change a class characteristic so that it adds leading zeros.  Currently the characteristic is set as numeric with length of 6, no decimals.  Is there any way via template or otherwise to force this characteristic to store leading zeros, as recorded against the characteristic?

    Hi David,
    1. If you are mentioning about the "Characteristics"This is Standard Field name.
    2. You will not be able to influence the same,
    3. Also i doubt if you are talking about the Characteristic Value - Since only in the Char Value we will be able to define the length, etc.
    4. In case of Charvalues if you want leading zeros then create it as character , where you can store with leading zero
    Reg,
    Dsk

  • 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

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

  • 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 add leading zeros ?

    Hi Friends,
    I have a shipment no say 10 char long . Now the thing is in my program I need to add leading zeros if the shipment no is not 10 char long .
    For eg : if the tknum is 99919 . I need to make use of a command to make it 10 char long lke 0000099919.
    Also I need to be able to add zeros if tkum is 5 or 7 or 8 char long .
    How do i add these leading zeros to fill up the remaining positions ?
    Thanks,

    hi ,
      use the following code.
    data : lv_vbeln(10) type c.
           lv_sonumber like vbak-vbeln.
    <b>This function module will convert the data into the required format based on the data type of the variable that you are passing in import paramter of the funcation module.</b>
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
              EXPORTING
                        INPUT         = lv_vbeln
                     IMPORTING
                       OUTPUT        = lv_sonumber
    Thanks
    mahesh

  • How to add leading zeros to kunnr field

    Hi All,
    I need to add leading zeros to KUNNR field runtime.
    i.e for some customer it is displaying '2001084606'
    some customer's it si displaying '10434'.
    I want add leading zeros when customer length is
    not equal to ten '10'.
    plz kind let me know this is urgent.
    Regards
    Bhaskar

    Hi there,,
    Kunnr is using a dataelement with Char 10.
    You can do in this fashion to resolve your issue.
    len = strlen (itab-kunnr).
    len is having the lenght of the customer number.
    if len < 10..
       while len < 10.
          concatenate '0'  itab-kunnr into temp_text.
          add 1 to len.
       endwhile.
    endif.
    now finally you can assign temp_text to your itab-kunnr.
    hope this way you can resolve your issue.
    if found helpful,, don't forget to reward points.
    Thanks-
    Rahul.

  • How to add leading zero using the toString() function?

    Hi,
    I've looked in the user manual and I can't find any reference to toString() for syntax information.  Isn't there a parameter for me to use to specify the string lenght?  And whether to add leading zeros or not?
    Here's the code I need to add leading zeros:
    playbutt.addEventListener(MouseEvent.CLICK, playSound);
    function playSound(e:Event)
    SoundMixer.stopAll();
    var num:Number = Math.ceil(Math.random()*43);
    bigNum.text = num.toString();
    var path:String = "Track No" + bigNum.text + ".mp3";
    trace(path);
    var s:Sound = new Sound(new URLRequest(path));
    s.play();
    The files I'm trying to open starts at "Track No01".
    Any ideas?
    Ron

    Thank you for the code replacement.
    By the way, instead of having the user click a button to start a random music file (MP3), I'd like to get the music going as soon as one loads a webpage and once the first tune is finished playing jump to another randomly selected music file (MP3).
    I've search via Google for ideas but couldn't find anything that came close to what I need done.
    Any ideas?
    Regards,
    Ronald

Maybe you are looking for

  • 10.5.7 update broke sharing on my G5 PowerPC

    So, silly me, I ran the 10.5.7 update on all my machines and now my G5 PowerPC has gone AWOL from the rest of my network and now file sharing and printer sharing are broken. I have an intel MacBook Pro and intel MacMini which I can connect to with no

  • How Far Does Lid open Macbook Retina 15

    Hi there Well my 3 year old son decided to jump on my 15" retina Pro and I think that he may have broken the stops that limit how far you screen can open I could be paranoid but can anyone confirm if this is the case ? My screen goes so far back  I j

  • Opengl not working in 10.4.7

    I implemented a cocoa application that renders lines and polygons to an OpenGL view. The application was working great in my MacBook Pro when I was running Tiger 10.4.6. After installing 10.4.7 the application stop drawing lines or polygons in wirefr

  • How to prevent setBoundingThemes returning null MBR when no data are found

    I am using setBoundingThemes method in MapViewer bean to zoom in to query results in a JDBCTheme. It is possible however that the JDBCTheme doesn't contain any data when no rows match the criteria. The result is that the other themes are queried with

  • LabVIEW using PCI-CAN, Error -2147136366

    Here is a little bit of background. I am trying to use LabVIEW with an old PCI-CAN device. I am using the DNet toolkit for industrial communication. This device has been used by my customer with a LabWindows application which uses the devicenet funct