Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

need fm or code

Former Member
0 Likes
396

Hi,

There is a requirement that

in the sales order va02 if some body changed the payment terms then i have to show the error message.

to solve this we have to compare both old value and new vaue of the payment terms.

The problem here is getting the old value i.e if someone change the payment terms and saved it ,the new value is present in that field.Then how to get the old value.

is there any fm module for this to get the oldvalue

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
375

I think you can use USEREXIT_SAVE_DOCUMENT_PREPARE which is User exits in the program MV45AFZZ. This user exit can be used to make certain changes or checks immediately before saving a document. It is the last possibility for changing or checking a document before posting.

Here in this form, you can get the old value from database table. It will be available in database table as you have not yet saved the new value.You will also get the new value in the internal table and then you can check old as well as new value.

I hope it helps.

Best Regards,

Vibha

*Please mark all the helpful answers

2 REPLIES 2
Read only

Former Member
0 Likes
376

I think you can use USEREXIT_SAVE_DOCUMENT_PREPARE which is User exits in the program MV45AFZZ. This user exit can be used to make certain changes or checks immediately before saving a document. It is the last possibility for changing or checking a document before posting.

Here in this form, you can get the old value from database table. It will be available in database table as you have not yet saved the new value.You will also get the new value in the internal table and then you can check old as well as new value.

I hope it helps.

Best Regards,

Vibha

*Please mark all the helpful answers

Read only

Former Member
0 Likes
375

hi shweta,

I think u can get it from the change document tables CDHDR and CDPOS.

Regards...