cancel
Showing results for 
Search instead for 
Did you mean: 

Include Safety stock for selected order types during ATP check

Former Member
0 Kudos

Dear All,

We are using checking group "02" where "include safety stock" is not activated in OVZ9.

Now business is asking to activate "include safety stock" for selected doc types.

Kindly guide me how to proceed further.

Example: Sales Order : ZOR1, ZOR2,ZOR3,ZOR4 and ZOR5.

For sales order type ZOR5, safety stock has to be activated.

With Regards

Azeez.Mohammed

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Dear All,

We don't want to do any changes on availability check.

Hence closing this thread.

With Regards

Azeez Mohammad

Answers (4)

Answers (4)

former_member184080
Active Contributor
0 Kudos

Hi Azeez,

Check if this helps you : User Exit MV45AFZF - FORM USEREXIT_AVAIL_CHECK_CREDIT

Regards, Sai Krishna

former_member223981
Active Contributor
0 Kudos

Hi Azeez,

This is not possible in the standard system. It would also be a difficult modification to implement.

When the availability check is executed, function module AVAILABILITY_CHECK_CONTROLLER is called. This is a typical call stack:

SAPLATPC FUNCTION AVAILABILITY_CHECK_CONTROLLER

SAPLV03V FORM MVERF_PRUEFEN

SAPLV03V FUNCTION RV_AVAILABILITY_CHECK

SAPFV45V FORM MVERF_PRUEFEN

SAPFV45V FORM VERFUEGBARKEIT_PRUEFEN

SAPFV45V FORM BESTAND_BEDARF_ABGLEICHEN

SAPFV45P FORM VBAP_BEARBEITEN_ENDE_VERFUEGB

SAPFV45P FORM VBAP_BEARBEITEN_ENDE

SAPMV45A MODULE (PAI) VBAP_BEARBEITEN_ENDE

Function AVAILABILITY_CHECK_CONTROLLER contains the following code:

*******************************************************************************

* User-Exit before check
  CALL CUSTOMER-FUNCTION '001'
    TABLES
      T_ATPCSX       = P_ATPCSX
      T_ATPFIELDX    = P_ATPFIELDX.

  CALL FUNCTION 'AVAILABILITY_CHECK'
       EXPORTING

...

* User-Exit after check

    IF  P_ATPCA-FORCE_R3 IS INITIAL.

      CALL CUSTOMER-FUNCTION '002'

*******************************************************************************

So you have two main user exits in the ATP area; one before the call to function availability_check and one afterwards. There are none within function availability_check. However, the scope of check settings are considered within this function as illustrated in the following call stack:

SAPLATPC FORM DATA_COLLECT_R3

SAPLATPC FORM AVAILABILITY_CHECK_R3

SAPLATPC FUNCTION AVAILABILITY_CHECK

SAPLATPC FUNCTION AVAILABILITY_CHECK_CONTROLLER

The scope of check settings are determined in form DATA_COLLECT_R3.

Therefore, if you avail of the user exit before the check, you would also need to modify the code in the form DATA_COLLECT_R3. For example, you could implement code in exit EXIT_SAPLATPC_001 (exit before ATP check) that exports a flag to SAP memory if order type = "XX". Then modify form DATA_COLLECT_R3 so that this flag is imported and will turn P_T441VX-EISBP on or off as required.

Or you could use the above suggestion and use different checking groups. In EXIT_SAPLATPC_001, you can define code so that checking rule (PRREG) = "XX" for certain order types while = "YY" for other order types. Then, when you get to FORM DATA_COLLECT_R3, there is no need for this code to be modified as the system is just reading from the checking groups you have defined in OVZ9. The problem with this approach is that it is hard-coded into the system that sales order ATP check should be checked with checking rule "A" and by changing this, you run the risk of encountering other issues.

I would also test any change to this very carefully as using different checking rules in this way can lead to over confirmation and inaccurate availability results.

I hope that this helps. 

Former Member
0 Kudos

Hi,

in standard it is not possible . You need to do enhancement by user exit.

Find below userexit

User exits in program FV45VFZZ

  • USEREXIT_ADD_FIELD_TO_LINE

User exits in program RV03VFZZ

  • USEREXIT_AVAILABILITY_OUT

Check above two exits with help of your ABAP er and write a code for your requirement.

Like create a separate checking group which have checked for safety stock . so you code will change when your order type is ZOR5 to that checking group  in the sales order.

Hope it will help you.

Regards

Pitabash

eduardo_hinojosa
Active Contributor
0 Kudos

Hi

Check the recommendations in Note 710337 - Safety Stock, although it's older.

I hope this helps you

Regards

Eduardo