This does not sound like an easy requirement to meet. Essentially, you need to call the availability check more than once in your requirement. And this definitely is not recommended by SAP.
The availability check is called here:
Function AVAILABILITY_CHECK_CONTROLLER
********************************************************************** CALL FUNCTION 'AVAILABILITY_CHECK' EXPORTING P_SCHEDSH = P_SCHEDSH P_SCHEDTR = P_SCHEDTR TABLES P_ATPALLX = P_ATPALLX P_ATPASSRESX = S_ATPASSRESX P_ATPASSX = P_ATPASSX P_ATPCSX = P_ATPCSX P_ATPCSX_R3 = L_ATPCSX_R3 P_ATPDSX = P_ATPDSX P_ATPFIELDX = P_ATPFIELDX P_ATPMATX = P_ATPMATX P_ATPMATX_R3 = L_ATPMATX_R3 P_ATPPLANTX = P_ATPPLANTX P_ATPREX = P_ATPREX P_ATPSDUX = P_ATPSDUX P_ATPSOPX = P_ATPSOPX P_ATPSSPX = P_ATPSSPX P_ATPTERMX = P_ATPTERMX P_ATPREQTERMX = P_ATPREQTERMX P_MDVEX = P_MDVEX P_MDVEX_R3 = L_MDVEX_R3 P_MDVEX_APO = L_MDVEX_APO P_QUOT_CHX = P_QUOT_CHX P_QUOT_VBX = P_QUOT_VBX P_T441VX = P_T441VX P_TMVFX = P_TMVFX P_ATPDIAX = P_ATPDIAX P_ATPDIAWX = P_ATPDIAWX P_ATP_GRP = P_ATP_GRP P_ATP_GRPMB = P_ATP_GRPMB CHANGING P_ATPCA = P_ATPCA P_ATPCB = P_ATPCB P_ATPCC = P_ATPCC EXCEPTIONS ERROR = 1 OTHERS = 2. *************************************************************** After function module availability_check is executed, the availability result is returned in P_MDVEX. In here, field MNG02 contains the confirmed quantity.
Then, Function AVAILABILITY_CHECK_CONTROLLER does this:
* User-Exit after check
***************************************************
IF P_ATPCA-FORCE_R3 IS INITIAL.
CALL CUSTOMER-FUNCTION '002'
TABLES
T_ATPCSX = L_ATPCSX_R3
T_MDVEX = L_MDVEX_R3
CHANGING
P_ATPCC = P_ATPCC.
ELSE.
CALL CUSTOMER-FUNCTION '002'
TABLES
T_ATPCSX = P_ATPCSX
T_MDVEX = P_MDVEX
CHANGING
P_ATPCC = P_ATPCC.
ENDIF.
***************************************************
This is the call to the aforementioned EXIT_SAPLATPC_002 (by SAP SAP). In this exit, you could maintain a logic something like: IF P_MDVEX-MNG02 = 0. CALL FUNCTION 'AVAILABILITY_CHECK'. And you go on to execute the ATP check again. But this time, you call it with different parameters. You could maintain your own logic in here to change the value of P_ATPCSX-BDTER (Requirement Date) so that the ATP check is now calculated with a different required delivery date. Later, this should be reflected in function SD_SCHEDULING_ATP_CALC.
The problem with Venkateswaran K solution is that you are not actually checking availability again. You are just checking against the value in LABST which is different to the ATP check (See SAP note 89362)