Escolar Documentos
Profissional Documentos
Cultura Documentos
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
New features always get included with higher support packages. We recommend using the latest
available ST-PI support package level.
Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 6
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
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
Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 8
Custom Code Apps
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.
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:
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.
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
Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 10
Custom Code Apps
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
Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 11
Custom Code Apps
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.
Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 12
Custom Code Apps
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.
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.
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!
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.
Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 15
Custom Code Apps
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.
Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 16
Custom Code Apps
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.
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.
Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 17
Custom Code Apps
You can:
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:
http://help.sap.com/saphelp_sm71_sp01/helpdata/en/1e/d6fc8b7f204a289db763833525d89a/frames
et.htm
https://websmp205.sap-
ag.de/~sapdownload/011000358700001360432011E/End_User_Manual_for_CDC.pdf
https://websmp205.sap-ag.de/~sapdownload/012002523100012155842012E/CDC_FAQ.pdf
https://websmp205.sap-
ag.de/~sapdownload/011000358700001352902011E/Authorizations_for_CDC.pdf
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.
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.
Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 19
Custom Code Apps
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
Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 20
Custom Code Apps
Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 21
Custom Code Apps
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.
Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 22
Custom Code Apps
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
Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 23
Custom Code Apps
Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 24
Custom Code Apps
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.
Document History 2014 SAP AG or an SAP affiliate company. All rights reserved. 25
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