cancel
Showing results for 
Search instead for 
Did you mean: 

restricting a customer, with respect to no. of sales orsers

shakeer_khan
Participant
0 Kudos

can we restrict the customer, with respect to no. of orders if yes pls let me know the detail process

Accepted Solutions (0)

Answers (3)

Answers (3)

shakeer_khan
Participant
0 Kudos

issue resolved thanks

Jelena
Active Contributor
0 Kudos

This may be done only in the user exit, as mentioned above. But it's not really necessary to create a Z table as number of orders could be easily determined by using the partner index tabke VAKPA. SELECT .. COUNT will be very fast. By default this table is populated for Sold-to partners, but if you need to go by Ship-to, then you'll need to "turn on" the update in the configuration ('Partner index update' or something like that).

Actually I'd recommend doing this anyway since it expedites the queries great deal. Many consultants and developers equally are simply unaware of this option.

Former Member
0 Kudos

Yes we can with the help of a z table and ABAP development.

Create a z table with columns- Sales area, customer, allowed no of orders, current status.

Update the current status field when ever a customer order is processed. you can do this in MV45AFZZ userexit_Save_document.

In the order user exit MV45AFZB, in form userexit_check_VBAK write the code to read this z table and then process further.If the current status <or = allowed no of orders, then process the order, else issue hard error.

Hope this helps

regards

Sai