Você está na página 1de 27

How-To Guide

SAP Active Global Support


Document Version: 1.0

SAP Custom Code Management


Custom Code Apps
Implementation Guide for Managers, Architects and Developers
Disclaimer
SAP assumes no responsibility for errors or omissions in this development guideline. SAP does not warrant the
accuracy or completeness of the information, text, graphics, links or other items contained herein. This document is
provided without warranty of any kind, either express or implied, including but not limited to, the implied warranties
of merchantability, fitness for a particular purpose, or non-infringement. Where this document contains information
about intended SAP strategies, developments and/or functionalities of SAP products, such information is not
intended to be binding upon SAP to any particular course of business, product strategy and/or development.
Any software coding or code lines / strings (Code) provided are only examples and are not intended for use in a
productive system environment. The Code is only intended to better explain and visualize the syntax and phrasing
rules for certain SAP coding. SAP does not warrant the correctness or completeness of the Code provided herein and
SAP shall not be liable for errors or damages cause by use of the Code, except where such damages were caused by
SAP with intent or with gross negligence.
Please note that this document is subject to change and may be changed by SAP at any time without notice.

Disclaimer 2014 SAP AG or an SAP affiliate company. All rights reserved. 2


Document History
Document Version Description Date
1.0 Customer release 14-02-2014

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 3
Table of Contents
SAP Custom Code Apps ........................................................................................................................... 6
1.1 What are Custom Code Apps? ...................................................................................................... 6
1.2 What are the Technical pre-requisites? ........................................................................................ 6
1.3 What roles and authorizations are needed? ................................................................................. 6
1.4 How does the Clone Finder work? ................................................................................................. 7
1.5 How to start the Custom Code Apps? .......................................................................................... 7
1.6 Generic Custom Code Apps start screen? ................................................................................... 7
1.7 The different UI components of Custom Code Apps in detail .................................................... 9
1.8 The different tabs and its options.................................................................................................. 9
1.9 General filtering recommendations ............................................................................................ 12
1.9.1 Similarity Analyzer ......................................................................................................... 13
1.9.2 Modification Analyzer .................................................................................................... 13
1.9.3 Application Hierarchy compression ............................................................................. 14
1.10 Use cases of CC Apps and its related applications .................................................................... 14
1.10.1 How to find clones of SAP objects in customer namespace in your system? .......... 14
1.10.2 How to find missing bug fixes?...................................................................................... 14
1.10.3 How to custom code in customizing tables that could be called dynamically? ....... 15
1.10.4 How to find Modifications? ............................................................................................ 15
1.10.5 Track new modifications and avoidance strategy ....................................................... 15
1.10.6 Custom Code Reference Analysis ................................................................................ 15
1.10.7 Detect usage of obsolete functions in our custom code and find the newer
object delivered by SAP replacing the obsolete code ................................................. 16
1.10.8 Cross system comparison of custom code Keep your custom code on one
stage .................................................................................................................................17
1.10.9 Cross system comparison of custom code using transports .....................................17
1.10.10 Customizing and table content comparison .................................................................17
1.10.11 Top used Modifications and clones .............................................................................. 18
1.10.12 Code history comparison .............................................................................................. 19
1.10.13 Transaction code similarity ........................................................................................... 19
1.10.14 Impact analysis of support packages ...........................................................................20
1.10.15 Display usage information based on UPL ....................................................................20
1.11 Terminology ..................................................................................................................................20
1.12 Frequently asked questions (FAQs) ........................................................................................... 21
1.12.1 Clone Finder shows objects no longer existing in the system .................................... 21
1.12.2 Clone Finder Admin or Expert Mode (ok code) Use caution! ..................................... 22
1.12.3 What happens if I start similarity analysis against SAP with an entered
RFC destination? ............................................................................................................ 22
1.12.4 Can I compare custom code against custom code in my system? ........................... 22
1.12.5 Objects from my own namespace are displayed under SAP objects column? ........ 23
1.12.6 What are the different similarity ratings? .................................................................... 23
1.12.7 Why is a clone of a standard SAP program(e.g. SAPMM61P) not detected by
clone finder analysis?..................................................................................................... 23
1.12.8 Split screen editor and version compare settings?..................................................... 24
1.12.9 Can the Clone Finder, Interface Analyzer and Modification Overview apps be
started in the background with default settings? ........................................................ 24
1.12.10 How often and in which system is it recommended to run the Clone Finder? ......... 24
1.12.11 Why does the online evaluation have a very long runtime?........................................ 25
1.12.12 How to develop own applications using Clone Finder technology? ........................... 25
1.12.13 How to enhance clone Finder with own logic? ............................................................. 25
1.12.14 Are there Expert Guided Implementation (EGI) sessions available for the
above topics? .................................................................................................................. 26
1.12.15 Important notes .............................................................................................................. 26

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 4
Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 5
Custom Code Apps

SAP Custom Code Apps


It is always a challenge for every SAP system owner to know what is really going on in their installed
systems. How much custom code exists that may already be available within standard SAP code? How
many modifications exist in the system? How many obsolete SAP function modules are being referenced
by custom code etc. SAP Custom Code Apps (formerly known as Clone Finder) will give you all this
information very easily.

