cancel
Showing results for 
Search instead for 
Did you mean: 

ProductTrees Object (BOM) - warehouse field

Marshall-Jones
Participant
0 Kudos

Does any know why there isn't a warehouse field on ProductTrees Object (BOM)?

This seems to be a missing field for a while now. I run into this every time import BOMs into sap. The warehouse can be set in the SAP client, just not through the DI-API.

It is important to set because this is where a production order to put the final product by default.

Marshall

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

nm

Edited by: Tjaard Du Plessis on Jun 22, 2011 12:26 PM

Edited by: Tjaard Du Plessis on Jun 22, 2011 12:26 PM

former_member201110
Active Contributor
0 Kudos

Hi Marshall,

If you use the XML interface in the DI API to load the ProductTrees object then you can set the warehouse when adding new BOMs but it doesn't work for updating existing BOMs.


SAPbobsCOM.ProductTrees bom = (SAPbobsCOM.ProductTrees)conn.SboCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oProductTrees);
string fileName = @"C:\Temp\BOMImport1.xml";
bom = (SAPbobsCOM.ProductTrees)conn.SboCompany.GetBusinessObjectFromXML(fileName, 0);
if (bom.Add() != 0)
{
    conn.SboApp.SetStatusBarMessage(conn.SboCompany.GetLastErrorDescription(), SAPbouiCOM.BoMessageTime.bmt_Medium, true);
}


<?xml version="1.0" encoding="UTF-16"?><BOM>
  <BO>
    <AdmInfo>
      <Object>66</Object>
    </AdmInfo>
    <OITT>
      <row>
        <Code>BOMTEST1</Code>
        <TreeType>P</TreeType>
        <PriceList>1</PriceList>
        <Qauntity>1.000000</Qauntity>
        <UseFthrWhs>N</UseFthrWhs>
        <CreateDate>20060102</CreateDate>
        <UpdateDate>20060102</UpdateDate>
        <Transfered>N</Transfered>
        <DataSource>O</DataSource>
        <UserSign>1</UserSign>
        <SCNCounter>1</SCNCounter>
        <ToWH>04</ToWH>
        <Object>66</Object>
        <UserSign2>1</UserSign2>
        <HideComp>N</HideComp>
      </row>
    </OITT>
    <ITT1>
      <row>
        <Father>BOMTEST1</Father>
        <ChildNum>0</ChildNum>
        <Code>COMPONENT1</Code>
        <Quantity>1.000000</Quantity>
        <Warehouse>01</Warehouse>
        <Price>500.000000</Price>
        <Currency>NZD</Currency>
        <PriceList>1</PriceList>
        <OrigPrice>500.000000</OrigPrice>
        <OrigCurr>NZD</OrigCurr>
        <IssueMthd>B</IssueMthd>
        <Object>66</Object>
      </row>
    </ITT1>
  </BO>
</BOM>

Kind Regards,

Owen