on 12-04-2008 3:13 PM
Hola a todos!
Estoy desarrollando un add-on y necesito obtener información con el business object +ItemWarehouseInfo+.
Esta es la línea del código:
Dim vItem1 As SAPbobsCOM.ItemWarehouseInfo = _
oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems)
Pero me da el siguiente error y no se por que:
Se detectó System.InvalidCastException
Message="No se puede convertir el objeto COM del tipo 'System.__ComObject' al tipo de interfaz 'SAPbobsCOM.ItemWarehouseInfo'. Ocurrió un error de operación debido a que la llamada QueryInterface en el componente COM para la interfaz con IID '{CDB52791-B0FC-4BE1-A712-06941AF91D52}' generó el siguiente error: Interfaz no compatible (Excepción de HRESULT: 0x80004002 (E_NOINTERFACE))."
Source="IBOLT"
StackTrace:
en IBOLT.IBOLT.SBO_Application_ItemEvent(String FormUID, ItemEvent& pVal, Boolean& BubbleEvent) en C:AppWinsIBOLTIBOLTIBOLT.vb:línea 167
Alguién me puede ayudar con esto?
Saludos
Giuseppe
Dim vItem1 As SAPbobsCOM.ItemWarehouseInfo = _
oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems)
Hola el problema es q esta ententando de hacer un cast de un Item en un wharehouse.
Opcion 1:
Crea un object item y accedes a itm.WhsInfo
Dim vItem1 As SAPbobsCOM.Items= _
oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems)
vItem.GetByKey(...)
vItem.WhsInfo
Opcion 2:
Utilizas el objecto Wharehouse
Dim whs As SAPbobsCOM.IWarehouses whs = _
oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oWarehouses);
Ciao
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ciao Roberto
Ti ringrazio per rispondere la mia domanda. In ogni modo ho bisogno di leggere l'informazione di un determinato item y un determinato magazzino. Per essempio la quantita inStock, la quantita compromessa e la quantita riquiesta. Non so come farlo.
Se mi puoi aiutarmi ti sarei molto gradito.
Saluti
Giuseppe
In c#
Tramite Business Object:
SAPbobsCOM.Items itm =
(SAPbobsCOM.Items)company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems);
itm.GetByKey("xxx");
itm.WhsInfo.SetCurrentLine(1);
double inStock=itm.WhsInfo.InStock;
Tramite Query:
rs.DoQuery("select OnHand from OITW where ItemCode='xxx' and Whscode='yyy'");
Ciao.
User | Count |
---|---|
86 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.