1.1 What are Custom Code Apps?


Custom Code Apps are a set of different use cases which initially started with Clonefinder implementation
Over the last 3 years different use cases like Dynamic Interface Analysis, Code Reference Analysis, Cros
System Code compare, Modification overview, UPL control etc...Were identified and consolidated into
one application called the Custom Code Apps.

1.2 What are the Technical pre-requisites?


SAP ST-PI 2008_1_x SP4 SAP Solution Tools Plug-In
SAP Basis 620 and above

New features always get included with higher support packages. We recommend using the latest
available ST-PI support package level.

1.3 What roles and authorizations are needed?


The appropriate role is SAP_CCA_ALL.
It has the authorization object S_ADMI_FCD with activity ST0R selected.

Custom Code Apps

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 6
Custom Code Apps

1.4 How does the Clone Finder work?


The Clone Finder Similarity check is performed in 4 simple steps:
First the Customer Object is split into tokens (words).
This is also done for all objects in the relevant SAP packages. Unique tokens are assigned to the
specific objects of the packages.
If the Customer Object includes such a unique token the corresponding SAP object is picked up
for a detailed compare
Finally the objects are compared(finger printing) in detail and classified

1.5 How to start the Custom Code Apps?


Starting ST-PI SP09 and above, Custom Code Apps can be started using transaction CCAPPS
Till ST-PI SP08, the Clone Finder can be started using transaction code /SDF/CD_CCA

1.6 Generic Custom Code Apps start screen?


The Custom Code Apps consists of powerful sub tools like the SAP Interface Analysis, Modification
Overview, Reference Analysis, T-Code Similarity etc that assists you in obtaining transparency and
maintaining custom code.

Custom Code Apps

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 7
Custom Code Apps

SAP Clone Finder: The SAP Clone Finder determines the clones of SAP objects in customer
namespace. Based on a series of analysis, the results are displayed in a simple ALV list
displaying the similarity degree between the original SAP object and the cloned customer object.
In the result display, it will be possible to determine if a newer version of the original SAP object
exists. The results can be downloaded for further analysis.

SAP Interface analysis: The Interface Analysis will try to link SAP interfaces to Customer
Objects. The different interface types are Unique Interfaces, Class interfaces, Table Interfaces
and direct usages. A result list will present the Customer Object on the left hand side. The
detected SAP Interface is added with its interface type. In some cases there is also a linking
customer object Example: A Customer ABAP Class implements an SAP BAdI.
The Customer BAdI Implementation object is the linking object. A linking object is also presented
for navigation.

Hint: If you have many broken BAdI Implementations in the result list, please check out SAP note
1521903 and execute the included repair report ENHS_BADI_ANALYZE_GENERATE_ALL

SAP Reference Analysis: Detects referenced SAP objects like function modules and classes
directly called in customer programs. Displays all referenced SAP elements with coding behind
and detect if usage is internally, not released or obsolete. Displays 'quick info' regarding which
function module can be replaced with the release version of the function module. Quick filter
update to focus on pure SAP object changes.

Modification Overview: This special analysis is different in the way that there is no link from a
Customer Object to an SAP Object. Here there is only the SAP source code where customer has
added own coding. Instead on customers side the corresponding modification transport request
is listed (if existing).

Custom Code Remote Compare: This is a special mode of the Similarity Analysis. Here the
Customer Object is compared with the same object in another system. So it is necessary to
perform the check in RFC mode. This tool can be used to check if Customer Objects have been
modified in the successor systems

Top 20 Customer Object Analysis:

o The purpose of Top 20 modification analysis is to determine which SAP programs mostly
used in a defined period of time includes a modification. Starting this analysis from the main
Custom Code Apps screen will lead you to the following screen.

o The purpose of Top 20 clone analysis is the determination of the most used cloned programs
of the customer namespace in a defined period of time. The selection screen is similar to the
previous use case, but the radio button must be set on 'Similarity'. The number of objects to
be evaluated and the periods for evaluation can be selected. It is recommended to work with
the default value.

T-Code similarity Analysis: The SAP T-Code Similarity Analysis determines the clones of SAP
transaction codes in customer namespace. Based on a series of analysis, the results are
displayed in a simple ALV list displaying the customer transactions that are clones of standard
SAP transactions. Additionally, there is an option to include the Clone Finder analysis to
determine clones of transaction codes and source code objects in customer object namespace.

Set SAP Package Filter: SAP Package filter will preselect any objects of an installed SAP support
packages or support package stack and filter the output result list in the similarity analysis, the
interface analysis and modification overview. Only if the result object can be found as an object in
the support package object list it will be displayed. The main use case using a SAP package filter
is to find out e.g. if a Z program initially cloned from a original SAP program was part of a support
package change. Entering a date will automatically collect all installed support packages after the
entered date. Any entered values will have an influence on the Output tab -> Piecelist excluding
SAP Objects

Custom Code Apps

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 8
Custom Code Apps

1.7 The different UI components of Custom Code Apps in


detail
The User interface for most of the apps e.g. Similarity Analysis, Interface Analysis, Modification Overview,
Remote Compare and Reference Analyzer) in the Clone Finder have the same look and feel.

