How to duplicate Item

Hi,
I try to duplicate item with this code
                        Dim vItem As SAPbobsCOM.Items
                        Dim RetVal As Long
                        vItem = oCompany.GetBusinessObject(BoObjectTypes.oItems)
                        'Retrieve a record by its key from the database
                        If vItem.GetByKey("Art_Base") = True Then
                            'Set value to mandatory fields:
                            vItem.ItemCode = "MyNewItem"
                            'Set Value to other fields
                            vItem.ItemName = "MyNewItem Name"
                            vItem.InventoryItem = BoYesNoEnum.tYES
                            vItem.SalesItem = BoYesNoEnum.tYES
                            vItem.PurchaseItem = BoYesNoEnum.tYES
                            'Adding the Item
                            RetVal = vItem.Add
                            'Checking the result
                            If RetVal <> 0 Then
                                oCompany.GetLastError(sErrCode, sErrMsg)
                                MsgBox(sErrCode & " " & sErrMsg)
                                BubbleEvent = False
                                Exit Sub
                            End If
                        Else
                            oCompany.GetLastError(sErrCode, sErrMsg)
                            MsgBox("Failed to Retrieve the record " & sErrCode & " " & sErrMsg)
                            BubbleEvent = False
                            Exit Sub
                        End If
It does not work, I have a message  in OITW.ItemCode
Why ?
Thanks

Dear Didier LEVAN,
You may try to duplicate the item via XML file by use
oldItem.SaveXML -> change Item code, etc, in xml file ->
newitem = oCompany.GetBusinessObjectFromXML(xmlfile)
Best Regards
Jane Jing
SAP Business One

