Good news, we have a clean solution for this issue. German and me have been analyzing this issue and found out a solution which doesn't require a big implementation effort.
First idea is that we have to be able to check in MD04 the situation and change whatever in the system but at the beginning of the process so that we'll avoid changes in several parts (MD_CHANGE_MRP_DATA BADI, delivery user exit FILL_DELIVERY_ITEM, .....)
We realized that following field EKPO-UMSOK is controlling, among other things, the way MD04 displays the information and the PGI. This field in your example, was empty. That's why PGI was searching in the normal stock. If you fill in with an 'E', the PGI can be done and the MD04 displays correctly the information.
Let's see an example in CE1_200 after deactivating the BADI MD_CHANGE_MRP_DATA:
- Material master with collective requirements value (2)
- New STO created referenced to the SO 660000246 and item 300
- Now, the MD04 looks like this. Everything in the corresponding information block:
* PO Item 30 using general stock (no account assignment)
* PO item 50 using sales order stock (account assignment E)
- Now, DN is created for item PO item 50: 710004209. Picking and PGI done
Solution implemented in CE1 with the corresponding activation
Implement the following implicit enhancement which is executed during PO item processing.
It's quite important not to implement any other BADIs or user exits from the previous conversation (for MRP and Delivery).
Please, try the solution implemented in xxx and let us know the result
@ Tommy: If you want any additional clarification, feel free to contact German or me.
Thanks and best regards