One of the most important UI components is the 'Customer Object Selection' screen. Only those objects
mentioned in the 'Customer Object Selection' will be considered for the detailed analysis.
Customer Namespace: Select the namespace to be considered for the analysis. Use the 'F4' help option
to assist you in selecting the namespace. Only objects from the selected namespace will be considered
during the analysis. For Similarity, Reference and Interface analysis provide /0CUST/ as the namespace.
For Modification overview provide /0SAP/ as the namespace.
Note: In some rare cases customer specific registered namespaces are not able to be recognized
automatically. In this case please enter your own customer namespace in the multiple selections.
Package: Or also known as development class. In certain situations, it might make sense to analyze
objects of certain packages only. By providing the names of the packages in the package field, you
can restrict the scope of the analysis.
Object Type: In some cases you may wish to only analyze custom code for certain object types like
programs or class methods etc. Currently, the analysis supports ABAP source code type objects only
(programs, function groups, class methods, SAP script forms)
Object Name: If you wish to analyze only certain known objects, then providing the names of the known
objects in the corresponding field will restrict the scope of the analysis. This will ensure that the analysis
is performed faster as the analysis scope is restricted.
Transport Request: In some cases, you may only want to analyze objects in a transport request.
Use case: A developer who has created some custom code. Before releasing the transport request
across the landscape, executing the various analyses will ensure that redundant/modified custom code is
not transported unless it is absolutely necessary.

Using a Transport request is in most cases the pure list of objects inside the transport. In the Single
RFC compare mode also we take care about the real old version inside this specific transport request. So
it might be happen that the cross system compare will display differences because we compare against a
historical code version of the transport.
Note: The customer object selection option only concerns clone finder analyzer, modification analyzer,
interface analyzer and custom code remote compare applications.

1.8 The different tabs and its options


Different scenarios mean that the various analysis needs to be executed differently. In some cases where
the analysis needs to be done on a small number of objects, you can perform a 'live' online test, whereas

Custom Code Apps

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 9
Custom Code Apps

if you have a huge list of customer object that needs to be analyzed regularly, then it makes more sense
to save the results in buffer that can be used at a later point of time.
The Clone Finder tool provides great flexibility as to how the analysis can be performed. Below mentioned
are some important components of the Clone Finder that allow you great flexibility in performing the
analysis.
Evaluation Tab:

Similarity Analyzer: In the Similarity Analyzer the options,

o Similarity check off: Will only list the objects based on the object selection criteria. No Similarity
Analysis is performed.
o Similarity check to SAP: Will check for clones of SAP objects in customer namespace
o Similarity check to package: Will check objects provided in customer namespace selection box,
against objects in specified package for clones
o Single object remote compare: Will check clones of objects across landscape(e.g. dev, prd,
quality). It is important that remote connections are already maintained with required
authorizations.

Remark: Similarity Check with Single RFC compare mode will take care about the historical code
version within the transport.

Interface Analyzer: In the Interface Analyzer the options

o Link Unique Interfaces: Will link Customer Object to a Unique SAP object.
Example is a BAdI definition that has been implemented by a BAdI impl class.
o Link Class Interface: This check will link classic ABAP Class/Interfaces to the customer object.
Generally a customer class either re-defines methods of standard SAP class or implements an
SAP Interface.
o Link Table Interfaces: This analysis will scan the content of SAP database tables. If a customer
function module, form, report or class is stored in such a table a possible dynamic link from SAP
to customers code is identified
o Link direct usages: This analysis will perform a Where-Used-Check. So it is possible to identify
places in the SAP code where customer modules are called directly.
Examples: Modifications, options prepared by SAP, SMOD exits etc
o Link reference analysis: This analysis will perform an Environment Check. You can identify SAP
Objects that is used in customer code. This feature is limited to special type of objects as function

Custom Code Apps

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 10
Custom Code Apps

modules, classes or interfaces.

The results of the analysis will indicate if the customer object is referring to a valid released SAP
object or if it is referencing an obsolete or internally released SAP object.

Persistence Tab:

o Combi mode: Will reuse pre-calculated and buffered results. For any objects not part of any
persistency buffer an online evaluation will be done.
o Scan all existing buffers: Will scan existing buffer results only. Any object not part of any buffer will
not be evaluated online
o Online mode: Will ignore any existing buffer and calculate the analysis completely new.
o Save to Buffer: Will allow entering a name for the buffer persistency. Often used if background
processing is used.
o Load from Buffer: Will allow loading an existing buffer result.
o Delete identifier: Will allow removing a pre-calculated result from buffer.
o Clone finder defaults: An integrated functionality only available for the similarity analysis.

You can schedule jobs for the Clone Finder variant with package processing. This can be useful for
systems with large amount of custom code. Results for each customer package are stored under RunID

Custom Code Apps

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 11
Custom Code Apps

/0SAP/SRV_<package>. Up to 9 parallel jobs can be triggered. The maximum number of packages to be


evaluated depends on the number of customer development packages and can also be scheduled for a
defined start time.

Additional Evaluation Tab:

o Add object size: Lines of code for a customer object is added. Empty lines and full comment lines
are ignored. This helps to filter out small objects
o Count Versions: The number of repository versions for a customer object is added. Basis is the
number of transports in version database (table VRSD).This helps to filter out objects with regular
changes
o Count SAP area: The number of different 3-step SAP application areas of the Environment Check
result is added in a separate column. This can help to classify the scope of a source (e.g.
standalone to highly integrated)
Limitation: Only the dictionary environment is determined as described in the Environment Check
Output Tab:

Under this tab you can pre configure and customize your result display. You can exclude and include
objects in the result list based on your requirements. Furthermore you can create your own transportable
ALV variants and transport them across landscape to ensure the results are displayed consistently.
SAP also provides 5 pre-defined variants for common use cases e.g. source code modifications, third
party created modifications, active modifications etc.

1.9 General filtering recommendations


The results displayed from various clone finder application analysis can sometimes be intimidating to
begin and work with. Critical information in the result list may be hidden or may be sought for. To obtain a
workable and qualitative work list, the result list at needs to be filtered to show or include meaningful
information.
Some common filters that can be applied are mentioned below.

Custom Code Apps

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 12
Custom Code Apps

1.9.1 Similarity Analyzer

o Filter by object size: From the Similarity Analyzer result screen, select column 'size'->'set filter
(ctrl+f5)and follow the instructions mentioned in the image above. The result is that only real
custom source code objects are displayed. Automatically generated source code (whose object
size is generally less than 20), will not be displayed in the result list.
o Filter by Gen flag
o Filter result set by object name TABLEFRAME
o Ignore all result lines in field "reference" with Interfaces
o Display outdated clones: In the Similarity Analyzer result screen, click on the 'Change Layout'
(Ctrl + F8) button and from the 'Column Set' select 'SAP Interface change date' and move it to the
left under the 'displayed Column' column. Click transfer (enter). If the 'SAP Interface change date'
is greater than the 'customer object creation date' then it means that there is a newer version of
the SAP object and that the cloned object does not contain the new changes provided by SAP

They objects filtered from the result list do not enrich the results but must be included in the initial result
list to ensure completeness. The generated objects with cloning behaviors in most cases generated by
SAP with help of any code generators. Not in all cases these generators set the flag "generated". But if it
is set, you can ignore it. The result remains in the initial result list for completeness and the possibility to
find out if a partner or custom specific code generator is doing such elements. e.g. knows in HCM
solution. Also objects with the tableframe keyword can be ignored. These were generated by the SAP
ABAP Workbench. Also they remain in the initial list for completeness and the need to have a detailed
view of custom specific generated tableframes. Interfaces play a subordinate role in the colnefinding logic
but an overview will help to support the decommissioning strategy.

1.9.2 Modification Analyzer


Filter results by provided SAP variants: SAP provides 5 standard variants to filter the modification
analysis results.

Custom Code Apps

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 13
Custom Code Apps

o Source code only variant for example will display the only real modifications performed on SAP
source code.
o Third party variant for example will filter and display only the modifications created by third party
vendors.
o Active and Inactive variants will filter the results by selecting only active and inactive source code
modifications.
o Migration variant will display only former migration relevant modifications.
o The 5 standard variants delivered by SAP are
0SDF_MOD_001, 0SDF_MOD_002, 0SDF_MOD_003, 0SDF_MOD_004, 0SDF_MOD_005

To use these SAP delivered modification specific variants go to the 'Output' tab of the 'SAP Modification
Overview' application and select a variant value for the output control->ALV layout by selecting the F4
option. The modification results are accordingly filtered and displayed.

1.9.3 Application Hierarchy compression


Will give you the possibility to compress the lines e.g. from a LO-MD-MG assignment down to LO-MD or
finally to LO. Just select the wished result lines and press the ICON

1.10 Use cases of CC Apps and its related applications


1.10.1 How to find clones of SAP objects in customer
namespace in your system?
o Start transaction code /SDF/CD_CCA
o Click on the 'SAP Clone Finder' application
o In the 'customer object selection' area select namespace /0CUST/ and fill other values (optional)
o In the 'Evaluation' tab, select a suitable option
o In the 'Persistency' tab, decide if you wish to perform the analysis inn 'Online', 'Combi' or other
modes described under persistency tab
o 'Additional info' and 'Output' tab default settings can be used
o Execute the Analysis by clicking on the 'execute' button or by pressing function key F8.

1.10.2 How to find missing bug fixes?


o Click on the 'Change Layout' (Ctrl + F8) button
o From the 'Column Set' select 'SAP Interface change date' and move it to the left under the
'Displayed Column' column.

Custom Code Apps

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 14
Custom Code Apps

o Click transfer(enter).

If the 'SAP Interface change date' is greater than the 'customer object creation date' then it means that
there is a newer version of the SAP object and that the cloned object does not contain the new changes
provided by SAP!

1.10.3 How to custom code in customizing tables that could