Similar Messages

  • How to Duplicate Item Value in a tablular Block

    hi
    Sometimes I have to copy the values of the items in just above (Previous)row to the next (New) row in a tablular block...
    how to do that..?
    thx in adv
    Kris

    you can also use the procedures , duplicate_record or duplicate_item.
    consult forms builtin help for further assistance.
    zaibi.

  • How to delete duplicate items in SQ01 output

    Hi,
       I created a query to extracted fixed asset from table ANLZ join ANLA, ANLZ for legacy fixed asset upload.  But in the output list , every fixed asset line item is output by triple line items. How can I do to delete the duplicate items when output. Thanks.

    Hi,
    could you explain please what you did to remove duplicate / redundant lines?
    I am facing the very same issue in an SQVI report I made recently: the line item results are 5x more then necessary (when document has 5 item lines), etc.
    Thx in advance

  • HT2905 No Display Duplicates under File. How to find and remove duplicate items in your iTunes library

    I now have iTunes ver 11.0.4.4 under Windows 7. I lost all iTunes stuff when updating to Windows 7. I have loaded thousands amd thousands of music files from backup disks, but there are many duplicates. I am attemping to re-establish my old library. I used to be able to remove duplicates quickly with the old iTunes. The new iTunes doesn't seem to offer the same service. Is there any way to remove duplicates quickly, or must I do it one by one?

    When deduping use Shift > View > Show Exact Duplicate Items as this is normally a more useful selection. You need to manually select all but one of each group to remove. Sorting the list by Date Added may make it easier to select the appropriate tracks. If you have multiple entries in iTunes connected to the same file on the hard drive then don't send to the recycle bin. Use my DeDuper script if you're not sure, don't want to do it by hand, or want to preserve ratings, play counts and playlist membership. See this thread for background and please take note of the warning to backup your library before deduping.
    (If you don't see the menu bar press ALT to show it temporarily or CTRL+B to keep it displayed)
    See also HT2905: How to find and remove duplicate items in your iTunes library
    tt2

  • HT2905 Does anyone know how to find and remove duplicate items in the new itunes 11?

    I am having a hard time trying to figure out how to find and remove duplicate items under the New iTunes 11? Its not as user friendly as in previous versions. Does anyone know how to figure this out?

    As Jim said View > Show Duplicates
    or
    Option + View > Show Exact Duplicates

  • HT201272 help! how do i delete or hide duplicate items?   thanks brendagee

    help! how do i delete or hide duplicate items?   thanks brendagee

    Hi,
    is it what you are looking for,

  • How do I delete the duplicate items in my library on the new iTunes?

    I just backed up my library on a new external hard drive and noticed that all my media is doubled up. Aside from going through each item is there a way to do this on the latest version of itunes. There use to be a way via the file and clicking on duplicates items....Please help I have over 20000+ items!!!

    Apple has removed that feature along with several others, but
    (5/12/2012) Missing 'Find Duplicates' feature in iTunes 11 to be restored - http://reviews.cnet.com/8301-13727_7-57557280-263/missing-find-duplicates-featur e-in-itunes-11-to-be-restored/    "Some of the features Apple has removed from iTunes will see a return, but others may indicate changes to come elsewhere in Apple's product lines."
    Until then you will have to resort to sorting by a particular label such as artist and manually scanning, third party utilities such as Dougscripts Dupin to deal with duplicates, or revert back to iTunes 10.7.
    Somewhere you're not doing something correctly.  Backing up a library should not produce duplicates.  There's no way it can.

  • How to restrict user to enter duplicate items in Purchase Order Lines?

    I have to do form personalization so that user cannot enter duplicate items in the PO.
    At when-new-item-instance in PO-Approve field, I have created a database function that is taking the count of items and returning the count value.
    In the condition I have given condition:
    1<(select func_name(parameter) from dual)
    10       message                 duplicate items in the po
    But its not working fine.
    Thanks & Regards
    Sunny

    Hi,
    The issue is resolved on my own exploration. We need to maintain the different authorization keys for the status which we did not want  a user  to access. If we leave it blank it will allow user to access.
    Regards,
    Sharath

  • HT2905 How to find and remove duplicate items in your iTunes library

    I need an easy and quick way to remove duplicate items from Itunes library since it duplicates to the IPOD 4.

    I've written a script called DeDuper which can help remove unwanted duplicates.
    See this  thread for background.
    tt2

  • I have Pages 09 and I have  created a business card using the template but can't figure out how to duplicate it to the other 9 on the page Am and sure I am going to look daft coz its only the click of a button but I can't work it out Thanks

    I have Pages 09 and I have  created a business card using the template but can't figure out how to duplicate it to the other 9 spaces on the page. I am and sure I am going to look daft coz its only the click of a button but I can't work it out Thanks

    I do the following: Hold down the command key and highlight all the items to be reproduced. Then hold down option and drag the items from the first to each subsequent card.

  • Help needed in removing duplicate items of list box  in java

    How to remove duplicate items of list box while dynamically inserting (on-click event)
    It is not identifying duplicate data
    Variable name is HP_G1
    HP_dmg1 = (DefaultListModel) HP_G1.getModel();
    int a = HP_G1.getModel().getSize();
    System.out.println("HP list no--------> "+a);
    if(a!=0)
    for (int j=0; j<a; j++)
    String item1 = String.valueOf(HP_List.getModel().getElementAt(j));
    System.out.println("HP list added--------> "+item1);
    if(HP_dmg1.equals(item1)){
    HP_dmg1.remove(j);
    else
    HP_dmg1.addElement(GPL);
    }

    Your code is unreadable, so I'll ignore it. In the future please press the message editor's CODE button to format code.
    As to your problem, to the point you normally use a Set instead of List when you don't want duplicates in a collection.

  • Duplicate Item code

    Hi All,
    My query goes like this
    SELECT DISTINCT(T0.[ItemCode]), T0.[ItemName], T1.[OnHand] as STOCK_IN_METER, T2.[Price] as BASE_PRICE, T0.[U_Length_In_Meter],T1.[OnHand]/T0.[U_Length_In_Meter] as STOCK_IN_PIECE, T0.[U_Weight_kgm], T1.[OnHand]* T0.[U_Weight_kgm] as TOTAL_KG FROM OITM T0  INNER JOIN OITW T1 ON T0.ItemCode = T1.ItemCode INNER JOIN OINM T2 ON T0.ItemCode = T2.ItemCode WHERE T1.[WhsCode] ='03' and T0.[ItmsGrpCod] ='102' and  T1.[OnHand] <>0
    Why Duplicate item code is coming and how to solve that?
    Regards,
    Rupa Sarkar

    Hi Rupa,
    There could be many different Prices under OINM for one item. You can only use OITM.LastPurPrc or a specific price under a specific price list for a item.
    Thanks,
    Gordon

  • Duplicate item checking failed in Form level-urgent

    Hi all
    i have creation page with advanced table
    i need to restrict the duplication at form level as well as save button
    in some cases the validation is failed
    if ("CodeValidation".equals(pageContext.getParameter(EVENT_PARAM)))
    itemcode = vo.getCurrentRow().getAttribute("ItemCode").toString();//advanced table multiple records come
    am.xxItemCodeValidation(itemcode);//checking the item validation at databse level
    am.xxdupitemcode(itemcode);
    method in am
    public void xxdupitemcode(String itemcode)
    System.out.println("The item code is.........."+itemcode);
    int count = 0;
    xxcrmNewItemVOImpl vo = getxxcrmNewItemVO1();
    vo.executeQuery();
    System.out.println("the row are" + vo.getAllRowsInRange().length);
    Row r[] = vo.getAllRowsInRange();
    int n = vo.getAllRowsInRange().length;
    for (int i = 0; i < n; i++)
    System.out.println("entered into this block......for loop" + count);
    if (itemcode.equals(r.getAttribute("ItemCode")))
    System.out.println("entered into this block......" + count);
    count = count + 1;
    System.out.println("the count is........."+count);
    if (count > 1)
    throw new OAException("Duplicate Item found plz change the item",
    OAException.ERROR);
    } else
    System.out.println("Exception block....... ");
    in save button i am calling
    if ("Save".equals(pageContext.getParameter(EVENT_PARAM)))
    am.xxdupitemcode(itemcode);
    am.invokeMethod("xxsavetr");
    in which case it is failing is
    in first row user enter
    ROW-ITEMCODE
    1-A
    2-A
    3-B
    4-B
    in second row and 4 th row exception is raised but user didnt change the itemcode and proceed for next steps
    IN SAVE BUTTON EXCEPTION IS RAISED
    but user will go to 4 th row and B should be change as C and click on save
    records are saving with duplication item of A
    but i need to restrict in save button also
    how its posible
    Regards
    Sreekanth

    Sreekanth,
    The correct way to check for duplicates is to check it both in the VO/EO cache as well as the database. It is possible the user entered duplicate value in the current session. In that case you should first check within the existing VO rows if the values are duplicated or not (in case all the database rows are already queried, you might not need to run an explicit query, otherwise another validation VO needs to be executed to check for duplicates).
    Regards
    Sumit

  • Recapture problem - Duplicate Item Filename

    I forgot to choose Stereo Pair when capturing my clips in a project. FCP wont send audio clips to "Soundtrack Pro audio file project" if the clip is not captured as a Stereo Pair. If you try making an audio clip Stereo Pair in your sequence, it still wont work. Soundtrack Pro requires that your clip is captured as a Stereo Pair. I want to recapture my clips, but that is for some reason easier said than done.
    I ctrl-clicked the clips in my browser, chose Make Offline, and then chose Move to trash. When I choose "Batch Capture" on my offline clips now, I get a window that says "Duplicate Item Filename". It says "A file in use by Final Cut has been found to use the specified filename. Enter a different filename and click Continue or choose one of the options listed below." The options that it lists are greyed out.
    I found this problem as an archived thread here in the FCP forums, but the information there did not really help.
    Should I just have removed the clips inside the Capture Scratch folder, instead of using the Make Offline feature?
    I have emptied the trash, tried rebooting my Mac, repairing permissions, trashing my preferences. Nothing has helped. I am now trying to erase the free space on my media drive (which is as good as empty now).
    Where is this filename information stored? Why does my FCP project think the offline clips still are on my media drive?
    Please help

    Thanks Andy.
    I have done some more testing now. I made a backup of my project file, before I tried the "Make Offline" feature, and I also have backups of the project file inside my autosave vault.
    When opening my project backup file, I get the usual message about offline clips and reconnecting. Batch Capture works great when clips are "missing". I get no message about duplicating item filename or anything like that.
    The problem now, is that if I want to modify the clip settings of the missing/offline clips (and make them Stereo Pair), I can't because the clips are not offline but missing. If I check the source column in the browser, I can see it still thinks the clips are supposed to be on my media drive. To be able to modify clip settings, I have to make the clip offline. Once I do that, modifyinig the clip settings works, but when I try to batch capture a clip, I get the message about duplicating the item filename again.
    Man... this bugs me.
    UPDATE:
    Wow.... I think I found the problem. Batch Capturing after making the clips offline works fine. This "duplicate item filename" message only appears AFTER I have modified the clip settings, making it Stereo Pair instead of dual mono. How annoying! This was my main goal. Recapturing the clips with Stereo Pair audio

  • HT2905 Duplicate items in iTunes

    Is it possible to globally delete all duplicate items in iTunes rather than one at a time?

    Apple's official advice on duplicates is here... HT2905: How to find and remove duplicate items in your iTunes library. It is a manual process and the article fails to explain some of the potential pitfalls such as lost ratings and playlist membership.
    Use Shift > View > Show Exact Duplicate Items to display duplicates as this is normally a more useful selection. You need to manually select all but one of each group to remove. Sorting the list by Date Added may make it easier to select the appropriate tracks, however this works best when performed immediately after the dupes have been created.  If you have multiple entries in iTunes connected to the same file on the hard drive then don't send to the recycle bin.
    Use my DeDuper script if you're not sure, don't want to do it by hand, or want to preserve ratings, play counts and playlist membership. See thisthread for background, this post for detailed instructions, and please take note of the warning
    to backup your library before deduping.
    (If you don't see the menu bar press ALT to show it temporarily or CTRL+B to keep it displayed.)
    The most recent version of the script can tidy dead links as long as there is at least one live duplicate to merge stats and playlist membership to and should cope sensibly when the same file has been added via multiple paths.
    tt2

Maybe you are looking for

  • Load balancing on RMI Server Application

    Hi there, I'd like to know more detail about load balancing on RMI server application, been digging the web for some time, but couldn't find much information, does anyone know any website or has the knowledge of load balancing on RMI to share? Sort l

  • How to execute an Oracle stored procedure which returns many records?

    I have two synchronous scenarios XI<->PI<->JDBC, where JDBC is receiver adapter. Each scenario runs a different stored procedure in Oracle database. The first stored procedure returns only one record, the second stored procedure returns many records,

  • IPhone 4 os 4.1 read by computer but not itunes

    I plug my iPhone in and it vibrates/makes the connected noise and my computer recognizes it but iTunes doesn't. I'm running Windows 7 by the way. I've tried different USB ports, uninstalled iTunes and reinstalled it. I've also ran iTunes diagnostics

  • What is "Customer Fields" Tab in the CHaRM

    Hi All, can any one explain what is the "Customer Filelds" tab in the Change Request for? It is found under the Transaction Data button  of the Change request ticket. Thanks in advance. Regards, Pradeep L

  • Multiple incremental cuts on multiple tracks in one click

    CS4 Is there a way, perhaps by setting marker points, or maybe just choosing a set time interval, to make a bunch-o-cuts on a track (or thru several stacked tracks) at set distances, in one fell swoop? So if I have a few tracks layered and I want to