cancel
Showing results for 
Search instead for 
Did you mean: 

CO09 and BAPI_MATERIAL_AVAILABILITY for ATP Check

Former Member
0 Kudos

Hi all,

On R/3 4.6c...

I am trying to find if there is a BAPI or funciton module out there which I can use to get the material availability (ATP quantity) as per the results of CO09.

I looked at BAPI_MATERIAL_AVAILABILITY but the BAPI only accepts the checking rule. This does not have a switch to check with requirements. On CO09, there is a check box which allows us to check with requirements or not (With reqmts quants).

For my ATP check, I would like the system to assume that the total requirements quantity is taken into account during the availability check, rather than the quantities that have already been committed.

This is required for a system to system call hence the need for a BAPI or funciton module.

Thanks for any help!

Fred

Accepted Solutions (0)

Answers (3)

Answers (3)

mtarundeep
Explorer

Hello Fred,

Were you able to figure out a Function Module for this ,I am also facing the same situation and would need a FM  for it .

Thanks,

Tarun

former_member223981
Active Contributor
0 Kudos

This issue is addressed in SAP note 179947.

You can implement the modification suggested in that note to fulfil your requirement.

Hope this helps,

Noel

mtarundeep
Explorer
0 Kudos

Hello Noel,

I have downloaded the Note from SNOTE and the

implementation status reads as : Cannot be Implemented

I am not sure what can be done as we are on SAP ECC6.0

Thanks,

Tarun

former_member223981
Active Contributor
0 Kudos

Hi Tarun,

You are probably on a release that doesn't need to implement the program code changes. However, you need to implement the user exit as per the last line in the solution part of the note. You need to apply code in the user exit that sets CUSTOMER_TRTYP to 'H'. You should discuss this with your ABAPer. Once this is done, system should behave as you desire.

mtarundeep
Explorer
0 Kudos

Hello Noel,

Tried this after speaking to my ABAPer and it solved the problem, this works as said.

However I just didn't understand what it is to do with Customer ,I checked TRTYP =H it reads as ADD

Anyways many thanks for your help.

Thanks,
Tarundeep

Former Member
0 Kudos

Hi Fred,

i assume your question is to take the requirement quantities and not confirmed quantities when you do ATP check

Please go to OVZ2 and check the usage of cumulation flag.

the field technically is V_TMVF-ONVBA.

Hope this solves your issue.

Regards

Sparsh

mtarundeep
Explorer
0 Kudos

Hello Sparsh,

You are right and these settings will work during the order creation/Order simulation and to verify that we can also check in CO09 T-code with or without using the "with reqmt quant" check box.

However there is no function module which can provide a similar result that of CO09 with requirement quantity check box checked in.

Thanks,
Tarun

Former Member
0 Kudos

Hi,

You can get the ATP quantity by using function module 'AVAILABILITY_CHECK'.

ls_atpcsx-matnr = lt_ekpo-matnr.

ls_atpcsx-werks = 'D001'.

ls_atpcsx-prreg = '01'.

ls_atpcsx-lgort = 'CS'.

ls_atpcsx-idxatp = '1'.

ls_atpcsx-chkflg = 'X'.

ls_atpcsx-bdter = sy-datum.

APPEND ls_atpcsx to lt_atpcsx.

clear ls_atpcsx.

CALL FUNCTION 'AVAILABILITY_CHECK'

TABLES

p_atpcsx = lt_atpcsx

EXCEPTIONS

ERROR = 1

OTHERS = 2.

IF sy-subrc = 0.

READ TABLE lt_atpcsx INTO ls_atpcsx INDEX 1.

it_result_cspo-atpqty = ls_atpcsx-atpm1.

REFRESH lt_atpcsx.

clear ls_atpcsx.

ENDIF.