Exactly I want total quantity which is subtraction of (purchase qty - sales qty)
As per excel for example i have
Material plant storage batch purchaseqty salesqty availableqty
Pipe2mm 1112 SPAT CIN_00081 1 - 0
Pipe2mm 1112 SPAT CIN_00081 1 0
Pipe2mm 1112 NPMA CIN_00081 1 - 1
I need to get availableqty that for a material same plant,same storage and may be same batch need to substract from (purchaseqty - Salesqty) if for a material same plant same or different storage, different batch purchaseqty will become availableqty.
It will match with first material and then plant and storage and batch. But for some materials Storage and batch is not there in that case need to consider plant wise.