‎2006 Aug 14 8:39 AM
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
‎2006 Aug 14 8:54 AM
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
‎2006 Aug 14 9:09 AM
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.