How to specify warehouse in item object using set GL Method by Warehouse

Hi all,
</p>
I have a sdk to import item master from excel using item object. In general setting, the default warehouse was not set. Therefore, when the program creates the item master, it will first set GL Method by Item Level in order to take in the warehouse code from the excel file and after the item master created, sdk will change the set GL Method from item level to warehouse using object cos customer wants item to manage by warehouse. This sdk was working fine until recently it upgraded to 2007 whereby the change of set GL Method is no longer available using object except thru B1 interface. 
</p>
Does anyone know any workaround?
</p>
The below is my sample coding.
</p>
<pre>
            Dim RetVal As Long
            Dim errCode As Long
            Dim errMsg As String
            Dim dr As System.Data.DataRow
            Dim objRows As DataRow() = dtHeader.Select
            If objRows.GetUpperBound(0) >= 0 Then
                For Each objDataRow In objRows
                    oITM = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems)
                    oITM.ItemCode = objDataRow("Item")
                    oITM.ItemName = objDataRow("Descr")
                    oITM.ItemType = SAPbobsCOM.ItemTypeEnum.itItems
                    oITM.ItemsGroupCode = objDataRow("ItmGrp")
                    oITM.IssueMethod = objDataRow("IssMthd")
                    oITM.SalesItem = objDataRow("SlsItem")
                    oITM.InventoryItem = objDataRow("InvItem")
                    oITM.PurchaseItem = objDataRow("PurItem")
                    oITM.ManageSerialNumbers = objDataRow("ManageSerial")
                    oITM.ManageBatchNumbers = objDataRow("ManageBatch")
                    oITM.CostAccountingMethod = SAPbobsCOM.BoInventorySystem.bis_FIFO
                    oITM.ManageStockByWarehouse = SAPbobsCOM.BoYesNoEnum.tYES
                    oITM.InventoryUOM = objDataRow("InvUom")
                    oITM.PurchaseUnit = objDataRow("PurUom")
                    oITM.PurchaseItemsPerUnit = objDataRow("PerPurUnit")
                    oITM.SalesUnit = objDataRow("SlsUom")
                    oITM.SalesItemsPerUnit = objDataRow("PerSlsUnit")
                    oITM.ShipType = objDataRow("ShipTyp")
                    oITM.Properties(1) = objDataRow("StdPart")
                    oITM.Properties(2) = objDataRow("FabPart")
                    oITM.UserFields.Fields.Item("U_Materials").Value = objDataRow("Material")
                    oITM.UserFields.Fields.Item("U_Treatment").Value = objDataRow("Treatment")
                    oITM.UserFields.Fields.Item("U_ProdType").Value = objDataRow("PrdTyp")
                    If objDataRow("Manufacturer") <> String.Empty Then
                        oITM.Manufacturer = objDataRow("Manufacturer")
                    End If
                    oITM.GLMethod = SAPbobsCOM.BoGLMethods.glm_ItemLevel
                    'Get detail
                    Dim oRows As DataRow() = dtDetail.Select("LineNo = " & objDataRow("LineNo") & "")
                    If oRows.GetUpperBound(0) >= 0 Then
                        For Each dr In oRows
                            With oITM.WhsInfo
                                .WarehouseCode = dr("Whs")
                                .RevenuesAccount = "_SYS00000000209"
                                .ExpensesAccount = "_SYS00000000003"
                                .SalesCreditAcc = "_SYS00000000209"
                                .PurchaseCreditAcc = "_SYS00000000003"
                                .Add()
                            End With
                        Next
                    End If 'oRows
                    RetVal = oITM.Add()
                    'Check for error
                    If RetVal <> 0 Then
                        oCompany.GetLastError(errCode, errMsg)
                        Throw New Exception("[Import Item Master]: " & errCode & "-" & errMsg)
                    End If
                    'Change GLMethods from ItemLevel to Warehouse
                    If oITM.GetByKey(objDataRow("Item")) = True Then
                        oITM.GLMethod = SAPbobsCOM.BoGLMethods.glm_WH
                        If oITM.Update() <> 0 Then
                            oCompany.GetLastError(errCode, errMsg)
                            Throw New Exception("[Update Item Master]: " & errCode & "-" & errMsg)
                        End If
                    End If
                Next
            End If 'objRows</pre>
