cancel
Showing results for 
Search instead for 
Did you mean: 

Restriction of No. of Sales Orders

Former Member
0 Kudos

Dear Gurus,

How can we restrict the no. of sales orders for a customer ie. if we want to only allow the system to create say 3 orders for the particular customer in a particular month, and the system should not allow to create the fourth order for that month for that customer.

Accepted Solutions (1)

Accepted Solutions (1)

former_member217082
Active Contributor
0 Kudos

Hi Hariprasad

If you want to restrict then after creation of 3 sales orders , you need to block the customer data in XD02->extras->block customer data and then unblock the customer data next month

Regards

Srinath

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Hari,

I also suggest to use a userexit to prevent the order creation. For your users it might be better to use USEREXIT_MOVE_FIELD_TO_VBAK in Include MV45AFZZ. This exit is called after the header data were entered, so the users will not lose time with entering item data.

Best regards,

Joerg

Former Member
0 Kudos

Hi Hari

Blocking /unblocking customer every month will be an extra effort for end user.

Advisable is go for user exit.

Take help of ur abaper, use User exit USEREXIT_SAVE_DOCUMENT.

Write a code such that before saving sales order program will check VBAK table for the Sold to party (KUNNR) and number of sales orders created in SY-DATUM month i.e. current month.

If its already 3 then display an error message and exit. ie not save that sales order.

try and revert.

Former Member
0 Kudos

Can we Customize the requirement through credit management.For example for all high risk customers the system should not allow to generate the fourth order in the current month ???

former_member217082
Active Contributor
0 Kudos

Hi Hariprasad

Instead of assigning credit management to the high risk customers, you can block the customer data for the high risk customers. using XD05.

Regards

Srinath

Former Member
0 Kudos

Dear Srinath,

My Requirement is system should automatically not allow the fourth order in a month.

Every time the end user should not got to xd05 and block.

Former Member
0 Kudos

Hi Hari

In customization its not possible.

Blocking /unblocking customer every month will be an extra effort for end user.

Advisable is go for user exit.

Take help of ur abaper, use User exit USEREXIT_SAVE_DOCUMENT.

Write a code such that before saving sales order program will check VBAK table for the Sold to party (KUNNR) and number of sales orders created in SY-DATUM month i.e. current month.

If its already 3 then display an error message and exit. ie not save that sales order.

try and revert.

former_member217082
Active Contributor
0 Kudos

Hi Hariprasad Reddy

Then , you need to go with the USEREXIT_SAVE_DOCUMENT., and in user exit you have to include the program that if you enter the KUNNR number in the sales order system should not proceed and should give a message that KUNNR has crossed 2 orders. He can place again Next month.So you need to take the help of Technical consultant to include the logic in the USEREXIT_SAVE_DOCUMENT.

Regards

Srinath

Former Member
0 Kudos

Hi Hariprasad

You ca do it through user exit.

Take help of ur abaper, go to Prog. MV45afzz select User exit USEREXIT_SAVE_DOCUMENT.

Here write code :Create a copy of table VBAK with same customer number Sold to PArty (VBAK- kunnr) and document created date (ERDAT) in same month . count the sales docs in loop .

If counter is 3 system will exit from save event and will not save the document.

You can also add error message here.

Kind regards

Mandar

Former Member
0 Kudos

Hi,

After creating the 3 sales orders,block the customer by using XD05 T.Code.

In the next month unblock the customer till 3 orders are getting created using the same T.Code.

After that block it for that month also.

Regards,

Krishna.