I am not sure whether i understood your requirement correctly or not but as per my understanding, you can use the standard Inter company STO for your requirement only.
Here after delivering the stock to the receiving plant . A do the billing ( in your case A bill to B) B company code( receiving plant). So once the billing completed, the receiving plant company code account debits to Supplying plant company code account credits immediately.
If you need details steps of the Inter company STO process please follow the below document.
Inter-company STO with SD Delivery, Billing & LIV
thanks,
Srinu.