Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3353

Updating Payment Terms in SAPMV45A

$
0
0

Hello Experts,

 

I have a requirement in SAPMV45A program. We have Payment Terms field (VBKD-ZTERM) under Sales tab which is non-editable for some users and editable for others.

 

Payment terms for Customer Master will be changed at any time.  So, when we are in VA21,22, VA01, 02 when we hit enter on the Sold-to party field (KAUGV-KUNNR), the Payment Terms should be refreshed with the new data from KNVV table. This is applicable for both users who HAVE access to edit payment terms and also to users who DO NOT have access. I handled this in “userexit_move_field_to_vbkd” in MV45AFZZ.

 

But, the catch here is the users who have access will override the payment terms and play around the screen. So, on every hit on the enter button the PAI triggers and will call this user exit. At this time, if payment terms is overridden by the user (VBKD-ZTERM), it should NOT be updated with the values from KNVV table.

 

ONLY when we hit enter on the “Sold-to party field (KAUGV-KUNNR)” field, the value should change (from KNVV) on the Payment Terms. The Payment Terms value if overridden should not change if we hit enter anywhere else.

 

Re-determination happens by default whenever we change the KUNNR, but, the users do not agree and will not change the KUNNR value. They will hit enter on KUNNR and the payment terms value should get updated even if it is overridden.

 

Since the user exit is invoked on every hit on the enter button, the, value provided by the users gets overwritten with the value from KNVV table.

 

As a temporary work around, I did the following in “userexit_move_field_to_vbkd”:

 

I did an Authority-Check for users who HAVE access and asked them to clear the Payment Terms value and then press enter. Now, the logic will check if the ZTERM is INITIAL, if yes, it will bring the updated/correct value from KNVV table, if not INITIAL, skip the logic. This way even if users override the payment terms value, it will stay as is.

 

For users who do not have access, the logic will check KNVV table all the time and update the ZTERM.

 

Can you please advise if there is a way to satisfy this requirement? Or I am looking at the wrong place to implement this logic.


Viewing all articles
Browse latest Browse all 3353

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>