Auto generation of  Item Code

Hi Experts,
Is it possible to create auto generation of Item Codes in SAP B1?
E.g Customer want specific format say ... I000001---- I9999999
tks,
SB1

Dear,
You posted the same thread twice.
Check you previous thread for reply :
Re: Auto generation of  Item Code
Hope this will help u.
Thanks,
Neetu

Similar Messages

  • Auto generation of Item Code And Business Partner

    Hello All,
    My client want to create Auto generation of Item Code And Business Partner with some prefix value.
    Thanks
    Deepak

    Hi Dipak Patel,
    i created BP code by BP Group use FMS . you can refer code.
    declare @temp as char(20)
    IF $[OCRD.GroupCode] =100
    BEGIN
    set @temp=(select isnull(max(right(CardCode,5)),0) + 1 from OCRD where (GroupCode =100) and (len(CardCode)=8))
    set @temp='C11'+isnull(replicate(0,5-len(@temp)),'')+@temp
    select cast(@temp as char(20))
    END
    ELSE IF $[OCRD.GroupCode] = 102
    BEGIN
    set @temp=(select isnull(max(right(CardCode,5)),0) + 1 from OCRD where (GroupCode =102) and (len(CardCode)=8))
    set @temp='C12'+isnull(replicate(0,5-len(@temp)),'')+@temp
    select cast(@temp as char(20))
    END
    ELSE IF $[OCRD.GroupCode] = 103
    BEGIN
    set @temp=(select isnull(max(right(CardCode,5)),0) + 1 from OCRD where (GroupCode =103) and (len(CardCode)=8))
    set @temp='C13'+isnull(replicate(0,5-len(@temp)),'')+@temp
    select cast(@temp as char(20))
    END
    ELSE IF $[OCRD.GroupCode] = 104
    BEGIN
    set @temp=(select isnull(max(right(CardCode,5)),0) + 1 from OCRD where (GroupCode =104) and (len(CardCode)=8))
    set @temp='C14'+isnull(replicate(0,5-len(@temp)),'')+@temp
    select cast(@temp as char(20))
    END
    ELSE IF $[OCRD.GroupCode] = 101
    BEGIN
    set @temp=(select isnull(max(right(CardCode,5)),0) + 1 from OCRD where (GroupCode =101) and (len(CardCode)=8))
    set @temp='V11'+isnull(replicate(0,5-len(@temp)),'')+@temp
    select cast(@temp as char(20))
    END
    ELSE IF $[OCRD.GroupCode] = 105
    BEGIN
    set @temp=(select isnull(max(right(CardCode,5)),0) + 1 from OCRD where (GroupCode =105) and (len(CardCode)=8))
    set @temp='V12'+isnull(replicate(0,5-len(@temp)),'')+@temp
    select cast(@temp as char(20))
    END
    ELSE IF $[OCRD.GroupCode] = 106
    BEGIN
    set @temp=(select isnull(max(right(CardCode,5)),0) + 1 from OCRD where (GroupCode =106) and (len(CardCode)=8))
    set @temp='V13'+isnull(replicate(0,5-len(@temp)),'')+@temp
    select cast(@temp as char(20))
    END
    ELSE IF $[OCRD.GroupCode] = 107
    BEGIN
    set @temp=(select isnull(max(right(CardCode,5)),0) + 1 from OCRD where (GroupCode =107) and (len(CardCode)=8))
    set @temp='V14'+isnull(replicate(0,5-len(@temp)),'')+@temp
    select cast(@temp as char(20))
    END
    ELSE IF $[OCRD.GroupCode] = 108
    BEGIN
    set @temp=(select isnull(max(right(CardCode,5)),0) + 1 from OCRD where (GroupCode =108) and (len(CardCode)=8))
    set @temp='V15'+isnull(replicate(0,5-len(@temp)),'')+@temp
    select cast(@temp as char(20))
    END
    ELSE IF $[OCRD.GroupCode] = 109
    BEGIN
    set @temp=(select isnull(max(right(CardCode,5)),0) + 1 from OCRD where (GroupCode =109) and (len(CardCode)=8))
    set @temp='V16'+isnull(replicate(0,5-len(@temp)),'')+@temp
    select cast(@temp as char(20))
    END
    ELSE IF $[OCRD.GroupCode] = 110
    BEGIN
    set @temp=(select isnull(max(right(CardCode,5)),0) + 1 from OCRD where (GroupCode =110) and (len(CardCode)=8))
    set @temp='V17'+isnull(replicate(0,5-len(@temp)),'')+@temp
    select cast(@temp as char(20))
    END
    thanks
    H2

  • Item Code Auto generation in item master UDF field

    Dear Expert,
    I want to Generate automatic item code in the item master U_STY UDF field . the number start with 'SL' prefix 
    like this  'SL000001' and continue when i generate next item master.
    for example 'SL000001' for X item . when add next item Y  then item nuber will be 'SL000002'.  kindly help me.
    thanks.
    sridharan
    Edited by: Sridharan.R on Oct 28, 2011 10:02 AM

    Hi!
    Try this
    declare @temp as char(15)
    IF (Select max(Itemcode) from OITM ) IS Null
    BEGIN
    set @temp = 'SL000001'
    select cast(@temp as char(15))
    END
    set @temp=(select max(right(ItemCode,6)) + 1 from OITM )
    set @temp='SL'+isnull(replicate(0,6-len(@temp)),'')+@temp
    select cast(@temp as char(15))
    END
    Regards,
    [Thanga Raj K|Q3 Wrap-Up: What happened in the third quarter of 2009 in the SAP Business One Community]

  • How to generate item codes automatically

    Hi,
    My customer wants that the inventory item code be generated automatically based on its description. The code should have:
    - 3 first characters of the description
    - A sequential increased number, to make the code unique.
    e.g. the item called "Petrol" should have the code "pet004".
    To achieve this, I have created a database procedure. So the user that works in "Item Master" form, will fill out "description" field and the "Item" field should be automatically populated based on the return value of this procedure.
    Is there any way how to achieve this through personalization?
    Or, is there any standard way that Oracle offers for automatic generation of item codes?
    Thank youl

    Hi,
    You have to do it using forms personalization.
    Thanks,
    PS.

  • Item Code Auto Generation Based on User defined Tables

    I need the Item code like
    PRODUCT TYPE-ITEMGROUP-ITEMCODE-SUBITEM-BRAND-COLOR  e.g .FG-01-01-00-001-00.
    I created the following User define Tables and link to Item Master data
    U_PRO             - FOR PRODUCT TYPE
    U_GROUP        - FOR  ITEM GROUP
    U_ITEMCODE    - FOR ITEMCODE
    U_SUBITEM       - FOR SUB ITEM
    U_BRD              - FOR BRAND NAME
    U_COLOR         - FOR COLOR
    i need a formatted search in Item code to fetch the codes from the user defined  table
    i tried with the following
    SELECT T5.[Code]'-'T2.[Code]'-'T3.[Code]'-'T4.[Code]'-'T0.[Code]'-'T1.[Code] FROM [dbo].[@BRD]  T0 , [dbo].[@COLOR]  T1, [dbo].[@GROUP]  T2, [dbo].[@ITEMCODE]  T3, [dbo].[@SUBITEM]  T4, [dbo].[@PRO]  T5 INNER JOIN OITM T6 ON T5.Code = T6.U_PRO WHERE
    T5.[Code] = T6.[$U_PRO] AND 
    T2.[Code] = T6.[$ U_GROUP] AND
    T3.[Code] = T6.[$U_ITEMCODE] AND
    T4.[Code] = T6.[$U_SUBITEM] AND
    T0.[Code]  = T6.[$U_BRD] AND
    T1.[Code]  = T6.[$U_COLOR]
    showing errors. Can any one help me regarding this. I badly need the query for Auto generation of Itemcode

    Hi,
    How can you assign those UDF value without ItemCode in the first place?
    Thanks,
    Gordon

  • Auto item code generation

    Hi Friends,
    My problem is this. My client is want automatic item code generation so how I can do this can you please suggest me.

    Hi Naveen,
    I found these two fms's which would enable automatic item code generation. See if it helps you.
    declare @temp as char(20)
    IF $[OITM.ItmsGrpCod] = 101
    BEGIN
    set @temp=(select isnull(max(right(ItemCode,4)),0) + 1 from OITM where (ItmsGrpCod= 101) and (len(ItemCode)=7))
    set @temp='DRM'+isnull(replicate(0,4-len(@temp)),'')+@temp
    select cast(@temp as char(20))
    END
    ELSE IF $[OITM.ItmsGrpCod] = 102
    BEGIN
    set @temp=(select isnull(max(right(ItemCode,4)),0) + 1 from OITM where (ItmsGrpCod= 102) and (len(ItemCode)=7))
    set @temp='PKG'+isnull(replicate(0,4-len(@temp)),'')+@temp
    select cast(@temp as char(20))
    END
    And:
    DECLARE
    @NUM AS CHAR(7)
    SET @NUM =
    (SELECT RIGHT(MAX(CardCode), 7) FROM OITM)
    SET @NUM = @NUM + 1
    BEGIN
    IF @NUM IS NULL OR @NUM = 0
    BEGIN
    SELECT 'I0000001'
    END
    IF @NUM < 10
    BEGIN
    SELECT 'I000000' + @NUM
    END
    IF @NUM > 9 AND @NUM < 100
    BEGIN
    SELECT 'I00000' + @NUM
    END
    ----COMPLETE THE CODE
    END
    Thanks,
    Joseph

  • Item Code Generation

    Dear Friends
    I want to generate a Item Code with the following method :
    catgory - 1 digit
    costcenter - 3 digit
    equipment - 4 digit
    srno - 4 digit
    for ex
    bearing 14" xxx then could sould be 1-100-1001-0001 (110010010001)
    rightnow i had given the following code but i am unable to get the last 4 digit based on (category+costcenter+equipment + max(srno) of the perticular category+costcenter+equipment
         t:=:catcode||:costcode||:equipcode;
    sandy

    Hello,
    Assuming that last 4 digit are serial number and will get increase by one depend on three fields as you mentioned. Then try your code like this...
    SELECT :catcode||:costcode||:equipcode||(LPAD(MAX(TO_NUMBER(SUBSTR(actual_field_name,9))+1),4,0))
    INTO :form_field_name
    FROM table_name
    WHERE catcode=:catcode
    AND costcode=:costcode
    AND equipcode=:equipcode;Or if you don't want to generate code on basis of three field then remove the where clause and use only...
    SELECT :catcode||:costcode||:equipcode||(LPAD(MAX(TO_NUMBER(SUBSTR(actual_field_name,9))+1),4,0))
    INTO :form_field_name
    FROM table_name;
    actual_field_name this the name of field for which you will generate code.
    -Ammad

  • Batch number auto generation nedded

    hi all,
                  i have a query that when i make a GRPO of 10 items with different qty, these items are set to batch on every transaction, then it will ask to enter the batch number of all item with the number of their quantity, is there any process to create these batch number automatically, is there any formatted search query for auto generation of batch number.
    even they are making GRPO by taking 100 items, it is very difficult to for them to to enter manually all the batch code.
    is there any provision to do the task by formatted search.
    revert back soon
    its very urgent
    regards
    sandip

    Sandip, 
    I have answered a few posts on this Forum about the different options.  Formatted searches can be considered but you will need to maintain a temp table.
    What is the real usage of the batch numbers in this business case?
    Suda

  • Auto Generation

    how to generate auto generation number
    its urgent
    advance thanks
    by nathan

    Hi this is the code for autogenerating BP code
    You can make changes according to ur requirement.
    Sub BPAutoGeneration(ByVal CardType As String, ByVal Profit As String)
            Try
                Dim oRs As SAPbobsCOM.Recordset = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                oRs.DoQuery("Select (CASE WHEN max(CAST(substring(CardCode,5,len(CardCode)) as int)) IS NULL THEN '1' ELSE max(CAST(substring(CardCode,5,len(CardCode)) as int))+1 END) from OCRD Where U_PrftCntr='" & Profit & "' and CardType='" & CardType & "'")
                Dim NextNum As String = Trim(oRs.Fields.Item(0).Value)
                Dim Auto As String = ""
                For i As Integer = 7 To NextNum.Length Step -1
                    Auto = Auto & "0"
                Next
                Auto = CardType & Profit & Auto & NextNum
                BP_Form.Freeze(True)
                BP_Form.Items.Item("5").Specific.Value = Auto
                BP_Form.Freeze(False)
            Catch ex As Exception
                oApplication.StatusBar.SetText(ex.Message)
            End Try
        End Sub
    regards:
    Sandy

  • Pull item code based on UDF

    Wondering if something like this is possible...
    We have a UDF in Item Master Data that contains our "web site item code" an alternate itemcode we use for sales on our web site.
    Is it possible to add a UDF (call it WebCode) to the row level of a Sales Order and create a formatted search that will:
    As I type a "WebCode" into the UDF field of Sales Order and then tab off, it will populate the Item No. field with the ItemCode associated with the UDF contents of an Items Master Data.
    I might not be explaining the concept correctly. Please let me know if I should clarify anything.
    Thanks,
    -Steve

    Hi Steve,
    Since you already created a UDF (assuming your field name is WebCode) on item master, you can create another UDF under the row level of marketing documents (also called WebCode).
    You don't need to type anything. Instead, you can create a FMS to link the item U_WebCode to this new UDF in the Marketing document and auto fresh will do the job.
    The FMS for the new UDF looks like:
    Select U_WebCode from oitm where itemcode = $[$38.1.0]
    Thanks,
    Gordon

  • Auto select new item in tree

    Hi
    I have a tree that i allow user to drag and drop items to it - what is the easiest way so the new item is automatically selected? ie, tree.selectedIndex should point to the new item's index.
    Unfortunately it thought this was easy apparently it was not - like if the nodes in the tree control are collapsed, the selectedIndex is different than when all the nodes are expanded.
    Do note that the way i populate my tree is through a data provider - so i populate a class that would become the tree's data provider, so when the tree refreshes, i simply do this:
    myTree.dataProvider = project.p;   
    I can track where my new item was inserted in my "project" instance - but like i said earlier, the tree itself have different selectedIndex when the nodes are collapsed and when they are not.
    THanks

    Hi,
    I just posted a demo and source code on my blog: Auto select New Item in Tree component
    In above example i use loopAndFind() custom function.
    Hope it helps!
    Mariush T.
    Blog: http://mariusht.com/blog/

  • How to stop auto generation of ids for h:dataTable

    I am using <h:dataTable> tag to display more than one error messages.
    My code goes like this
    <h:dataTable id="messagetb" value="#{searchZug.searchZugParam.allMessages}" var="message">
    <h:column>
    <h:outputText style="color:red;" value="#{message}" />
    </h:column>
    </h:dataTable>
    When i run my application, console is displaying a message like
    'WARNING: Component _id79 just got an automatic id, because there was no id assigned yet. If this component was created dynamically (i.e. not by a JSP tag) you should assign it an explicit static id or assign it the id you get from the createUniqueId from the current UIViewRoot component right after creation!'
    I checked in the generated html source. It is generating id for tbody as 'messagetb:tbody_element', this is causing the problem.
    How can i stop this auto generation of ids? if not possible, then how can i explicitly specify the id for tbody?
    Thanks,
    Murthy

    Narasimha.Murthy.d wrote:
    I am using JSF version 1.3There exist no "JSF 1.3". When talking about "JSF" without mentioning the implementation name, we assume it as JSF specification. The JSF specification is only been available as 1.0, 1.1, 1.2 and 2.0. As said before, we´re more interested in the JSF implementation name. Is it Apache MyFaces? Is it Sun RI or Sun Mojarra? And then please tell the version from that.

  • Formatted Search is not auto-refreshed when Item Description changes

    Hi all,
    I have a UDF "Packing Details" at Goods Receipt screen row level.
    My formatted search setting is the field should be auto-refreshed when Item No is changed.
    1) I press TAB at Item No and choose an Item, Packing Details UDF will auto-refresh. (No problem)
    2) However, if i press TAB at Item Description and choose an Item, Packing Details UDF will not auto-refresh. I need to press SHIFT+F2 to make packing details appear.
    I try the same setting at Goods Receipt PO, the Packing Details UDF will refresh automatically regardless i choose the item from Item No or Item Description.
    Is anyone face this problem before?
    Thanks.
    Regards,
    Lay Chin

    Thanks Gordon.
    I have told this to customer before, but they prefer to have 'Refresh' on both Item Code and Item Description.
    I think we have no choice but let the customer to choose either one, right?
    Thanks.
    Regards,
    Lay Chin

  • Auto select an item in a child node of a TreeView UI control?

    Hi There,
    I'm having some issues with a TreeView control in my UI that I cannot seem to resolve, and thought I would ask if anybody here has done this type of thing.  My TreeView is made up of a collection of nodes, each with some child items.  When the window containing the TreeView displays, I populate it with the nodes.  I want to be able to script the selection within the TreeView, but I want the script to select a child items, not just their parent nodes.  Is this possible?  I know it is possible to selecting the parent nodes in a TreeView, but I cannot seem to get the code for selecting, via scripting, a child item of a node in a TreeView.  Any thoughts on how to acheive this?
    Thanks for your time and help!
    Best,
    Arie
    Here is some of the code I am using for auto-selecting child items of nodes in the TreeView:
                        //Code to populate the TreeView (picker) goes here
                        //Highlight the last selection
                        for (var i=0; i < picker.items.length; i++)
                            if (picker.items[i].title == SAVED_TITLE){
                                picker.selection = picker.items[i];
                                picker.selection.expanded = true;
                                for (var x=0; x < picker.selection.items.length; x++) {
                                    if (picker.selection.items[x].marker == SAVED_MARKER){
                                        picker.selection = picker.selection.items[x];  //turns out the indices are relative to it's parent, not the picker's indices
                                        break;
                                break;

    I had some of the above code wrong:
        // function to filter jsx files------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ -----------------------//
        function filterJSXFiles(file)
            return ((file.name.match(/.jsx(bin)?$/) != null) && (file.name != (new File($.fileName)).name));
        // Collect files in folder that holds Burrow AFX scripts---------------------------------------------------------------------------------- -----------------------------------------------------------------------------//
        var brws_ScriptFolder = "Z:\\apps\\after_effects\\AFX_Scripts\\"; 
        //print(brws_ScriptFolder)
        if (brws_ScriptFolder != null)
             var fileList = Folder(brws_ScriptFolder).getFiles(filterJSXFiles);
             //print( fileList)
            function myScript(thisObj){
            function myScript_BuildUI(thisObj){
                var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "AFX SCripts", undefined, {resizeable:true});           
                res = "group{orientation:'row', alignment:['fill', 'fill'] , alignChildren:['fill', 'fill'], \
                    groupOne: Group{orientation:'column', alignment:['fill', 'fill'] , alignChildren:['fill', 'fill'], myMultiTreeView: TreeView{}   }     }     }"; // creating a resource string, controls go here
                myPanel.grp = myPanel.add(res);           
                var brws_ScripIconsDir = "Z:\\apps\\after_effects\\burrowsAFX_Script_Icons\\burrowsIconForAFX\\";   
                var jsxExt = ".jsx";
                //Add Treeview items and icons------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ -----//
                var brws_TopNode = myPanel.grp.groupOne.myMultiTreeView.add("node", "Burrows AFX Scripts");
                brws_TopNode.image = File( brws_ScripIconsDir + "BurrowsIcon20x20.png" ); 
                //brws_TopNode.helpTip = "This is the help. Is it not THE greatest thing you have seen?"
                var brws_AsciiGenerator_1_2 = brws_TopNode.add("item", "AsciiGenerator_1_2");     // CURRENTLY THROWS RESOURCE ERROR
                brws_AsciiGenerator_1_2.image = File( brws_ScripIconsDir + "AsciiGenerator_1_2.png");
                // EVENTS----------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------ ---------------------------------//
                myPanel.grp.groupOne.myMultiTreeView.addEventListener('change', function (event)
                         if (myPanel.grp.groupOne.myMultiTreeView.selection.text ===  'AsciiGenerator_1_2') { fn_AsciiGenerator_1_2(); }
                   }, false);// End of Event Listener
                function fn_AsciiGenerator_1_2()
                    var asciiGenLoc = (brws_ScriptFolder + "AsciiGenerator_1_2" + jsxExt);
                    var scr_asciiGenLoc =  new File(asciiGenLoc);
                    if (scr_asciiGenLoc.exists) { scr_asciiGenLoc.open("r"); var scriptContent = scr_asciiGenLoc.read(); scr_asciiGenLoc.close(); eval(scriptContent); }
                    myPanel.grp.groupOne.myMultiTreeView.selection = brws_TopNode;
                //Setup panel sizing----------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------ --------------------//
                myPanel.layout.layout(true);
                myPanel.grp.minimumSize = myPanel.grp.size;
                //Make panel resizeable------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------ ------------------//
                myPanel.layout.resize();
                myPanel.onResizing = myPanel.onResize = function(){this.layout.resize()}           
                return myPanel;            
                }// End of myScript_BuildUI------------------------------------------------------------------------- ------------------------------------------------------------------------------------------ -------------------// 
            // Create the UI--------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------ --------------------------//
            var myScriptPal = myScript_BuildUI (thisObj)
            if( (myScriptPal != null) && (myScriptPal instanceof Window) )
                myScriptPal.center();
                myScriptPal.show();
            }// End of if Statement-------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------ ---------------------//
            }// End of myScript function
    myScript(this);
    }// End of script

  • Account code (gl_code_combinations) for tax based on the item code

    I would like to have invoice created (ra_customer_trx_all rcta, ra_customer_trx_lines_all) with the account code (gl_code_combinations) for tax depends on the item code (one of the segment in mtl_system_items).
    example: we have 5 segments in item code
    item A: 01-01-AAA-0001-01
    item B: 01-01-BBB-0002-01
    and when we do auto invoice(for sales order), system will create
    TAX account code for item A: xx.xx.xxxxx.xxxxx.101.xx (for item with 3rd segment=AAA)
    TAX account code for item B: xx.xx.xxxxx.xxxxx.303.xx (for item with 3rd segment=BBB)
    can anyone give me some guides to set this up?
    thanks.

    use autoaccounting

Maybe you are looking for