on 09-04-2017 10:49 PM
Greetings!
I'm using JCO for JAVA. I do all the querys quietly, but I got screwed on the following: I need to insert inventory counts, but I get the error: "com.sap.smb.sbo.srap.wrapper.com.Dispatch can not be cast to com.sap.smb.sbo.sbo.api.InventoryCounting" ... Follow the code:
ICompanyService oCS = con.getCompany().getCompanyService();
IInventoryCountingsService oICS = SBOCOMUtil.newInventoryCountingsService(oCS);
InventoryCounting oIC = (InventoryCounting) oICS.getDataInterface(SBOCOMConstants.InventoryCountingsServiceDataInterfaces_icsInventoryCounting);
InventoryCountingLines oICLS = (InventoryCountingLines) oIC.getInventoryCountingLines();
oIC.setCountDate(new Date());
oIC.setCountingType(0);
oIC.setBranchID(1);
InventoryCountingLine oICL = (InventoryCountingLine) oICLS.add();
oICL.setItemCode("100037");
oICL.setWarehouseCode("01");
oICL.setUoMCode("Manual");
oICL.setUoMCountedQuantity(10d);
oICL.setCounted(1);
InventoryCountingParams oICP = (InventoryCountingParams) oICS.add(oIC);
...
Hello, Francisco. According to the error message. This issue should cause by unable to cast return object (Dispatch) from function oICS.getDataInterface() to InventoryCounting. So could you check your function return type, please? Make sure the return type could be cast to InventoryCounting. thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.