Application Development 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: 

Check if table has changed ?

Former Member
0 Kudos

Hi there. Is there any possiblity to check if a table has changed (in size, number of rows, etc, if there was an update/delete/modify) except looking in CDHDR and CDPOS ?

It is more a database verification. I need this because if something has changed then i have to do the selection, otherwise no.

Regards,

Cristian.

11 REPLIES 11

Former Member
0 Kudos

Hi

It depends on which tables you need to check, anyway I believe it can get the information you need from table CDHDR and CDPOS, but it's valid only for the tables managed with modification managed by change documents.

Max

0 Kudos

Hi there.

CDRHDR and CDPOS are quite huge and i do not really need to see what has been modified. I just need to check if that table has been modified ( last modify date lets say).

Thank you,

Cristian.

0 Kudos

Can you be a bit more specific in the scenery ? Is it an application change or are you talking about SE16 changes for example ? It all depends, some tables might be able to trigger change pointers, which will work a bit like CDHDR and CDPOS, others might keep a change time for records (field AEDTM in some tables), so it all depends on the table itself. I don't think that there is a SAP table where it keeps a log of changed entries in SAP tables (imagine the size of it), so unless there is some sort of data in the table itself that indicates change or modification documents like said before, there isn't much you can do. Depending on the volume of the table you could do a development with deltas or even through some user exit create a change pointer yourself.

0 Kudos

Ok Christian

I've understood it, but the most of modifications are usually stored in those tables, there aren't other tables as far as I know, the problem is many tables (for example the custom ones) aren't managed there, so it can't know the informations you need.

Just as Pedro says, some table can have the fields for the date, time and user of the last modification, but that depends on the tables.

So let's know if you need to create a reporting for all tables or for certains table only

Max

0 Kudos

Hi there.

I was not thinking about a special table in SAP. The question is related to the database itself also. Is there any way, looking in a table, writing an SQL statement, in which i can find out if a table has been modified ?

Regards,

Cristian.

0 Kudos

Hi Max.

As i have answered to Pedro too, i do not really need a table, i need a way of checking if the table has been changed, a sql statement, or whatever...

Regards,

Cristian.

0 Kudos

Hi

No I don't think, there isn't a one big solution valid for all tables

Max

0 Kudos

Ok. thank you for your help and time .

Regards,

Cristian.

Edited by: Cristian Boartes on Oct 18, 2011 4:35 PM

0 Kudos

Cristian,

From what I understand you want to run a report/do some action only in case of new entries in a Table.

Maybe what you can do is , the first time your report runs, log the data about the table somewhere.

For example, store the number of rows of this Table in another table(call it your Log table).

The Next time it runs, compare with log from your last run.

If there is a differnce, do what you wanted to do and update the Log table with new value.

Hope it helps. I couldn't think of any other generic solution.

Regards,

Vimal

0 Kudos

Hi,

Just 2 more possibilities (both need an initial manual action for each table you want, there's no automatic feature) :

1) there is also the table logging feature, at the technical settings of tables in SE11. Each time an open SQL update is done, it writes to DBTABLOG (well it doesn't change very much compared to CDHDR/CDPOS, except that it's programmed at the kernel level)

2) in your database system, you can probably define a trigger function on your table, that could trigger a custom procedure that updates a flag in a custom database table...

Sandra

former_member713539
Discoverer
0 Kudos

This message was moderated.