Program to correct corrupted CO line item log records
Utility to correct corrupted CO Line Item Logs or Order Booking Report.
Solution ID = KB-355
Goal : Program to correct corrupted CO line item log records
Version = Syteline7.XX.XX
Module : SLCOPO
Fact 1 : Support utility
Fact 2 : CO
Symptom 1 : CO line item log records are not in sync with the line's quantity, price or discount.
Symptom 2 : Corrupt CO change Log records
Database : SQL
Cause
In SL7, APARs 68457, 69064 and 69568 (and possibly others) all caused the CO item log records to get of of sync with the current values in the line item. The result is that the Order Bookings report and List Change Log function are incorrect.Fix
You can run the 10362_fix_clog.sql program from the query analyzer to
find and correct all CO line items for which the log records have become
corrupted. Due to the variety and complexity of the problems, the utility
does not attempt to precisely repair or eliminate the incorrect log entries and
leave all correct entries in tact. Instead, it deletes all existing
records for the problem lines and creates one record in their place.
For lines with a status of Planned, all existing log records will be
deleted and none will be created, simulating what occurs if a line is added
with a status of Planned. For lines with any other status, it accumulates
the price, quantity and discount percent from the log records and compares them
to the current values in the line. If they are not in sync, all log
records for the line are deleted and one new record is created with the line's
current values. The activity date and time in the new record are set to
the values that were in the last log record that existed before being
deleted. Therefore, if a line is added in one month, its price or
quantity is changed in another month, then the line's log records become
corrupted and you run this utility, it will create one log record with the line's
current quantity and price with a date of the second month.
When it has completed processing, all line items affected are displayed
followed by messages indicating the number of log records deleted and created.
You can slightly alter the program if you'd like to see the listing of lines
that will be processed before making the changes. To do so, go to the end of
the program, remove the two dashes (signifying a comment line) from the
second-to-last line, and place them at the beginning of the last line so the
that the current lines:
--rollback tran
commit tran
look like this:
rollback tran
--commit tran
Then run the program and review the lines displayed. To apply the
changes, change the two lines back to the way they originally looked and run the
program again.