Application Development 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: 

Avoid creating PR and PO while creating the sales order

0 Kudos
1,164

Hello Folks,

I have a requirement to stop creating the PR and PO if Cost center is blank.

i have used the user exit SAVE_DOC_PREPARE and there i am updating the confirm quantity = 0(From Schedule lines ) if cost center KOSTL is blank. but stil PR and PO is getting generated.

could you please suggest me how to stop creating PR and PO while saving the sales order.

Thanks in Advance!!

1 ACCEPTED SOLUTION

VeselinaPeykova
Active Contributor
0 Kudos
664

If I understood you correctly, you wish to prevent creation of PRs for third-party and individual PO items if VBAP-KOSTL is not filled. And that this is not related to PRs generated via MRP. If this is the case, why not make use of a custom VOFM routine for subsequent functions?

In standard, routine 102 (LV07A102) is used, it should be possible to adapt this to your specific needs. I would also combine this with incompletion procedure setting for KOSTL for TAS, TAB, etc. items, so that the users can find the documents where they have to perform corrections.

Assuming that you are a developer, you will need to ask the SD consultant to set the new routine in OVB5 before you can test if the solution is working as expected.

5 REPLIES 5

Abinathsiva
Active Contributor
0 Kudos
664

Hi Naresh,

Instead try through BADI ME_PROCESS_PO_CUST through the Sales order reference find the KOSTL is initial and throw a custom error msg saying update KOSTL in schedule lines.

VeselinaPeykova
Active Contributor
0 Kudos
665

If I understood you correctly, you wish to prevent creation of PRs for third-party and individual PO items if VBAP-KOSTL is not filled. And that this is not related to PRs generated via MRP. If this is the case, why not make use of a custom VOFM routine for subsequent functions?

In standard, routine 102 (LV07A102) is used, it should be possible to adapt this to your specific needs. I would also combine this with incompletion procedure setting for KOSTL for TAS, TAB, etc. items, so that the users can find the documents where they have to perform corrections.

Assuming that you are a developer, you will need to ask the SD consultant to set the new routine in OVB5 before you can test if the solution is working as expected.

0 Kudos
664

Hello All,

Thanks for your suggestions, but my requirement is PR and PO should not be created while saving order, if header cost (VBAK-KOSTL) center is blank. It should allow to save order to PR column should be blank in schedule lines tab and also PO should not be created.My approach was to set VBEP-BMENG = 0, but still its creating PR after saving order.

Thanks in advance!

VeselinaPeykova
Active Contributor
0 Kudos
664

Please do not use answer when you wish to add more information.

You can add the additional information as a comment to an existing answer or add it as a comment to your question and @mention the members that you wish to notify. When you use answer instead of comment, the participants in the discussion do not receive notifications about the update and it creates additional workload for the moderators who have to go through each post and convert it manually.

As to your update - so far I see no reason not to try the suggestion that I made already. Both VBAP and VBAK can be checked in the routine. The order can still be saved (in fact, this is how the creation of PRs is prevented for orders blocked for credit reasons).

If you prefer to look for a workaround and not create a custom routine - take a look at the checks in LV07A002. I see no checks for VBEP-BMENG in it, only for CMENG and WMENG. There is no such check in LV07A102 either, so I would not expect that setting BMENG to zero via the exit to stop the creation of the PR.

former_member193761
Participant
0 Kudos
664

If it is third party process how are you managing the avaibility check at the vendor's location on a real time basis?