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

Ztable data updation issue

Former Member
0 Likes
360

Hi,

I have created a Ztable that will hold 2years data. This table is uploaded with file of type( .lst) values which has name and date field only.

Now, suppose i have data in the table from 1st Jan'04 to 31st Dec'05 , when i add the first week data of 2006 , it should delete the 1st week data of 2004 and replace it with the new data.Can this be done using any FM?

please reply.

Thanks,

Sindhu

2 REPLIES 2
Read only

Former Member
0 Likes
336

Hey,

This can be done using function modules. You need to write the logic to evaluate to data to be deleted from the ZTable based on the input file contents. Delete the data(Step 1) and then insert the input data(Step 2).

Commit the data only if Steps 1 and 2 are successful.

-Kiran

Read only

Former Member
0 Likes
336

Hi sindhu,

1. Can this be done using any FM?

There is no direct FM / functionality,

which will do so.

2. In our logic itself,

we have to take care of such thing.

3. a) Delete any record, which suits our requirement (2 years old already there)

b) then add our record.

4. suppose your key field is DATE

and new date record is

20060101 (1 jan 2006)

5. then u can construct old date like this.

oldyear = mydate(4) - 2.

concatenate oldyear mydate+4(4) into oldate.

delete from ZTable where date = olddate.

regards,

amit m.