Skip to Content

Let’s Find Cloned Programs!

Hello All,

Cloned programs give major headache and maintenance issues when we go for an upgrade.

Before writing this program i have gone through various documents and threads which explains clone hunting in various methods.

My conclusion was to use the SAP standard way. If the system status meets the below criteria.

“System –> Status and you should see ST-PI 2008_1_XXX, which could be one of the following:

2008_1_46C,   2008_1_620,   2008_1_640,   2008_1_700,   2008_1_710

To get the Clonefinder, all you need to be in ST-PI SP4. Then use the transaction /SDF/CD_CCA” — Courtesy : Wiki in the above link.

So, i want to put that transaction to the maximum use and find all the SAP custom cloned programs which got effected due to upgrade.

Below is the step by step procedure which i followed to find all SAP custom cloned programs.

1.     Find all the custom packages in our system.

               a. Get all the “Z” packages from TVEDC table.

2.     Prioritize the packages based on their importance by speaking to the Functional consultant.

               a. Find out the number of objects per package and prioritize the packages based on the number of objects as well. (highest number of objects takes the first priority). TADIR table comes to rescue here. (Number of objects per package. Wrote a small program to do this task).

               b. We are interested only in programs and function modules here. Smartforms, scripts can be left. By the end of this step, we will have all the packages prioritized based on the number of objects it has.

3.      Now execute the transaction code /SDF/CD_CCA (Check the authorizations to execute it) with one package at a time or 10 based on the number of packages and load on each package as per convinience.

4.     From the output, copy the SAP standard programs column and feed them to TRDIR table where “NAME” = SAP standard programs and UDAT = Upgrade date range. So this effectively filters the objects and gives us only those standard programs which were effected due to upgrade.

5.     We have to change only those Custom cloned programs whose standard programs got effected due to the upgrade

6.     Version compare the standard program before upgrade and after upgrade and take a call if those changes are important for the custom program program as well.

p.s I have done the upgrade using Panaya Tool as well. Tool does the above steps for us and it sets the priority based on the usage levels of the program in production and the similarities. Even without tool also we can prioritize and find the similarities with the help of standard SAP itself.

Kindly pour in your inputs and your experiences with the clone programs. Anyways we all agree that less cloning and lesser maintenance

You must be Logged on to comment or reply to a post.
  • Using the SAP way is always the best one.

    If you use the clonefinder from SAP or better the Custom Code APPS in available in ALL SAP systems, just execute tcode CCAPPS.

    There is NO need to restict the input. Just start a calculation job in the left upper corner behind button JOBS. And it will run and do everything for you.

    Z packages are not needed to be filtered. We take all automatically.

    Important steps is defining a persistency to save the results in internal buffer tables.

    The jobs will do it by themself. To view result, JUST LOAD and existing results from DB.

    It will support also history reulsts and already calculated results will not calculated again.

    Concerning usage, WE have an UPL integration. If UPL usage tracking is active the layout in the result alv grid will offer you columns for the last 7 days to display the real usage of clones, interfaces or modifications.  As long as it is coding and not DDIC.

    Ands version compare, just use the remote compare BETWEEN systems. This is helpful to keep coding on the same level in all systems. Click on the version number in the output and see the amazing history version view.

    • Thanks a lot Bjoern for taking your time out to comment. Excellent inputs those are.

      And effort analyzer is an amazing addition and we can completely finsih the doc. But looks like our system have to be upgraded to use this 🙂 . Anyways, in future this is the way to go.

      Coming to our part, i have segregated in my packages because, the load on the program was too much and too many custom objects. having daid that, there is absolutely no need to segregate that in your method. Amazing addition to my doc. thanks again 🙂

    • Of course! Matthew, i concur with your statements and read your doc on modifying the standard than clone. completely agree. At least that costs lesser maintenance than this. but still the myth is never change the sap standard and just copy with Z prefix.

      • This myth must die!!!!!

        In case of a SAP standard report with included enhancement spots , the clone will loose all enhancements features. Alls spots positions will be commented out. Extremly dangerous!!!!

        So pleased modify or better enhance it by insertung a enhancemnet spot with help of a modification and do a spot implementation.

        The modified spot position is easy to handle in SPAU.

        • True. I think its better to showcase these advantages and the lesser effort during upgrade to avoid these clones. However, as a developers, we end up doing clone hunting in every new project 🙂 . And yeah, SPAU_ENH and SPAU will solve our purpose very easily and we dont need to look elsewhere!

        • Hi Bjoern,

          but what if we need to modify the Standard Object (i.e. FM) only for one Particular case?

          We can’t modify the object as it will be applied for all other users and programs.

          If logic changes now, who knows how other programs will work, which use this FM.

          Thank you.

          P.S. using Modification Assistant, of course.

          • If the modification is only for one case, surely that case can be dealt with in programmable logic?

            I.e. IF condition met THEN do deviation

            Having said that, I did once clone a logical database, because we needed the original, and the new functionality. But I still feel guilty about it.

          • Hi Matthew

            A small question, in big companies where you have region specific changes are needed in standard report and we only have two options modification or clone left with us. Which option you wil go for..? If i go by your experience then the standard program will be modified at N number of different places and during upgrade that will be as good as copied one Isnt in the worst case like these you make a complete clone and at least your basic functionality still runs..?(a thought..personally i myself hate clones 😉 ).

            So what approach you have followed in such cases.


          • Thats a nice idea Matthew. if the code change is damn simple just put it in the if and endif conditions based on for example sy-tcode 😛

  • Hi Sagar,

    very good post on a topic which everyone of us hits. The Custom Code Management transactions are not very well known but in some use cases very helpful – like upgrading to a new Support Package (Interface Analysis helps here for finding effects on your custom code).

    The disadvantage of the /SDF/ transactions is that they are aiming to find cloned SAP coding, that means the customer or ISV cloned coding delivered by SAP. But what with the custom coding itself? If you clone your Z-objects it won’t appear in these statistics.

    At my former employer we introduced the open source ConQAT system (CQSE – Overview) to find all clones (SAP & customer coding, we focussed on the customer coding) and even more than that (different metrics like complexity, length, comments…). Finding them is the one thing – but what should happen then? Analyzing is the one thing but you look into the past and what if you are a developer who wants to know how often the coding you’re maintaing at the moment is existing within one (or even more) systems in your landscape? There is an Eclipse add on but it is to be licensed, we saw a lot of benefits combined with the usage of ABAP in Eclipse – so we could provide the finding of cloned coding “at fingertips”. The disadvantage of this solution is that it’s quite a lot effort to implement the system, customize it to your requirements and implement a new role “quality manager”.

    Another interesting approach realized by SAP Netweaver technology (including statistics in BW) has been realized by Hendrik Brandes

    (unfortunately did not find a link, but maybe Hendrik can add this one).

    Best regards