The requested scenario from (gATP point of view) is known as mixed MTO/MTS/MTO – let me explain what I mean:
It starts with a sales order carrying a custom-specific material configuration. Usually the material needs to be produced, but you may have some of it on stock (e.g. due to remainders out of other production runs).
There are two main scenarios we could think of: you need to use MTO (e.g. for accounting reasons) or not, which means it can be processed in MTS segment only. Please note that this MTO or MTS term doesn’t say anything about orders being triggered by custom requirement or not.
In case MTO needs to be used, the requirements class in ERP will determine the special stock type E and all ATP checks will fail to find material as ATP looks only into the special stock segment (which is empty, of course, as you just created the sales order…). In standard SAP offering there is no solution for this.
With the Mill Industry Solution (=IS Mill) turned on, there is a way to work towards a possible solution. There is a way to allow creating MTO sales order items and then check ATP in MTS (for remainders), and then trigger creation of planned order for the remaining quantity in MTO segment again. Please be aware that all notes mentioned in this article (and especially the described enhancement concept of note 441502) are modification proposals, without any service or support. And due to the status "in work" some notes may not even be visible to you, but most are. The validity of notes is outdated, and for current releases you would have to find out how to implement in case your code should differ from the note's instructions.
Characteristic-based ATP-check is offered by standard SAP solutions, which can find stocks based on custom specification. Please note that this check can’t allocate several batches to one sales order item, because the sales order can’t perform batch split (this is available in the delivery later). It simply finds the stock quantities of those batches and pegging may be needed to allocate those quantities to the sales order. For correct processing of characteristic-based ATP check (means inheriting characteristics and / or the account segment to sub-items which are the result of such a gATP check), it needs additional coding. Unfortunately this scenario is not available in standard APO either (problem description in note 453683, release restriction in note 1284461 & 1233030). The required additional notes are 441502, 444656, 582435, 459793, 453921, and related notes. Those notes describe an enhancement concept including example code, but all notes are modification proposals and come without service and support - I have to emphasise this fact.
I hope this helps, but it is a sensitive area and should be handled with care. Unfortunately we don’t have the capacity to support any implementation in this area, so any step must be taken without guidance by SAP development or support. But the notes may give ideas at least how to approach this issue.
Regards,
Alfred