Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Material Availability Checking in a Z Program

Former Member
0 Likes
925

Currently we have a Z program that creates a production order picklist for the guys in the warehouse. The guys have to go into CO02 and click on the 'material availability' button so the availability included any receipts that have come in during the day. We re-run the availability every night but we don't want to miss any parts that may have been received between the time of the nightly run and when the production order is actually going to be picked.

I would like to run an SAP function within this Z program that will do this availability checking automatically for the specific production order. Can someone suggest a function (including parameters) that I would be able to use? If not a function, any other suggestions would be greatly appreciated.

4 REPLIES 4
Read only

Former Member
0 Likes
773

Hello,

You can make use of the function BAPI_MATERIAL_AVAILABILITY with PLANT, MATERIAL, UNIT as import parameters and AV_QTY_PLT as the export paramter. This is the simplest use.

The scope of the check, that is, which stocks, receipts and issues are to be included in the check is defined by the combination of checking group (material master) and cheking rule.

Thanks,

Venu

Read only

0 Likes
773

I have used this bapi elsewhere but it does not do the committing of the material to the production order as needed.

Read only

Former Member
0 Likes
773

Try to look at CO_ZA_AVAILABILITY_CHK_ORDER, since this is the FM that is actually called when you click the button in CO02. Set a break point and you can see what parameters are being passed.

You can probably make use of CO_DB_HEADER_READ to help you get the CAUFVD_IMP parameter that is required.

Read only

0 Likes
773

I have tried running the CO_ZA_AVAILABILITY_CHK_ORDER function in SE37 but I haven't gotten it to work. I thought I had gotten the CAUFVD_IMP parameter filled in correctly but I the only message I get back is a green checkmark on the bottom of the screen saying 'No Material Components Exist'. I get this message whether there are new components to commit or not and the committing doesn't seem to be happening.

I will take a look at the CO_DB_HEADER_READ function and see if this sheds any light on my issues. Thanks for the info and I will let you know what I find.