on 09-23-2010 3:16 PM
Hi,
i will avoid, that the user inserts an CPD-Customer in sales orders.
It's only in quotation allowed.
Therefore i use include MV45AFZB with following code.
FORM USEREXIT_CHECK_VBAK USING US_DIALOG.
DATA: WA_KTOKD TYPE KTOKD.
IF VBAK-VBTYP <> 'B'.
SELECT SINGLE KTOKD FROM KNA1 INTO WA_KTOKD
WHERE KUNNR = VBAK-KUNNR.
IF WA_KTOKD = 'CPD'.
MESSAGE E010(ZZ) WITH
'CPD-cutomer is not allowed!'.
MOVE 'ENT1' to FCODE.
EXIT.
ENDIF.
ENDIF.
My problem is, that the user cannot chage the customer numer when error appears.
Is there another way to realize what i need, or is there a way to make the customer-Number
changeable in this case?
Hope anyone can help-
Regards, Dieter
Dieter
Have you tried using order block?
Firstly define an order blocking reason for CPDs and assign it to all relevant order types in config.
SPRO/IMG/Sales and Distribution/Sales/Sales Documents/Define And Assign Reason For Blocking
And then block all CPD customers using VD05 ( there will not be many, so it shouldn't take time).
Alternately
make it a warning in the code you wrote and copy the same code as an error while saving the order using
MV45AFZZ - USEREXIT_SAVE_DOCUMENT_PREPARE or USEREXIT_SAVE_DOCUMENT
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Can you please elaborate the issue?
Thanks
Sudhir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Sud,
i simple will avoid, that the users uses CPD-customers (one-time customer) in sales orders.
I have mentioned how i do this, but i'm not satified with my way (Customer number is not changeable).
Now i ask for a better way to avoid using CDP-Customer or make the Customer number changeable
when error apprears.
regards, Dieter
User | Count |
---|---|
91 | |
8 | |
7 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.