Cost method - FIFO

Hello ,
Production team ask me to create an erp function to issue material.
our raw material is set to FIFO cost method. Also, each raw material is lottrack enabled. so, in the erp function, we use business object. I wonder if i can call some business object to do the issue material automatically based on the FIFO. i don’t want to manipulate the FIFO in the erp function. ex, i need issue 100 qty for Raw A. Raw A has two lotnums, Lot1 and Lot2. Lot1 has 87 onhandqty, Lot2 has 20 on handqty. Lot2 is the oldest. next is Lot1. is there any business method I can use to avoid the calculation.