Hi,
i have a requirement to process two internal tables in which i should update these two internal tables based on the conditions and for your convenience i'm describing the scenario in detail below.
1.batchquantity
plant|material|storageloc|batchqty|shelfexp.date|orderqty|
-
00100|10000000|0000000010|00000100|02/06/2009___|___0____|
00100|10000000|0000000010|00000150|02/06/2003___|___0____|
00100|10000000|0000000010|00000500|02/06/2010___|___10___|
2.orderqty
plant|material|storageloc|orderqty|goodsiss.date|
-
00100|10000000|0000000010|00000150|02/06/2008___|
00100|10000000|0000000010|00000300|02/06/2001___|
my requirment is that for orderqty-goodsiss.date < batchqty-shelfexpdate,
i need to distribute the orderqty in orderqty table to orderqty in batchquantity table
based on plant, material, storage loc... and the orderqty in batchqty table should not exceed batchqty in the same table
the result would be as follows in batchqty table( orderqty increased since the date condition matched and cannot go beyond the batchqty)
plant|material|storageloc|batchqty|shelfexp.date|orderqty|
-
00100|10000000|0000000010|00000100|02/06/2009___|___100__| <---
00100|10000000|0000000010|00000150|02/06/2003___|___0____|
00100|10000000|0000000010|00000500|02/06/2010___|___60___| <---
and orderqty would be ( the orderqty reduced since it got into batchqty tab)
plant|material|storageloc|orderqty|goodsiss.date|
-
00100|10000000|0000000010|00000000|02/06/2008___| <----
00100|10000000|0000000010|00000300|02/06/2001___|
There might be several thousand records in both the tables, how to update the batchqty table
with minimum loops.
Thanks,
ravi.