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: 

How to maintain a Z-table as a replica of DB table?

Former Member
0 Kudos
146

Hi,

I want to populate a Z-table same as that of a DB table i.e. if any entry comes to the DB table, at the same time the Z-table should also be populated.

Also, if we make any changes to the DB table records, the same change should reflect in Z-table also.

I don't want a view in this requirement but only the Z-table.

Is it possible? Please let me know?

1 ACCEPTED SOLUTION

ritesh_dugad2
Active Participant
0 Kudos
62

It will be difficult to populate the Z table in real time. But you can have a Z program to accomplish this which will read all the data from Std. table and populate it in the Z table. You can schedule this Z program to run automatically at periodic intervals depending on your need. This is the closest you can come to being in real time.

8 REPLIES 8

Former Member
0 Kudos
62

Hi Suman,

As far as i know it is impossible to do so.The only think you can do is to create a program and each time the entries are made into the DB table execute the program without duplicate entries.Reward points if helpful.

With Regrads

Vijay

ritesh_dugad2
Active Participant
0 Kudos
63

It will be difficult to populate the Z table in real time. But you can have a Z program to accomplish this which will read all the data from Std. table and populate it in the Z table. You can schedule this Z program to run automatically at periodic intervals depending on your need. This is the closest you can come to being in real time.

Former Member
0 Kudos
62

Hi,

One way would be to have a background job which runs periodically. This program fetches data from your DB table and updates the ztable

0 Kudos
62

Hi,

You can implement a BADI\USER EXIT for the table.

If you are changing any DB tables will get that values in the BADI\USER EXIT so write a code to update\insert\delete the entries as per the changes in the table.

Hope it helps...

Thanks

Yogesh

Former Member
0 Kudos
62

Hi

The best way to do that is to track the DB changes made in by the Corresponding Transaction.

Write Exit for that... while it uploads the corresponding DB table, as such the respective Z table to update.

Reward Points if useful

0 Kudos
62

well I dont think there is any exits available for this perpose..

but yes u can make a program and run it evry time you make a entry..

A program will see to the consistancy of both the database table..

Regards

Manish

Former Member
0 Kudos
62

Hi Suman,

I got your requirement. Here are the possible solutions.

1. As discussed in the forum , shedule a custom program to run in Background mode at periodic intervals.

2. Say Ex: you want to maintain a table ZVBAK which is similar to that of VBAK, then in the USER_EXIT_SAVE_DOCUMENT, you can fill your custom table.

Reward me if this info helps ........

0 Kudos
62

If there are no exits, BTEs etc available, then another option is to trigger a workflow when the data is created / changed and use that to maintain the custom table. This would only work if the data is related to a business object which has create and change system events already defined.