05-14-2009 2:15 PM
Sales and Distribution: Concerning ATP (product allocation)
Situation:
Step 1: An order is created with priority low. Quantities are confirmed for line items.
Step 2: A second order is created with a higher priority. No confirmed quantities.
Rescheduling program (SDV03V02) is then executed. This selects and sorts the orders in the correct order.
The confirmed quantities for the first (low priority) order should now be freed up, to be able to allocate those quantities to the second (high priority) order.
The problem I am facing is that the confirmed quantities are NOT released.
We cannot use BAPI_SALESORDER_CHANGE or SD_SALESDOCUMENT_CHANGE to delete or modify the schedule lines, because these function modules execute the ATP check again. And when that happens, quantities are again confirmed and assigned.
How can we get rid of the confirmed schedule lines, without executing the ATP check?
Thanks,
Edwin.
05-14-2009 6:39 PM
This should be Posted in SAP SD Forum.
Forum->SAP Solutions->ERP SD Sales
05-15-2009 9:28 AM
Yes, thank you. I also did that.
But that forum seems to be more for Functional consultants.
Maybe a developer has had a similar situation, in which case this is a better location...
05-18-2009 9:53 AM
Additional information: See notes 607036 and 89629. These notes basically say that SAP does not support the use of ATP AND Rescheduling at the same time...
But, we need to.
What needs to be done is to unconfirm the confirmed quantities (removing the schedule lines). But when we try that, SAP runs the ATP check again and immediately confirms new quantities when the Salesorder is saved.
If only we can prevent the ATP check from happening when changing the salesorder (removing the schedule lines) it would be possible to execute V_V2 again (correctly).
I check if I could use the LOGIC_SWITCH structure in the BAPI_SALESORDER_CHANGE, but that did not do the trick...
So the question still remains: How to prevent the ATP check from being executed when deleting or changing schedule lines?
05-19-2009 3:04 PM
Found a solution to the problem:
In the Rescheduling program we export a parameter to the memory, to make it possible to delete schedule lines without executing the ATP check.
Deleting of the schedule lines is done with a BAPI, which will call the ATP check automatically for ATP relevant materials. This we want to stop from happening (only when calling the BAPI).
After the BAPI has been called we FREE the MEMORY ID.
The parameter is imported again in Customer-Exit EXIT_SAPLATPC_001.
Transaction.. SMOD
Enhancement.. ATP00001
Component.... EXIT_SAPLATPC_001,
Include...... ZXATPU01.
The customer exit is used in function AVAILABILITY_CHECK_CONTROLLER, just before calling function 'AVAILABILITY_CHECK'.
Simply refreshing the ATP tables in the customer-exit, will prevent the ATP check from being executed (because we removed the list containing the materials for which the ATP check needs to be done). As a result, the function 'AVAILABILITY_CHECK' will not be processed.
03-27-2014 12:44 AM
Hi Edwin
How did you restrict the user exit to be callled only from the BAPI_SALESORDER_CHANGE? I see that AVAILABILITY_CHECK_CONTROLLER is being used in several other programs too. My requirement is that ATP/availability check should not be carried out after the GI date is updated in the schedule lines using the BAPI
It is kind of urgent, any inputs would be higly appreciated.
Thanks
Vamsi
03-27-2014 1:49 PM
Hi Vamsi.
I didn't need to. But if I had to prevent or restrict the usage, I would try to read the Abap stack to see what functions were called.
Maybe you can use this as starting point:
* Data declarations
DATA: lt_abap_callstack TYPE abap_callstack.
DATA: ls_abap_callstack TYPE abap_callstack_line.
* Code
CALL FUNCTION 'SYSTEM_CALLSTACK'
EXPORTING
max_level = 2
IMPORTING
callstack = lt_abap_callstack.
CLEAR: ls_abap_callstack.
* Check if the function was called
LOOP AT lt_abap_callstack INTO ls_abap_callstack
WHERE blockname = 'BAPI_SALESORDER_CHANGE'.
EXIT.
ENDLOOP.
Cheers,
Edwin.
04-22-2014 9:48 PM