cancel
Showing results for 
Search instead for 
Did you mean: 

Payment term: how to restrict a customer to one payment term through validations?

0 Kudos

Hello,

I am creating a custom data model in SAP MDG in flex mode. The requirement is that that a customer cannot be assigned more than one payment term. How can I achieve this through validations or any other method if possible?

Any tutorial or link or tcode will be highly helpful. Appropriate answers would be awarded points.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Your statement is a little confusing: you are saying that you are creating a custom data model but you are working with "customer" object. Do you mean you are enhancing the standard Customer data model with a custom field?

I hope you are not trying to avoid BP by creating a custom model for customer only. This might sound appealing at the moment, but you will face serious issues later when your system needs to be upgraded. As I suggest to anyone who struggles with BP, please don't resist it. Instead, learn how BP works as that will be of great benefits on the long-term.

For your question, there are many ways to do it. The most obvious is to write a validation rule that checks for only one payment method and if the user selected more than one then issue an error message. This might not be the most user friendly (as you are telling them their mistake after allowing them to pick multiple values). Another cleaner approach is to enhance the feeder class of the UIBB to only accept one field (implement the validation in the GET_DATA method of the feeder class). A third solution that I prefer if you are going to enhance the feeder class is to display a dummy single-char field that contains a list of all payment terms. You can create a domain to list them all. Then, in the feeder class GET_DATA, copy the content of that field into the payment term field.

0 Kudos

Thank you Abdullah for the answer. I will surely try it out.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Vinayak

Do you mean that you want to default one particular payment term for every customer. If yes then use derivation function and use logic for Customer Account Group payment Terms and make it read only in UI.

0 Kudos

Thanks for the reply.

No, my requirement is that a particular customer should be assigned only one payment term.

I need some sort of validation that would stop me to add another payment term. (ZTERM) field needs to be governed. Does this clarify?

Former Member
0 Kudos

You can achive this by derivation function (Use logic for particular account group or customer default that payment term which you want)