be called dynamically?
o Start transaction code /SDF/CD_CCA or CCAPPS
o Click on the 'SAP Interface Analyzer' application
o In the 'customer object selection' area select namespace /0CUST/ and fill other values(optional)
o In the 'Evaluation' tab, select 'Link Table Interfaces'
o In the 'Persistency' tab, decide if you wish to perform the analysis inn 'Online', 'Combi' or other
modes described under persistency tab
o 'Additional info' and 'Output' tab default settings can be used
o Execute the Analysis by clicking on the 'execute' button or by pressing function key F8.
o From the result display, check if function modules or programs entries exist under the 'Customer
object name' column
o If yes, then verify the corresponding 'SAP Interface object' name to determine the name of the
customizing table where the custom code is stored and possibly called dynamically

1.10.4 How to find Modifications?


o Start transaction code /SDF/CD_CCA
o Click on the 'SAP Modification Overview' application
o In the 'customer object selection' area select namespace /0SAP/ and fill other values(optional)
o In the 'Evaluation' tab, select a suitable opion
o In the 'Persistency' tab, decide if you wish to perform the analysis inn 'Online', 'Combi' or other
modes described under persistency tab
o 'Additional info' and 'Output' tab default settings can be used
o Execute the Analysis by clicking on the 'execute' button or by pressing function key F8.

1.10.5 Track new modifications and avoidance strategy


A very simple way to avoid modifications is using the Modification overview and sort the result list by the
column 'Creation Date'. You will receive a comprehensive list of the latest modifications that were made,
which objects are impacted and if there is already a transport released. Executing this report every week,
you can extract a kind of modification tracking and create your own trend analysis of modifications.

Keep in mind that the creation of a modification is in most cases better than the creation of a code
clone

Also refer to SAP Modification Justification Check(MJC) to obtain expert advice on how to avoid SAP
source code modifications whenever possible by using SAP standard functionality or by taking advantage
of the SAP Enhancement Framework.

1.10.6 Custom Code Reference Analysis


The purpose of this analysis is to find out how custom code is related to SAP code objects. With help of
an environment check and a code scan, we determine which objects are used in the custom code.
Execute the following steps

o Start transaction code /SDF/CD_CCA


o Click on the 'SAP Reference Analysis' application

Custom Code Apps

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 15
Custom Code Apps

o In the 'Evaluation' tab, select a suitable option (default is ok in most cases)


o In the 'Persistency' tab, decide if you wish to perform the analysis inn 'Online', 'Combi' or other
modes described under persistency tab
o 'Additional info' and 'Output' tab default settings can be used
o Execute the Analysis by clicking on the 'execute' button or by pressing function key F8.

Reading the output ALV from left to right, we find a comprehensive result of used function modules
including an evaluation if the function modules are allowed to be used, obsolete or not released for
usage. This will give you a hint how risky is your coding from a maintenance perspective. Obsolete usage
of SAP function modules should be replaced as soon as possible because SAP can remove the code at
any time in an upcoming support package or upgrade. To find out what could be a possible candidate for
replacement (hint), move your mouse pointer over the red symbol in the status column.
The yellow symbols indicated an outdated change of the custom code objects. This is not an error, but
can lead to any inconsistencies based on fact SAP changed the used objects after the last change date of
the related custom code object. This status indicator will be changed over time as soon as you implement
more SAP support packages. Moving the mouse pointer over the yellow symbol will show information
about the last change date of the custom code object and the last change date of referenced SAP object.

To speed up this evaluation process, you can use the quick filter by clicking the button in
the menu bar. This will filter all results where the SAP change happened after custom code change.

Clicking on the yellow symbol will link you directly to the SAP split screen editor showing you the
difference between the current code and the change shortly before the last change date of your custom
code. Instantly you can see what SAP changed in meantime.

1.10.7 Detect usage of obsolete functions in our custom code


and find the newer object delivered by SAP replacing
the obsolete code
o Start transaction code /SDF/CD_CCA
o Click on the 'SAP Modification Overview' application
o In the 'customer object selection' area select namespace /0CUST/ and fill other values(optional)
o In the 'Evaluation' tab, select a suitable option
o In the 'Persistency' tab, decide if you wish to perform the analysis inn 'Online', 'Combi' or other
modes described under persistency tab
o 'Additional info' and 'Output' tab default settings can be used
o Execute the Analysis by clicking on the 'execute' button or by pressing function key F8.
o Select column 'SAP reference type text' and click on the 'set filter'(ctrl+f5) button
o Select from F4 value help the value 'Usage (Object Obsolete)'
o The resulting list will display all obsolete SAP objects that are referenced in customer object
o Placing the cursor over the entries under the 'status' column the tooltip will display the name of
new SAP object that has replaced the obsolete SAP code

Custom Code Apps

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 16
Custom Code Apps

1.10.8 Cross system comparison of custom code Keep your


custom code on one stage

o Start transaction code /SDF/CD_CCA


o Click on the 'Custom Code remote compare' application
o In the 'customer object selection' area select namespace /0CUST/ and fill other values(optional)
o In the 'Evaluation' tab, select option 'single object RFC compare' and provide a destination name.
This will ensure that the objects provided in the 'customer selection' area will be compared
against the same objects in remote systems.
Note: It is important to maintain RFC destinations to use this feature. RFC destinations can be
maintained using transaction SM59
o In the 'Persistency' tab, decide if you wish to perform the analysis inn 'Online', 'Combi' or other
modes described under persistency tab
o 'Additional info' and 'Output' tab default settings can be used
o Execute the Analysis by clicking on the 'execute' button or by pressing function key F8.
o The result list will indicate how identical or different an object is across the landscape.

