Skip to Content

Deleting history from BPC comments table

Hi all,

Does anyone have experience with deleting old comments from the BPC Comments table?

We have reached 3.8 million records in our comments table, and need to delete all the old comments (for a given characteristic combination), and only keep the latest comments.

I'm aware that there is a standard class available (CL_UJC_CMTMANAGER) which allows us to archive and delete comments, but was hoping to hear from someone who has actually written a program to effectively "compress" the comments table, to see if there are any tips or tricks or anything to watch out for.

You may ask why we have so many comments in our table in the first place... well let's just say that I've found a bug in the standard Copy Comments package that causes duplicates in the comments table when we copy data and comments from one version of forecast to another. And our business users have been using this standard copy comments for many years now, and the result is that comments have grown exponentially.

Thanks in advance,

Carlton.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 21, 2016 at 03:57 AM

    Hi Carlton,

    You can run the standard package /CPMB/CLEARCOMMENTS

    to clear the comments or you can write a program to delete all old comments and only leave the most recent ones in place.

    Andy

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 24, 2016 at 05:48 AM

    Hi Andy,

    Yes we want to keep the most recent comments in place, and only delete the redundant history. I'm the process of writing a program now.

    Interestingly, when looking through CL_UJC_CMTMANAGER, there is a method to move comments to the archive table, but once the comments have been archived, there are no methods to read/update/delete records from the archive table.

    It will be interesting to hear if anyone has actually used the comments archive table before, and what the use case was.

    Cheers,
    Carlton.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 27, 2016 at 07:31 AM

    Hi Carlton,

    Interesting that there is a bug with the standard copy comments package. Could you provide more details? We propose to utilise this package for an ongoing implementation.

    Many thanks,

    Nick

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Nick,

      Yes the bug (design flaw) was that standard copy package would copy all the historical comments for a given characteristic combination, and use the current date/time as the timestamp when creating the new comment records, i.e. all new comments created have the same the same timestamp. This made it impossible for application to know which is the latest/correct comment for the destination char combo, and the result was that the user would see random results when retrieving comments for that char combo.

      Luckily SAP responded pretty quickly with the following solutions:

      1783726 - setting that gives the option for the clear comments package to delete ONLY historical comments

      2301814 - new setting to that gives the option to keep original timestamps when copying comments

      2307153 - new setting that gives the option to copy only the latest comments.

      Using a combination of the three notes above will allow you to avoid the duplicate comments issue going forwards. However to clean up (remove duplicates) from existing comments, we had to write our own custom program with custom business logic.

      Hope this helps!

      Cheers,

      Carlton.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.