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

Custom Table Maintenence

Former Member
0 Likes
1,492

Hi All!!

I have made a custom table Yrepost. I want to maintain the data records in the table such that the table gets refreshed after every 40 days.

It means the data records be deleted after 40 days.

Can you please suggest how to do this? Will a basis administrator reqd. or can a developer do the same through settings etc.

Thanks in advance..

Prabhas

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,476

Hi,

I think you have to write a report for that.

like:

delete dbtab.

then schedule it in background for every 40 days.

Regards,

Renjith Michael.

Hi,

I think you have to write a report for that.

like:

delete dbtab.

then schedule it in background for every 40 days.

Regards,

Renjith Michael.

11 REPLIES 11
Read only

Former Member
0 Likes
1,477

Hi,

I think you have to write a report for that.

like:

delete dbtab.

then schedule it in background for every 40 days.

Regards,

Renjith Michael.

Read only

0 Likes
1,476

Hi..

Could you please elaborate on that..like the program that is required to be written.

Thanks.

Read only

0 Likes
1,476

Hi,

Create a program with name starting with Z or Y.

Inside the program write code like:

tables: <your Y table>.

parameters : date1 type dats value sy-datum.

DELETE <ytable>.

Activate and create a variant.

Then;

Again in the start screen of se38. Just give program name.

Then from menu Program->Execute->Background->You can schedule it there

Regards,

Renjith Michael.

Read only

0 Likes
1,476

Hi Michael,

Thanks. But I would need to run the program.

How can I use table maintenence for archiving...records ?

Read only

0 Likes
1,476

Hi Prakash

As per my understanding, there is no option to archieve the data in extended table maintenance. You can only delete selected records in table maintainence.

If you want to archieve, then you have to work with SARA - T-Code, Since you are talking abt the Ztable, there will be no SAP standard archieving object. You have to develop an archiving object for the same.

In my opinion, it is better to create an ABAP program which will delete records based upon the creation date ( if Creation date >= 40).

For this there should be a creation date field in your Zreport.

After creating a Zreport, then create a background job using this zreport and schedule it for every 40 days.

Please reward, if you problem is solved.

BR

Sree

Read only

0 Likes
1,476

Hi Sreekanth,

Thanks for the reply.

Actually, can you suggest how can I schedule the job for 40 days from SM36.

thanks for the help.

prabhas

Read only

0 Likes
1,476

Hi prabhas,

1. In sm36,

2. click button Start-Condition

new screen will come

3. press button 'Date/Time'

Enter the start date and time. eg. today

4. then below, press the button 'Period Values'

new small screen will come

5. Press button 'Other Period'

new screen will come

6. in the textbox for Day(s), enter 40.

regards,

amit m.

Read only

0 Likes
1,476

Hi..

Actually the table does not have created date. Is it then not possible to use the earlier method..

thanks..

prabhas

Read only

0 Likes
1,476

Hi,

I did not get your point. What is the other method.

Creation date field should be there. it is the only identitfying field which says about the expire of the record.

There is no point in emptying the table after 40 days, only those records have to be elimitaed which exist for more than 40 days.

BR

Sree

Read only

Former Member
0 Likes
1,476

One of the simplest way that can be done is you can archive all the records in the table after 40 days.

One that was suggested to you earlier in the same thread was to write a delete statement on all the entries of the tables. And schedule that report in every 40 day's.

Best is archieving the records in 40 days.

You need to run the table maintanence generator to maintain entries in the table.

Jayant Sahu.

Read only

0 Likes
1,476

Hi Jayant..

Actually the archiving the records is more appropriate in my case as we do not need to run any report for the same.The data is to be automatically archived after 40 days.

Can you please suggest how do we do the table maintenence generator. When I go that in my custom table, I find technical dialog, maintenence screens tab. How can I archive the records.

Thanks in advance..