1.10.9 Cross system comparison of custom code using


transports
Another interesting use case is to find out if the elements of a transport were really transported to all
target systems in the code version of the transport. In this case the similarity check combined with single
RFC destinations will read all custom code objects inside a given transport and determine the code
version valid at the date of the transport. For the code comparison it might be happen an outdated,
historical code version will be used. The benefit is you are able to find out if a transport and all objects
inside are available in the target systems.

Selection an old transport or if the object itself was transported within a newer transport the output can
display a code difference.
If transport versions are used, a column with name "Version" including the transport number will be
displayed.

1.10.10 Customizing and table content comparison


If you want to compare content of customer tables, customizing tables with a flexible data model designer
we recommend to use the Solution Manager Tool "Cross Database Compare" as part of the Business
process Monitoring solution.

You use this application to compare data sources with a complex structure or hierarchy. You can also do
this across different systems. By doing so, you check whether the data in the source and target systems
is consistent, for example, whether updates in the source system have been correctly replicated to the
target system. Examples of complex data sources are sales orders with several billing items or a
customer master record containing multiple addresses, partner roles, and bank details.

Even though the data sources must contain the same data logically, they can have different values once
they have been forwarded to a different system, for example, from an ERP system to a CRM system.

Custom Code Apps

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 17
Custom Code Apps

You can:

o Model the data you want to compare


o Compare data at any time or schedule regular comparisons
o Display the results in an overview containing all the relevant details

This is a generic application, which means that you can use it to check the data consistency in both ABAP
and non-ABAP systems. You can use this application to compare the following data sources:

o Tables from the ABAP Dictionary


o Tables that are linked via ABAP Database Connectivity (ADBC)
o XML files on a Solution Manager application server

SAP Online help

http://help.sap.com/saphelp_sm71_sp01/helpdata/en/1e/d6fc8b7f204a289db763833525d89a/frames
et.htm

CDC End User Manual

https://websmp205.sap-
ag.de/~sapdownload/011000358700001360432011E/End_User_Manual_for_CDC.pdf

CDC FAQ and Troubleshooting

https://websmp205.sap-ag.de/~sapdownload/012002523100012155842012E/CDC_FAQ.pdf

Authorizations for CDC

https://websmp205.sap-
ag.de/~sapdownload/011000358700001352902011E/Authorizations_for_CDC.pdf

1.10.11 Top used Modifications and clones


The purpose of this analysis is to determine which SAP programs mostly used in a defined period of time
includes a modification. Starting this analysis from the main Custom Code Apps screen will lead you to
the following screen.

Enter the desired number of ABAP programs to be analyzed and the number of periods to be evaluated.
Put the radio button on the Modification'. Default setting is the top 20 used programs from the last 3
(default) month periods. 3 months is enough also based on fact the default retention time of workload
data is 3 months. The following result screen will give you a list of all modified and used programs.

Custom Code Apps

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 18
Custom Code Apps

The purpose of this use case is the determination of the most used cloned programs of the customer
namespace in a defined period of time. The selection screen is similar to the previous use case, but the
radio button must be set on 'Similarity'. The number of objects to be evaluated and the periods for
evaluation can be selected. It is recommended to work with the default value.

1.10.12 Code history comparison


o Start the 'Modification overview' application as described above
o From the result list, click on any entry under the column 'function Link'
o You will then be transferred into the version management tool, where you can view the history of
object revisions. If the version management is correctly maintained, then the tool will
automatically pre-select the current version of the object and last valid version of the object
delivered by SAP(see image below)

1.10.13 Transaction code similarity


o Start transaction code /SDF/CD_CCA
o Click on the 'T-Code Similarity' application
o Execute the analysis with the default selection by clicking on the 'execute' button or by pressing
function key F8.
o By default, the application will find for cloned transaction codes and include Clone finder results
too. This will enable not only duplicate transaction codes to be detected, but will also display
cloned source code objects too. (This analysis may involve long run times)
o If you uncheck the 'Cloned program included' option, then only transaction clones are detected.

Custom Code Apps

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 19
Custom Code Apps

1.10.14 Impact analysis of support packages


With the clonefinder tool it is possible to detetct impact of any already installed support packages. The
impact will be handled with two different possibilities. The first on eis using a SAP package filtering on the
result list. Any result from the modification overview, similarity check, interface analysis or reference
analysis will output a relation between the customer objects and the related SAP objects. Using a SAP
supportpackage as a filter list or any self-defined object list, the tool will remove all entries from the output
as soon as the SAP object belongs to the SAP package.

1.10.15 Display usage information based on UPL

o Will give you an overview about the last 7 days of usage from Monday to Sunday
o Available only if UPL data are available
o Can be activated via ALV layout only
o Long processing time based on scanning millions of data lines. Recommended to set a valid
object list
o Will be a sneak preview tool to promote installation of CCLM

1.11 Terminology

