We have an integration app, that creates InventoryPosting documents into SAP based on warehouse counting results sent from an external system.
The process has worked fine in version 9.1 although items were non-batch managed.
After customer has upgrade to version 9.2 we need to count also batch items, and we are getting the error "Cannot add row without complete selection of batch/serial numbers"...
Based on documentation and SAP standard behavior, when we add batch item counting, we do the following:
- we only add InventoryPostingLine.Add() lines for batchs with qty difference
- if a batch qty difference exists, we add it with InventoryPostingBatchNumbers
- in the item line, we post the total qty counted for all item batches
Here is a simple test to get this error:
- In SAP, Item A001 has 2 batches AAA and BBB with 10 UN each
- After counting, batch BBB has only 6 UN; batch AAA has 0 counted qty
- Our code adds a SAPbobsCOM.InventoryPosting document and executes the following sequence:
- it adds a SAPbobsCOM.InventoryPostingLine.Add() for item A001
- then it adds a InventoryPostingBatchNumbers.Add() for batch AAA with dif qty 10
- then it adds a InventoryPostingBatchNumbers.Add() for batch BBB with dif qty 4
- finally it sets the line CountedQuantity to 6
- when it adds the inventory counting, we get the above error
What is the problem with this process? We tried different combinations but cant figure out how to add the Inventory posting on SAP...