01-19-2022 10:17 PM
Hello All,
When in SM30 using Table Maintenance Generator, I have an event which fires (01 - Before saving data to database) when the user clicks the Save button. When this event fires I can check what <action> occured 'U' - Update, 'N' - New Entry etc.If I'm looking at an internal table called TOTALI can see which row entry in the table was changed with the above <action>. But, how do I check which column was changed? Is there a way to know what the old value in the column was if we can find out which one changed? I looked at EXTRACT and <VIM_TOTAL_STRUC> but none of them contain info like which column changed or what the old values in the changed columns were. How can we achieve this?
Regards,
D.
01-29-2022 12:35 AM
Accepted Sandra Rossi's answer.
"Do the SELECT (old values) in event 01, as it's BEFORE save. You compare the old values with TOTAL (new values)."
01-20-2022 3:31 PM
Usually it's not needed to know the old values. If you want to know which fields have been changed, compare with the values in the database table or view.
01-20-2022 10:38 PM
Hello,
my first thought when reading your question is, that there is also a standard functionality available for logging changes of table data. You can switch it on in SE13 and follow up the changes in SCU3.
01-21-2022 5:55 PM
Thanks for your responses.
sandra.rossi , I didn't understand where you're saying the comparison should be made with? Which db table or view?
jmodaal , I'm trying to access the old data in the maintenance generator events of the table specifically 01 - Before saving data to the database. From your suggestion on turning on logging, how would that work in terms of checking which value changed in the column?
Regards,
D.
01-21-2022 8:04 PM
Your table maintenance dialog is for maintaining a database table (or view), right? Till you save your changes, the database table still contains the old values.
01-21-2022 9:21 PM
sandra.rossi , that is correct "till you save your changes". But the event 01 only fires after the user clicks the Save button. When that happens, the FS <vim_struc_total>, <vim_extract_struc>, <vim_cextract> all contain the new values. Is there any structure/internal table where I can see the old values once the event fires?
Regards,
D
01-22-2022 9:23 AM
It's not what I'm saying. I'm saying that if you do SELECT * FROM table, then you get the values before they are updated by SAP.
01-23-2022 1:59 AM
sandra.rossi , I understood what you meant, but what I'm saying is that when and where do I do this "select *"? Is there some sort of pre-event in the table maintenance generator that I can query the table and store those old values in an internal table ready to be used by event 01 when it fires? Because once events 01 fires the values have already changed.How do you share internal tables between events if there is such an event?
01-23-2022 3:12 PM
Do the SELECT (old values) in event 01, as it's BEFORE save. You compare the old values with TOTAL (new values). Maybe I didn't get what you're trying to do, sorry about that.
01-29-2022 12:31 AM
Thanks sandra.rossi, I made it work for my requirement with your suggestion.
01-29-2022 12:35 AM
Accepted Sandra Rossi's answer.
"Do the SELECT (old values) in event 01, as it's BEFORE save. You compare the old values with TOTAL (new values)."