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

Automatically triggering ATP Check

Former Member
0 Likes
4,430

Hello,

I require a help for the following issue:

Case A: KIT Items

-


1. I modify a vbkd field for the main item on the screen in VA01.

2. USEREXIT_MOVE_FIELD_TO_VBKD gets triggered for this item.

3. Now in this exit I perform some calculation & modify some fields in XVBEP & XVBKD tables for all the relevent subitems of the kit using -

LOOP AT xvbap INTO wa where uepos = vbap-posnr.

Now I want to trigger ATP for the main item as well as all the sub item. How to achieve this ?

I tried using the flag -

vbap_ende_verfuegbarkeit = 'X'. But it trigger ATP only for the current item i.e. only for the Main Item & not the sub items

Case B: Header Changes

-


1. I modify a vbak field for the main item on header in the screen in VA01.

2. USEREXIT_MOVE_FIELD_TO_VBKD gets triggered for the header ( POSNR = '000000' )

3. Now in this exit I perform some calculation & modify some fields in XVBEP & XVBKD tables for all items of the order using - LOOP AT xvbap INTO wa.

Now I want to trigger ATP for the all the items looped in the sales order. How to achieve this ?

Flag vbap_ende_verfuegbarkeit = 'X' doesn't help here as it work only for the current item no. in this case it is '000000'

After lot of investigation on my side I have found (I'm not sure if it will really work) that if I can some how automatically trigger USEREXIT_MOVE_FIELD_TO_VBEP for all the required items it should trigger ATP as well.

Can somebody help ?

12 REPLIES 12
Read only

0 Likes
2,825

Hi,

You can us FM 'SD_BACKORDER_CHECK_AND_SAVE' for doing ATP check. For this the order should already be created. You need to put this into the exit USEREXIT_REFRESH_DOCUMENT in include mv45afza.

Try this out and reward points if the suggestion is helpful.

Let me know if it doesnt works, i will find out another way.

Regards,

Sharad

Read only

0 Likes
2,825

Thanks for replying.

But I need to trigger ATP after specific changes to the item.

Basically I'm modifying the First Delivery Date based on certain formula (VBEP-EDATU).

But ATP is not getting triggered correctly.

Basically I want some FM that will perform ATP for a selected Item No. (i.e. I'll provide the POSNR & it should perform ATP for that POSNR).

It should work both in VA01 & VA02.

Can anybody help.

Thanks,

Pramod

Read only

0 Likes
2,825

Hi Sharad,

I am trying to use your suggested FM 'SD_BACKORDER_CHECK_AND_SAVE', but it is doing confirm sales order forcefully even if stock is not there.

actually my requirement is like to run ATP automatically only.

I am doing check this FM through SE37.

Please suggest me, am i doing something wrong or is there another way?

Thanks in advance

Jalaj garg

Read only

Former Member
0 Likes
2,825

BAPI_MATERIAL_AVAILABILITY

Read only

0 Likes
2,825

BAPI_MATERIAL_AVAILABILITY or

AVAILABITLY_CHECK

will return the the ATP availibilty dates or quantities.

But what I want is a FM / SAP subroutine / anything else

- that will trigger ATP in VA01 or VA02 ie. it should create proper entries in XVBEP table for the provided Item.

Something similar to what happens when we press <Check Item Availabitly> button manually on the Sales Order screen to trigger ATP.

Can anybody help.

Thanks

Read only

0 Likes
2,825

Hi,

You want to do the ATP check for all items at one time just before save. Is that right?

If yes then what i have mentioned earlier will definitely work because it is a working solution.

Please try it out and let me know.

Regards

Read only

2,825

Hi Sharad,

Thanks for your reply.

My situation is that I wish to trigger ATP on specific changes

& not just only at the end when the order is being saved.

It means if I make specific changes in the SO I should be able to explicitly trigger ATP after the change irrespective of the order being saved or not.

Right now if I make these changes ATP is not getting triggered correctly. To get the correct dates the user has to manually perform ATP by pressing <Check Item Availabitly> button.

I want a functionality (FM/BAPI/Std. routine/etc.) which will trigger this automatically after the change so that user gets to see proper dates immediately.

Hence I'm looking for some thing that will trigger ATP in VA01 or VA02 with an explicit call for a item number (POSNR) specified by me ie. it should create proper entries in XVBEP table for the provided Item.

Something similar to what happens when we select an Item Line & press <Check Item Availabitly> button manually on the Sales Order.

Can anybody help me with this.

Regards,

Pramod

Read only

0 Likes
2,825

Hi Pramod,

Did you got the solution for your problem.

We are also facing the similer problem.

Can you please let us know which solution you implimented for ur problem.

Br, Prashant

Read only

0 Likes
2,825

Hi All,

Please let me know the solution for the above issue. How to handle the scenario with user exits.

Thanks!

Read only

0 Likes
2,825

Hello All,

I'm searching for solution to the same subject.

How we can force ATP after change on First Delivery Date in order lines while we do Document Save.

Read only

Former Member
0 Likes
2,825

Hi Experts

We got same problem, 4years past, looking for help!!

Regards,

Michael

Read only

Former Member
0 Likes
2,825

Hello all,

I am facing the same issue. any help will be appreciated .

thanks in advance.