o Clone
Clone is a custom code objects copied and in some cases changed manually. Clones were
created in the past to avoid direct SAP code modifications. This strategy lead to an immense
maintenance risk losing important SAP bug fixes, security patches or enhancement capabilities.
SAP recommends avoiding clones by modifying or better enhancing SAP objects with state of the
art enhancement capabilities provided by SAP.
o SAP Formula Interface
The customer printing form uses an SAP Formula Interface.
o SAP BAdI Enhancement
The Customer Enhancement Implementation implements an SAP BAdI
o SAP Code Enhancement
The Customer Enhancement Implementation implements an implicit
o Enhancement Spot in the SAP Source Code
o (Explicit Enhancement Spots are also detected, but they are
usually reserved for SAP Industry Solutions)
o Broken Enhancement
The Customer Enhancement Implementation is broken and has no link to Enhancement Spots
o SAP BAdI Interface (kernel)
The Customer ABAP Class implements a kernel BAdI. The BAdI Definition is part of an
Enhancement Spot.
A Customer Enhancement Implementation is linking both objects

Custom Code Apps

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 20
Custom Code Apps

o SAP BAdI Interface (classical)


The Customer ABAP Class implements a classical BAdI. A Customer Enhancement
Implementation is linking both objects
o SAP Table Link
The Customer Object is stored in an SAP table. It is possible that the SAP Standard Application
calls this object.
Standard example is a Business Transaction Event (BTE): Here a Customer Function Module is
stored in tables TBE* or TPS*. SAP can then call this function module dynamically.
o SAP Direct Usage
A Customer Object call was detected in SAPs Standard Code. This is either a modification or a
prepared call from SAP.
Example: SAP may dynamically check for a special Customer Object existance
o SAP SMOD Exit
A Customer Function Module is called via a defined SMOD customer exit. A Customer CMOD
Project is linking both objects
o Usage (Released for Customers)
A released SAP object is called by customer code.
o Usage (Released SAP Internally)
An SAP internally released object is called by customer code.
o Usage (Object Not Released)
A non-released object is called by customer code.
o Usage
An object is called by customer code. Release information is not available for object type.
o Usage (Object Obsolete)
An obsolete object is called by customer code.
o Modification (Option prepared by SAP)
A Customer Modification in a prepared include of SAP. Example: Old style customer exists in
package VMOD
o Modification (Minimal in empty Include)
A Customer Modification in an empty SAP include. The chance that this will be overwritten by
SAP support packages is very low.
o Modification (assisted)
A Customer Modification created with the SAP Modification Assistant (recommended)
o Modification (unassisted)
A Customer Modification created without SAP Modification Assistant. (not recommended, but
limited to some special object types)
o SAP Environment
Assignment of the SAP Area a Customer Object is addressing
o No SAP Reference added or detected
For the Customer Object no link to SAP Objects was detected
o Not covered by persistent result
A requested result is not covered by a specific persisted run

1.12 Frequently asked questions (FAQs)

1.12.1 Clone Finder shows objects no longer existing in the


system
This issue might occur if there is a bug with the deletion of function groups or the deletion was not finally
transported. To solve this problem, please ensure you have transported the deletion of a function group
(FUGR) to the target systems.
Execute the transaction code STDR to clean up TADIR entries without sub objects.

Custom Code Apps

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 21
Custom Code Apps

1.12.2 Clone Finder Admin or Expert Mode (ok code) Use


caution!
o Start transaction code /SDF/CD_CCA or CCAPPS
o Enter SOS or ADMIN in OK code field

1.12.3 What happens if I start similarity analysis against SAP


with an entered RFC destination?
In this special mode the local custom code will be analyzed against the SAP code base of the RFC
system. Difference here is the naming similarity is deactivated.

1.12.4 Can I compare custom code against custom code in my


system?
Yes, it is possible to compare custom code against custom code in your system. However, you must
provide the names of the packages you want to compare your custom code against. Please take a look at
the following screenshot to get an idea.

Comparing custom code against SAP code we do have a strict separation of sets. In case of pire custom
code you have to define such a logical set devider either by RC systems or by defining packages for
scanning.

Custom Code Apps

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 22
Custom Code Apps

1.12.5 Objects from my own namespace are displayed under


SAP objects column?
This might happen in case you have registered an own customer namespace at SAP. Depending in the
system setting, (Development or nun-Development) your namespace ias assigned to be a producer or a
consumer. In case your own namespace will be found as producer area, it will be sees like SAP or any
other partner code. To avoid this behavior please start the selection screen with manually entered own
customer namespace in multiple field selection "Customer namespace"

1.12.6 What are the different similarity ratings?


o Identical = 100% identical code (comment line are not taken into account)
o Very Similar = more than 80% of the tokens are equal.
o Similar = more than 80% of the tokens are equal.
o Partly Similar = more than 40% of the tokens are equal

1.12.7 Why is a clone of a standard SAP program(e.g.


SAPMM61P) not detected by clone finder analysis?
The clone finder uses the concept of Tokenization. So, if the copied program does not contain enough
tokens then there is a remote possibility that this cloned object is not shown in the analysis results. A
classic example could be copying a std SAP program containing ~10 lines and making couple of minor
changes in the cloned object.

