cancel
Showing results for 
Search instead for 
Did you mean: 

Block customer at document type level.

former_member242511
Participant
0 Kudos

Hi.

I have customer code "10000" which need to be blocked for particular document type like ZSAM(Sample Sale sales Order)

also ZDB(Debit note reuest)

but same customer should be allowed for ZOR(Order) document type.

For all above document types the sales area is same 1000/10/10

Can I block customer at document type level?

Reg,

Antaa21

Accepted Solutions (0)

Answers (6)

Answers (6)

former_member200027
Active Participant
0 Kudos

Hello Antaa21,

I would like to suggest following KBA:

http://service.sap.com/sap/support/notes/1452968

Here, you can see, after blocking the customer in XD05, if the order type is not assigned to relevant
blocking reason in SPRO, the order will still be created.

In your case, you could block the customer first, then assign ZSAM and ZDB to relevant blocking reason as mentioned in the KBA. Then this customer cannot be used to create ZSAM and ZDB document.

Best regards,
Crystal Lin

former_member242511
Participant
0 Kudos

Hi Crystal lin,

If I block customer in XD05 then it will  not be allowed to create ZOR-normal Sales Order.

Maintaining custom table "Document type-Sales Area-Customer wise" and calling that in MV45AFZZ seems ok.

Reg,

Antaa21

VeselinaPeykova
Active Contributor
0 Kudos

Hello Amol,

it seems you skipped point 3 from the how-to .

If you block the customer with a block which is assigned both to ZOR and to ZSAM - you will get an error when trying to create a ZOR sales order in a standard system.

VeselinaPeykova
Active Contributor
0 Kudos

The thing I do not really like about using MV45AFZZ for this purpose is that the only place I can see the check implemented would be in save_document_prepare (after the user has entered the sales order items and presses save). If this is really the case (I am not a developer), this can be frustrating for an user spending time to add 100 items and see the error message at save.

Probably EXIT_SAPLV09A_004 can be used instead of MV45AFZZ to check whether a certain partner (not sold-to, ship-to, payer) is allowed for the specific order type and raise an error message at entering a customer number as sold-to.

moazzam_ali
Active Contributor
0 Kudos

Hi

I am also not an ABAPER but I have feelings that ABAPER can do this even without using save user exit. Move field to VBAK could work here on Pressing Enter. Any technical guy can comment on this.

Thank$

former_member242511
Participant
0 Kudos

Thanks All for your Answers.

kyusufzai
Participant
0 Kudos

Hi Phanikumar

     The solution provided by Veselina is also correct. However the only thing if the customer is assigned as any other partner function apart from AG(Sold-to) , WE(Ship-to) and RG (Payer). this process will not work.

   The Standard solution is always fine and the solution provided is also Good.

A Very rare case if the customer is assigned as Bill to party then sales order will not be blocked.

Thanks

Kash

kyusufzai
Participant
0 Kudos

Hi Amol,

  As per SAP standard  it is not possible to block customer master at document type level. However you can write a code in Sales exit and give error message/ Block the sales order.

You can create a Table with below fields

Customer

Sales Org

Distribution Channel

Division

Sales Document type

Write a code in sales exit MV45AFZZ to read the above entry. If based on the sales order data above entry found then give error message and dont save the sales order or put the sales order in block.

Thanks

Kashif

phanikumar_v3
Active Contributor
0 Kudos

As mentioned- It is also possible with standard system.

As suggested by Mrs Peykova maintain order blocks(IMG>>SD>>Sales>>Sales Documents>>Define & assign reason for Blocking)(Table TVASP)

Maintain this block for customer(Ex.XX)(XD05) + Sales doc type(EX.XX) (ZSAM/ZDB)--So system will not allow this customer for sales with this doc type.

Remove the other block(Ex.YY) for this customer+  but keep for sales doc type(Ex.YY)(ZOR)--So system will allow this order type for this customer.

Phanikumar

VeselinaPeykova
Active Contributor
0 Kudos

Could you elaborate on what will be the advantages of implementing the user exit instead of using the standard order block functionality provided by SAP?

Did you mean to use it for preventing order creation only for specific partner functions per order type? Such as use the customer as a payer, but not as sold-to for this order type?

VeselinaPeykova
Active Contributor
0 Kudos

If you do not use the same customer number as a partner for other customer codes, do you face any specific problems with using the following approach?

1. Create a new order block - e.g. Z1

2. Assign the order block to order type ZSAM and ZDB

3. Do not assign the order block to ZOR

4. Set the order block for the customer.

Lakshmipathi
Active Contributor
0 Kudos

One option is to set a different Customer Pricing Procedure for that customer in master data and don't maintain the required combination in OVAZ.  But with this settings, system would give an error which mis-leads the end users.  This is one simple and standard approach.  Alternatively, you have to go with an enhancement.

G. Lakshmipathi