Skip to Content

How to detect modifications in an ABAP Object?

Hi all,

I was wondering if there's a simple way of detecting modifications in an ABAP Object.

Imagine an ABAP entity object which holds several attributes and you need to know if this object has been modified. Instead of having to check attribute by attribute to compare it's previous value with the new one I came with the idea of calculating a HASH code for the object before the execution of the application which can change the object attributes and comparing it with the HASH calculated for the same object after the execution.

That way, checking only two hashes simplifies a lot the code. So.... is there any way of calculating a HASH for any object instance? if not... any other approach?

Thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Dec 09, 2011 at 10:59 AM

    Hi Jorge ,

    Maybe tracking changes using version management could help you. VRSD table has the version management data.


    Important -> There are different types for Public , private and protected sections.

    In VRSD table ;

    Enter your object name to the OBJNAME field and check if it helps you.


    Add a comment
    10|10000 characters needed characters exceeded

    • Okay Jorge ,

      I've just misunderstood your question.

      I don't know if there is any simple way as you described.

      ( IMP_GET_HASHVALUE Function module or cl_hash_utilities_imp Utility Class )

      There are functions for retrieving Hash value However you should implement your own method. There are FMs to get an Object's attributes at runtime. You can write a generic method to use for all.


  • Posted on Dec 09, 2011 at 02:03 PM

    Finally I've build my own code to calculate dinamically the corresponding hash for each instance, because using Persistent Classes would need a lot of modifications in my code, but I'll take into account for the next time.

    Thanks guys for your advice!

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.