The Clone finder is optimized to analyze huge volume of objects.In order to get the most optimal results
some basic token threshold values have been defined in the tool.Depending on the tokens determined in
the cloned report, the object might not be displayed if it falls short of the defined minimum token criteria.
In such cases, you can tweak the threshold values to get the desired results.To set these values enter
clone finder in the Admin Mode -> click on Parameters(expert) and provide values as indicated in the
screenshot below

Custom Code Apps

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 23
Custom Code Apps

1.12.8 Split screen editor and version compare settings?


Clonefinder offers capabilities to display code differences in the ABAP Split Screen editor. The default
setting is the list display of the version comparison. Under the menue button "Settings" you are able to
activate the Spit Screen Editor with scrollbars. This will be the new default setting persisted per user. If
you want to go back to the classic display mode. Do the following steps: Select in menue 'Utilities ->
Versions -> List display' and classic version compare will be displayed

1.12.9 Can the Clone Finder, Interface Analyzer and


Modification Overview apps be started in the background
with default settings?
Yes, it is recommended to start the above apps with the default settings. Perform the following steps.

o Start transaction code /SDF/CD_CCA


o Click on the 'persistence' button->click on 'schedule job...' button for all the 3 activities.
o Status of the jobs can be monitored by starting transaction SM37.

1.12.10 How often and in which system is it recommended to


run the Clone Finder?
This depends on how custom code is developed in your organization. If there are a lot of development
activities and objects are released frequently across the landscape, then it is recommended to use the
apps regularly. Otherwise, execute Clone finder analysis once every 4-6 weeks.
It is recommended to run these analyses in the quality system.

Custom Code Apps

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 24
Custom Code Apps

1.12.11 Why does the online evaluation have a very long


runtime?
The Clone Finder performs a series of complex analysis to scan SAP's environment and find clones in
customer namespace. Understandably, this will result in long runtimes. Hence it is recommended to start
the analysis in the background and store the results in buffer by providing a corresponding id. In the
subsequent clone finder runs, you can either use the results stored under the buffer id created above or
you can use the 'combi mode' to combine the results that are stored in the buffer with online evaluation.

1.12.12 How to develop own applications using Clone Finder


technology?
The Custom Code Apps are the main UI to start and evaluate custom code related evaluations. But it
might be helpful to start these tools remotely from a central system like Solution Manager or to develop
own applications with a more fancy, user friendly design. For this purposes we provide a bunch of ready
to use APIs.

Learning how to design own applications, we provide a demo and example report
/SDF/CD_CUSTOM_CODE_CONNECT_RT calling the different APIs in the right order including interface
handling, data processing and batch jobs evaluations.

1.12.13 How to enhance clone Finder with own logic?


o Support of individual menus and buttons
o Support of Multi-line selection
o Support of adding individual new columns in the result list (few fieldlist)
o Support of Hotspot events
o Support of ALV output changes on demand

New fields definition:

Enhance strukture ts_alv_special in /SDF/CD_CUSTOM_CODE_CONNECT_TY

Control visibility and technical visibility Method LCL_OUTPUT ->GET_FIELDCAT_SPECIAL:

Change and enhance content Method LCL_OUTPUT -> ENRICH_SPECIAL_RESULTS

New menus and buttons GUI-Status STANDARD_FULLSCREEN

Hotspot handling Method LCL_OUTPUT ->HOTSPOT_SPECIAL

Custom Code Apps

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 25
Custom Code Apps

User Command processing with multi line selection Method LCL_OUTPUT -


>USER_COMMAND_SPECIAL

1.12.14 Are there Expert Guided Implementation (EGI) sessions


available for the above topics?
Yes, there is an EGI offered for Software Quality and Clones. Click here for a schedule of the EGI in all
the time zones. Expand Implement Run SAP like a Factory on Your SAP Solution Manager 7.1 or
Implement Run SAP like a Factory on Your SAP Solution Manager 7.0 to get the schedule.

1.12.15 Important notes


Modifications related notes
Note#: 1870040 (Instruction 1713247) for SP8
Note#: 1977088 (Instruction 1713254) for SP9
Please also check for dependencies on notes 1654078 (1059761) and 1876007 (1600012)

Custom Code Apps

Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 26
www.sap.com/contactsap

www.sdn.sap.com/irj/sdn/howtoguides

2014 SAP AG or an SAP affiliate company. All rights reserved.


No part of this publication may be reproduced or transmitted in
any form or for any purpose without the express permission of SAP
AG. The information contained herein may be changed without
prior notice.
Some software products marketed by SAP AG and its distributors
contain proprietary software components of other software
vendors. National product specifications may vary.
These materials are provided by SAP AG and its affiliated
companies ("SAP Group") for informational purposes only, without
representation or warranty of any kind, and SAP Group shall not be
liable for errors or omissions with respect to the materials. The
only warranties for SAP Group products and services are those
that are set forth in the express warranty statements
accompanying such
products and services, if any. Nothing herein should be construed
as constituting an additional warranty.
SAP and other SAP products and services mentioned herein as well
as their respective logos are trademarks or registered trademarks
of SAP AG in Germany and other countries.
Please see http://www.sap.com/corporate-en/legal/copyright/
index.epx for additional trademark information and notices.

Você também pode gostar