</p>
Regards,</br>
Cherine

Hello,
This code is working on 2007. What is the error message you get when you change the G/L method by WH?
Try it to change in SAP B1 GUI  an item G/L Method tp WH which has been added via your code , I think settings of G/L Account is missing.....
And check that the Addd all warehouse is not checked in the System Settings.
Regards,
J.

Similar Messages

  • How to specify dateField in DataGridColumn by use it's attribute

    How to specify dateField in DataGridColumn by use it's
    attribute ( For example use attribute "name" and "table" to specity
    each dataField)
    Thanks any idea.
    <mx:HTTPService id="myEmployee" url="
    http://localhost/test/myEmployee.xml"
    useProxy="false" method="POST"/>
    myEmployee.xml :
    <?xml version="1.0" encoding="utf-8"?>
    <database>
    <table>
    <record>
    <field name="auto_id" table="employee">2</field>
    <field name="id" table="employee">2</field>
    <field name="name" table="employee"></field>
    <field name="first_name"
    table="employee">James</field>
    <field name="middle_name"
    table="employee">Francis</field>
    <field name="last_name"
    table="employee">Ryan</field>
    <field name="id" table="department">1</field>
    <field name="name"
    table="department">Marketing</field>
    </record>
    </table>
    </database>
    <mx:DataGrid
    dataProvider="{myEmployee.lastResult.database.table.record}"
    width="100%">
    <!--////////////////////////////////////////////////////////////////////////////////
    <mx:columns>
    <mx:DataGridColumn dataField="field"/>
    <mx:DataGridColumn dataField="field"/>
    <mx:DataGridColumn dataField="field"/>
    <mx:DataGridColumn dataField="field"/>
    <mx:DataGridColumn dataField="field"/>
    <mx:DataGridColumn dataField="field"/>
    </mx:columns>
    ////////////////////////////////////////////////////////////////////////////////-->
    </mx:DataGrid>

    Hi,
    i have creted java class. In this i have getting data from database.these data am putting into array objects, these array objects inturn putting into vector as shown below. But am not getting how to get these objects from vector and display one by one value. please help me how to get array object from vector and display.
    String[] PONum;
    String[] POVersion;
    public Vector ExceData;
    int totalRecords = 20;
    PONum = new String[totalRecords];
    POVersion = new String[totalRecords];
    while (rs.next())
    PONum[i] = rs.getString(1);               
    POVersion[i] = rs.getString(2);
    ExceData = new Vector();
    ExceData.add(0,PONum);
    ExceData.add(1, POVersion);
    Object[] obj = new Object[2];
    obj = ExceData.elementAt(0);
    System.out.println(obj[0]);
    I am waiting for your reply.
    Thanks & Regards,
    -Vishwanath

  • How / can I have jpg logo objects used on reports automatically updated

    How / can I have jpg logo objects used on reports automatically updated after making changes to the repository copy of the jpg logo object in the repository?   The reports are in the enterprise items folder of the repository and the logo.jpg file is in a subfolder of repository items.  I made changes but the changes seem to apply only after I set my options in crystal reports and open the actual rpt file itself. 
    Is there a way to have the changes to the logo show / apply in all reports that have the repository item logo inserted into it without having to open every rpt file in the repository?

    Yes, I understand that...  the problem I was having was that check box being unchecked whenever an unrelated change was made to rpt file...  I was able to ensure that it remained checked by doing save as to the rpt file and making sure the "enable repository refresh" box was checked and replacing the file when prompted upons saving the rpt file...

  • How to add CustomProperties to Excel object using BIPlatform service?

    Hallo,
    I got a Excel Info object using BIPlatform.Get method as follow
    ResponseHolder rh = mPlatformService.Get("path://InfoObjects/Root Folder/fileName/", null);
    Excel obj = (Excel)rh.InfoObjects.InfoObject[0];
    But how can I add Custom properties and them save them back in Server?

    Not available/supported in any of our SDK's.

  • How to list an array of objects using struts in jsp and ActionForm

    I am using the struts ActionForm and need to know how to display an Array of objects. I am assuming it would look like this in the ActionForm:
    private AddRmvParts addRmv[];
    But I am not sure how the getter and setter in the ActionForm should look. Should it be a Collection or an Iterator?
    I am thinking I need to use an iterator in the jsp page to display it.
    I am also wondering if the AddRmvParts class I have can be the same class that gets populated by the retrieval of data from the database. This class has 10 fields that need to display on the jsp page in 1 row and then multiple rows of these 10 fields.
    Thanks.

    Most probably the easiest way to make it accessible in your page is as a collection.
    ie
    public Collection getAddRmvParts()
    You can use the <logic:iterate> or a <c:forEach>(JSTL) tag to loop through the collection
    As long as the individual items in the collection provide get/set methods you can access them with the dot syntax:
    Example using JSTL:
    <c:forEach var="addRmvPart" items="${addRmvParts}">
      <c:out value="${addRmvPart.id} ${addRmvPart.name} ${addRmvPart.description}"/>
    </c:forEach>

  • How to intercept update on entity object using bc4j

    Hi all,
    I need to intercept a user from updating a particular entity object and create a new entity instead. I have a particular row in a database table that has a primary key with special meaning. If a user attempts to update this row, I want to automatically create a new row in the table with the information they entered and leave the original row unmodified. Any suggestions on how to do this at the entity layer?
    Thanks
    Mike

    Hi Sung,
    I've created 2 Entity Objects, named TestEo and OtherEo. The logic I've included is as follows: Before posting data for TestEo to the database (thus as part of the prepareForDML), I create a new instance of OtherEo, using the createBlankInstance method exposed on OtherEoDefImpl.
    However, the instance thus created ends up in a STATUS_UNMODIFIED, regardless of locking mode (I've managed to eliminate the locking mode as an issue).
    Could you give me an idea of where I'm going wrong? I've attached the prepareForDML() (with diagnostic msgs) and createBlankInstance() methods below.
    TestEoImpl.prepareForDML()
    protected void prepareForDML(int p0, TransactionEvent p1)
    switch (this.getDBTransaction().getLockingMode())
    case DBTransaction.LOCK_OPTIMISTIC:
    System.out.println("Locking mode: LOCK_OPTIMISTIC");
    break;
    case DBTransaction.LOCK_PESSIMISTIC:
    System.out.println("Locking mode: LOCK_PESSIMISTIC");
    break;
    // TODO: Override this oracle.jbo.server.EntityImpl method
    super.prepareForDML(p0, p1);
    OtherEoDefImpl otherEoDef = (OtherEoDefImpl) EntityDefImpl.findDefObject(
    "testapp.OtherEo");
    System.out.println("Entity Class: " + this.getClass().getName());
    switch (this.getEntityState())
    case EntityImpl.STATUS_DEAD:
    System.out.println("Entity State: STATUS_DEAD");
    break;
    case EntityImpl.STATUS_DELETED:
    System.out.println("Entity State: STATUS_DELETED");
    break;
    case EntityImpl.STATUS_INITIALIZED:
    System.out.println("Entity State: STATUS_INITIALIZED");
    break;
    case EntityImpl.STATUS_MODIFIED:
    System.out.println("Entity State: STATUS_MODIFIED");
    break;
    case EntityImpl.STATUS_NEW:
    System.out.println("Entity State: STATUS_NEW");
    break;
    case EntityImpl.STATUS_UNMODIFIED:
    System.out.println("Entity State: STATUS_UNMODIFIED");
    break;
    EntityImpl otherEo = otherEoDef.createBlankInstance(getDBTransaction());
    System.out.println("Entity Class: " + otherEo.getClass().getName());
    int state = otherEo.getEntityState();
    switch (state)
    case EntityImpl.STATUS_DEAD:
    System.out.println("Entity State: STATUS_DEAD - " + state);
    break;
    case EntityImpl.STATUS_DELETED:
    System.out.println("Entity State: STATUS_DELETED - " + state);
    break;
    case EntityImpl.STATUS_INITIALIZED:
    System.out.println("Entity State: STATUS_INITIALIZED - " + state);
    break;
    case EntityImpl.STATUS_MODIFIED:
    System.out.println("Entity State: STATUS_MODIFIED - " + state);
    break;
    case EntityImpl.STATUS_NEW:
    System.out.println("Entity State: STATUS_NEW - " + state);
    break;
    case EntityImpl.STATUS_UNMODIFIED:
    System.out.println("Entity State: STATUS_UNMODIFIED - " + state);
    break;
    OtherEoDefImpl.createBlankInstance()
    public EntityImpl createBlankInstance(DBTransaction p0)
    // TODO: Override this oracle.jbo.server.EntityDefImpl method
    return super.createBlankInstance(p0);
    Output - Test 1
    Locking mode: LOCK_OPTIMISTIC
    Entity Class: testapp.TestEoImpl
    Entity State: STATUS_NEW
    Entity Class: testapp.OtherEoImpl
    Entity State: STATUS_UNMODIFIED - 1
    Output - Test 2
    Locking mode: LOCK_PESSIMISTIC
    Entity Class: testapp.TestEoImpl
    Entity State: STATUS_NEW
    Entity Class: testapp.OtherEoImpl
    Entity State: STATUS_UNMODIFIED - 1

  • How can we create an entity object using multiple tables?

    Hi All,
    I'm a newbie to OAF.
    I'm trying to create a simple page using OAF.
    While creating Entity object, there is an option to add the database objects from which we can create our Entity Object.
    There we can enter only one database object.
    If suppose I need to create a Entity object by using mutiple data base objects, how can I add other database objects?
    Is there any option for multiple selection of database objects there?
    Thanks in Advance

    User,
    a). You should use the [url http://forums.oracle.com/forums/forum.jspa?forumID=210]OA Framework Forum for this question.
    b). Entity objects always correspond to a single table. I think you want to create a View object instead.
    c). Really, you want to be using the OA Framework forum.
    John

  • How do you track a moving object using Labview and Vision Assistant

    I am using Vision and Labview to create a program that tracks and follow a moving object using a high end camera. Basically what it does is it detects a foreign object and locks on to it and follows it where ever it goes in a control sized room.
    I have no idea how to do this. Please help. Or is there an available example.
    Thanks.

    Hello,
    It sounds like you want to look into a Vision technique called Pattern Matching.  Using our Vision tools, you can look for a image, called a template, within another image.  Vision will scan over the entire image of interest trying to see if there are any matches with the template.  It will return the number of matches and their coordinates within the image of interest.  You would take a picture of the object and use it as the template to search for.  Then, take a picture of the entire room and use pattern matching to determine at what coordinates that template is found in the picture.  Doing this multiple times, you can track the movement of the object as it moves throughout the room.  If you have a motion system that will have to move the camera for you, it will complicate matters very much, but would still be possible to do.  You would have to have a feedback loop that, depending on where the object is located, adjusts the angle of the camera appropriately.
    There are a number of different examples a that perform pattern matching.  There are three available in the example finder.  In LabVIEW, navigate to "Help » Find Examples".  On the "Browse" tab, browse according to "Directory Structure".  Navigate to "Vision » 2. Functions".  There are examples for "Pattern Matching", "Color Pattern Matching", and "Geometric Matching".  There are also dozens of pattern matching documents and example programs on our website.  From the homepage at www.ni.com, you can search in the top-right corner the entire site for the keywords, "pattern matching". 
    If you have Vision Assistant, you can use this to set up the pattern matching sequence.  When it is complete and customized to your liking, you can convert that into LabVIEW code by navigating to "Tools » Create LabVIEW VI..."  This is probably the easiest way to customize any type of vision application in general.
    I hope this helps you get started.  Take care and good luck!
    Regards,Aaron B.
    Applications Engineering
    National Instruments

  • How to get list of custom objects used in abap report program?

    Hi friends,
    I have a requirement in which I have to scan the entire abap report and retrieve list of custom objects used in it for example custom tables, data elements, structures, table types etc,. Is there any provision in SAP like fuction modules to do this functionality?  As of now I am coding everything manually where so many possibilities are there for all kinds of objects. Provide your answers and suggestions...
    Thanks,
    Nastera

    Hi,
    The best way to do this is environment analysis. Follow the steps:
    1. Open se38, type in the program name (don't click on on display/change or create button, stay on first screen only)
    2. Click on environment analysis button (hot key SHIFT+F4)
    3. It will throw a pop-up, which will ask for type of object you want to see, which are linked /used by this program. select all (or may be if you are only interested in Tables, then select table only)
    4. Hit 'Enter'
    You will get the full list of all objects used in this report program. Just note down the one which starts with Z or Y and that's it.
    Cheers,
    Anid

  • In Reply to : How to validate org.jdom.Document object using xsd: dvohra09

    Hi All
    I am creating org.jdom.Document object using constructor Document() and adding children using setRootElement(), setChildren() and addContent() methods. The children are objects of org.jdom.Element. If i want to validate the org.jdom.Document using xsd what i have to do. Thanks in anticipation.

    I tried the below code and it is always giving the
    Parsing fatal error : The markup in the document preceding the root element must be well-formed.
    But it is possible to validate the same Document object as right document after writing it onto xml file using XMLOutputter and parsing it using DOMParser
    Thanks in anticipation
    org.jdom.Document document;
    String documentString=document.toString();
    StringReader stringReader=new
    StringReader(documentString);
    SAXBuilder saxBuilder =new
    SAXBuilder("org.apache.xerces.parsers.SAXParser",true);
    saxBuilder.setFeature("http://xml.org/sax/features/vali
    ation",  true);
    saxBuilder.setFeature("http://apache.org/xml/features/v
    lidation/schema",  true);
    saxBuilder.setFeature("http://apache.org/xml/features/v
    lidation/schema-full-checking", true);
    //Set a error handler with
    setErrorHandler(org.xml.sax.ErrorHandler errorHandler)
    saxBuilder.build(stringReader);

  • How to Specify Metadata When Adding Content Using iTunes U Web Service?

    I've been developing Java applications using iTunes U Web service and uploaded content to iTunes U site using iTunes U Web service without problem. Now I want to add metadata fields (name, artist name, album name, etc.) for the tracks I uploaded. It seems to me that "AddTrack" will do. So I tested it but it neither adds a track under the specified group nor updates metadata fields for an existing track. It turned out "MergeTrack" actually updates metadata fields for an existing track. So is there any way to specify metadata at the time of adding content using iTunes U Web service? And what exactly does AddTrack do? This is all about contents hosted by iTunes U site and no RSS is involved.
    I'm referring to the "AddTrack" method in iTunes U Web service:
    http://deimos.apple.com/rsrc/doc/iTunesUAdministrationGuide/iTunesUWebServices/c hapter18_section_21.html#//appleref/doc/uid/AdminGuide-CH13-SW26

    Thanks for all the replies. My question is whether there is any way to specify metadata WHEN adding content using iTunes U Web service. Specifying metadata AFTER adding content can be achieved by MergeTrack (weird naming) and it does work.
    As for setting track level meta-data in the media file and then upload it, there're several reasons against that, among which are:
    1. Some track metadata are context-dependent. A video about buildings on Michigan Ave in Chicago can be track #2 in a history course and described as "historic view of the Magnificent Mile", but the same media can also be track #5 in a landscape design course and described as something like "contemporary architecture". Setting these metadata in the media file itself is not the preferred way to do it since it implies maintaining a version of the same media for any course/group it gets uploaded to.
    2. Setting metadata in a location separate from the media file helps track the metadata change and search for media without digging into the media itself.
    3. If MergeTrack "updates" metadata, there got to be some other method that "creates" metadata - that's what a well-designed API should look like. And setting metadata in the media file is not an equivalent to a "create metadata" method call. In rickwolf's term, that implicit AddTrack should actually be made explicit so the party uploading content can explicitly specify metadata instead of having iTunes U extract metadata from the media.
    It is still not clear what "AddTrack" does exactly, maybe rickwolf is right - it's only relevant to tracks created through RSS.
    So it seems to me there is no other way to specify metadata WHEN adding content using iTunes U Web service than setting metadata in the media file. To me it is more like a design flaw.
    Message was edited by: Stone Xiang
    Message was edited by: Stone Xiang
    Message was edited by: Stone Xiang

  • How to match filters to moving object using motion tracking ?

    Hi:)
    Excuse me for imperfect english.
    I'd like to perform the famous face wrao effect that I've seen in a tutorial for ADOBE AE.
    I've to match move a filter (like distortion-bulge) o a moving object using motion tracking, but i've nit able to perform it.
    (I want to distort an eye in a face that moves it)
    THanks

    Specialcase gives an excellent tutorial here:
    http://motionsmarts.com/tutorials/matchmove1/mm1.html
    Patrick

  • How to encrypt a big folder without using disk utility method ?

    How to encrypt  big folder
    suck as 100 GB
    without using disk utility method ??

    Click the partioned disk > Hit Erase Tab  >
    Under "Format" Select "MAC OS Extended Journaled, Encrypted
    Click "Erase"
    Set Password ..
    Done

  • Collaboration Services: How does specify a specific language to use?

    Does anyone know how to administer the Leopard server in English, but have the collaboration services (wiki, blog, calendar, etc) run under another language, perhaps even specific to the User and/or Group?
    (formerly posted in the wrong forum)

    I just stumbled upon the solution.
    Checking the collaborative services pages (wiki, blog, etc.) on an English system will show the pages in English. If you use a computer with another system language, that the pages render according to the primary system language. So if you're using a Japanese system, Safari will bring up the collaborative services in Japanese.

  • How do I display an item that used to be on my tool bar?

    I think I accidentally erased my short cut button to the internet, so now I have to
    open Safari to get online, instead of using the @ symbol that I used to have on my
    tool bar. Does anyone know how to get this back??
    Message was edited by: rjperson

    First decide what page you want to have open when you use the symbol to get on the net. It doesn't have to be your home page. It can be any page. Once you are on that page drag the symbol next to the address , such as the little apple, to the dock beside the trash can. It must be on the side of the little line towards the trash can in the dock. You will see the little @ springy thing appear. I have my web page set there so I can click it to get on the web from there.

Maybe you are looking for

  • Error 102 when trying to download OS X 10.8.5, Help!

    I am using a Macbook Pro 8,2 on 10.8.4 When attempting to download and install the 10.8.5 update via the Mac App Store, I receive an error 102 before the download will begin! I even tried to download the update directly from the Apple support site on

  • Add Invoice from Purchase Order

    Hi experts, I add the Button in Purchase order .and bind the Vendor codes and items, qty, price in matrix(Purchase order matrix) . Now i want to add the Invoice separately  for all vendors who are exist in row level when i click the userdefined butto

  • How do i restore a frozen ipad3

    My daughter's ipad3 is frozen. She was in the process of upgrading to IOS7 when it locked up with "ipad is disabled' msg. I have tried the normal procedure of shutting the ipad off - holding the sleep button until red bar appears then shutting it dow

  • How to avoid Huge scan with case condition in the select statement.

    Hi , I have the below sql and add condition such that c.ROLE = 18 then tibex_fixrestorestateview needs to be queried else it should not query the tibex_fixrestorestateview. tibex_fixrestorestateview contains 10 to 20 millions records so to avoid scan

  • No images after upgrading to MX7

    After upgrading to ColdFusion MX7 I noticed my exisitng .cfm pages are no longer displaying images on the local testing server. I did see that I had the old CFusionMX and a newer CFusionMX7 folder. I moved all my files from the CFusionMX folder to CF