I would like to create a new warning message to populate if the payment method differs from Master data records. Example if Master record has a payment method "E" and during transactions if user enters method "A" , system should populate a warning message.
Could you please let me know how to do this
Thanks in advance
In case vendor master is having only one payment method and you want to use the same in document, then you can simply make this field BSEG-ZLSCH for account type K in customizing transaction OB32. Mark the check box "Field can be changed" as unticked.
If you have more then one payment method in the vendor master, then to make the payment method same as one of those assigened to the vendor master. you can write the validation as below:-
Create a message ID via transaction code SE91 for message class /EACC/MSG/ACC_COMP as you want to display to user.
Go to transaction GGB0 and create the validation step at line item level in Financial Accounting as below:-
BKPF-BLART = 'KR'.
Create a exit code using user exit and check that line items have the same payment method as assigned to vendor master.
For this take the help of ABAPer and create a copy of the program RGGBR000 and code your check here and assign to the application area GBLR in view V_T80D via transaction code SM30.
Message created in step 1 as error message.
Please also check that this validation has active status (Status=1) at line line item level (level 2) for your company code in transaction OB28.