In order to do any reporting or work with lotted items it's important to understand how the data flows through the tables.
Lotted item workflow
The item is in IV00101, ITMDRKOP = 3
NOTE: All quantities here are 'each' in IV00300 and SOP10201
On receipt, a line is added to IV00300.
QTYRECEVD = quantity recieved
QTYSOLD = 0
ATYALLOC = 0
When a sales order is created:
the IV00300.ATYALLOC = the sales order amount
A line is added to SOP10201 for each lot reservation.
When an order is transferred to invoice:
The line in SOP10201 is updated to refer to the invoice
When an invoice is posted:
The quantity moves from ATYALLOC to QTYSOLD in IV00300
The lines for that document REMAIN in SOP10201, but are flagged as POSTED