Custom Code Within SAP S4HANA OnPremise PDF
Custom Code Within SAP S4HANA OnPremise PDF
Custom Code Within SAP S4HANA OnPremise PDF
1 INTRODUCTION --------------------------------------------------------------------------------- 4
5 APPENDIX --------------------------------------------------------------------------------------- 19
From a business perspective the following key simplifications and innovations can be mentioned
Optimized working capital with new accounts payable and receivable cockpits
Decreased stock buffers with a simplified data model in inventory management for real-time,
high-volume processing
Increased visibility with real-time insight into stock and material flow
Reduced manufacturing cycle time with streamlined material flow for internal requirements
and material requirements planning
Augmented reactivity with real-time monitoring of production orders for flow and critical
issues
Improved operational decisions with easier simulation of supply alternatives
Lower procurement costs with standard integration to the Ariba Network
Better customer service with a new sales order fulfillment cockpit to help identify
bottlenecks and issues instantly
SAP user experience (UX) with SAP Fiori. The user interfaces run on any devices, desktops,
tablets, smart phones, and even smart watches and have been redesigned for exception-
bases issue handling.
Leveraging the SAP HANA capabilities with a simplified data model with no aggregates &
indexes, real time & high volume processing , Elimination of locking and increased
throughput.
In this sense SAP is re-architecting its solution for modern business processes demanded by an
increasing digitization of the world. Re-architecting a solution that has been growing over the past 25
years means and sometimes evolved into different data structures and architectures means as well
that we have to decide on one data structure and architecture moving forward. This is the only way
how we can prepare the solution for more simplicity and faster innovation cycles.
With the system conversion approach of SAP S/4HANA SAP is offering a technical approach to
convert an existing SAP Business Suite system to SAP S/4HANA. The system conversion to SAP
S/4HANA is based on established lifecycle management tools (Software Update Manager SUM with
Database Migration Option DMO). Things are done differently in SAP S/4HANA and a customer needs
to adopt to the target capabilities of SAP S/4HANA. Many of the changes are technical in nature and
1
See Simplification List in the SAP Help: Link
Custom Code within SAP S/4HANA, on-premise edition 5
2 SAP S/4HANA Extensibility Some Basics
Additionally in SAP S/4HANA the extensibility technique designed for the cloud can be used (and SAP
recommends to use them as well in SAP S/4HANA, on-premise edition). On-premise customers can
benefit from the tools that are designed for the cloud to reduce their TCO related to custom code.
For more details regarding extensibility in the cloud see the information in the following SAP
Community Network blog (S/4HANA Extensibility The new White Paper)2.
To identify the required custom code adaptions SAP S/4HANA offers a new custom code check tool
the so called Custom Code Migration Worklist. The Custom Code Migration Worklist shows
customer objects, which reference SAP objects changed in S/4HANA, and appropriate guidance what
needs to be done. See chapter 3.2 for more details.
Additionally the traditional SAP Custom Code tools remain relevant and are available as part of SAP
S/4HANA. See chapter 3.1 for more details.
2
Link to the PDF document: http://www.sap.com/bin/sapcom/en_us/downloadasset.2015-07-jul-08-
12.sap-s4hana--extensibility-for-customers-and-partners-pdf.bypassReg.html
3
For more application specific information see SAP Note 2206980 - Material Inventory Management: change of
data model in S/4HANA
Custom Code within SAP S/4HANA, on-premise edition 6
Material document data will be stored in MATDOC only and not anymore in table MKPF and MSEG.
Additionally the aggregated actual stock quantities will not be persisted anymore in the hybrid or
replaced aggregation tables. Instead, actual stock quantity data will be calculated on-the-fly from the
new material document table MATDOC for which some of those additional special fields are used.
Hence, with the new MM-IM data model the system will work on database level in an INSERT only
mode without DB locks. Nevertheless, for stock decreasing processes there will be still ABAP locks to
ensure stock consistency. A further advantage of the new MM-IM data model is the capability of
simple and fast reporting because the most information is all in one place - table MATDOC.
All below mentioned tables of the SAP ERP 6.0 product do still exist in S/4HANA as DDIC definition as
well as database object and the hybrid tables will still be used to store the material master data
attributes. For compatibility reasons there are Core Data Service (CDS) Views assigned as proxy
objects to all those tables ensuring that each read access to one of the mentioned tables below still
returns the data as before in SAP ERP 6.0.
The CDS Views do the on-the-fly aggregation of actual stock quantities from the new MM-IM data
model and join the master data attributes from the material master data table. Hence all customer
coding reading data from those tables will work as before because each read access to one of the
tables will get redirected in the database interface layer of NetWeaver to the assigned CDS view. Just
custom code which executes a write accesses to those tables (anyway not recommended) have to be
adjusted.
Usage: 65% of custom code objects have not been used within the last 4 weeks
Similarity: 12% of custom code objects are identical or very similar to each other (clones)
Quality: 60% of all custom code objects contain code inspection messages
Criticality: 23% of custom code objects were supporting critical processes
The move SAP S/4HANA is a great opportunity to optimize your custom code and the processes
around the custom code:
Remove unused custom code (based on input from business department and based on
measurements)
Setup governance models with the goal to avoid new custom code and review existing
modifications
Improve and optimize quality, performance and security of custom code
It is not unusual for customers to realize that 50% of the extensions and modifications that
hamper fast release cycles and require long test cycles were no longer necessary to run the
business.
In general, when moving to SAP S/4HANA, customers can leverage the SAP HANA Cloud Platform
(HCP) to build and operate extensions to the SAP core as well as own applications. HCP is a common
extension platform for all SAP products, offering an SAP Fiori stack, a SAP HANA database, a full-
fledged development environment and even additional choices, such as the integration of open
source solutions. It is the ideal platform for all custom apps which operate in a self-contained way,
are only loosely coupled with SAP S/4HANA or reach to the outside world. This kind of extensibility is
called "side-by-side extensibility"5 and has the advantage that extensions run in a safe environment
so that innovation packages can be easily applied to the SAP S/4HANA core. The SAP S/4HANA core
system remains clean and can be quickly and easily updated when new innovations are added, in
just the same way that consumer mobile apps are updated on a regular basis. Further, the SAP
S/4HANA stack can also be directly extended by partners and customers in a process that we call
"in-app extensibility"6. For on-premise deployment existing customer and partner extensions, and
even modifications can be used. It is only necessary to adapt them according to the simplification
SAP has applied to SAP S/4HANA compared to the SAP Business Suite (e.g. transition of index tables
into SAP HANA compatibility views). All these changes are described in a simplification database
which can be downloaded from the SAP Market Place. Even more, a custom code migration tool
exists which analyses custom code and its usage, resulting in a precise list of extensions and
modifications which have to be reworked. In the cloud deployment, key user extensibility is the
recommended approach for in-app extensibility. Within the SAP Fiori UX key users can adapt UIs,
create field extensions or even define simple custom business logic at selected places. The underlying
SAP S/4HANA extension framework isolates extensions from the core and thus drives safeguard
agility for cloud deployments. To drive agility, key user extensibility is also available for on-premise
4
Based on SAP (CQC) Solution Transition Assessment and follow-up services
5
side-by-side extensibility: Extension built on a separate extension platform (see SAP S/4HANA Extensibility
Whitepaper [Appendix] for more details)
6
in-app extensibility: Extension built in the same system as the enhanced application (see SAP S/4HANA
Extensibility Whitepaper [Appendix] for more details)
Custom Code within SAP S/4HANA, on-premise edition 8
deployments. Existing extensions and modifications cannot be transformed into key user extensions,
but a data migration into key user extensions will be offered.
With SAP S/4HANA there is an additional custom code check tool available the Custom Code
Migration Worklist. The tool is described in chapter 3.2.
Before you are going in the very details to adapt the custom code you should make yourself familiar
with the SAP S/4HANA, on-premise solution and the things which are different to the SAP Business
Suite. Here two central documents are relevant:
In cases where within SAP S/4HANA existing functionality was consolidated (following the principle of
one) related custom code might become obsolete and a detailed investigation regarding custom
code adaption might in this case not be required.
The application provides an overview of all the custom developments in your systems. You can
identify changes and manage your developments more effectively. You can also perform upgrade
tests more efficiently by identifying the custom objects that are currently in use.
7
See SAP Help: Link
Custom Code within SAP S/4HANA, on-premise edition 11
Figure 1: Custom Code Migration Worklist at a Glance
In the context of Custom Code Migration Worklist a central component is a data store called
Simplification Database". This database contains information about which SAP objects changed
between the classical Business Suite and SAP S/4HANA. For each changed object, a SAP note is
referenced describing what has been changed, why it has been changed and how custom code needs
to be adapted.
The content for the Simplification Database can be downloaded as a ZIP file from the SAP Service
Marketplace and imported in a SAP NetWeaver 7.5 system.
See SAP Note 2241080 for more details about the download of the SAP S/4HANA on-premise edition
custom code check content from SAP Service Marketplace
The ZIP file can be imported into SAP NetWeaver 7.5 system using program
SYCM_UPLOAD_SIMPLIFIC_INFO.
In addition to the information about changed SAP objects, the custom code needs to be scanned for
references to these SAP objects. The customer can run the Custom Code Analyzer to extract these
references. The resulting file can be imported in the SAP NetWeaver 7.5 system.
See SAP Note 2185390 for more details on the Custom Code Analyzer
The Custom Code Analysis Result file can be imported into SAP NetWeaver 7.5 system using
program SYCM_UPLOAD_REPOSITORY_INFO
With executing the Custom Code Migration Worklist the information about the current custom code
base is checked against the content of the Simplification Database. This custom code information
includes modifications and enhancements to SAP code as well as customer-owned main objects,
respective where-used list information and possibly available usage information (UPL). The Custom
Code Migration Worklist is provided in an ALV-like list (including XLS download opportunities).
Besides the pure listing of customers code entities which do not comply with the SAP S/4HANA data
structure and scope additional information (based on SAP notes) and recommendations will be
included in the resulting list. Customers can navigate from the worklist to a corresponding SAP Note.
The dedicated SAP Notes then will give the explanation about the technical change and how the
related custom code needs to be adapted. Based on the results, the individual custom code analysis
results and the provided adaption recommendations, the customer can plan and adapt his custom
code to comply with the SAP S/4HANA data structures and scope.
In the preparation phase where no SAP S/4HANA system might be available the custom code
migration worklist is used to plan (effort-wise and area-wise) the SAP S/4HANA transition project. In
the realization phase the customer is using the Custom Code Migration Worklist to execute the
different custom code related tasks.
In the preparation phase the customer just need access to a SAP NetWeaver 7.5 system. A SAP
S/4HANA is not required. Based on the Custom Code Analysis Result file and the custom code check
content the analysis can be done. For the different simplification items detailed adaption information
are provided based on SAP Notes.
In the realization phase a SAP S/4HANA system is required. SAP S/4HANA 1511 is based on SAP
NetWeaver 7.5 system. Accordingly the Custom Code Migration Worklist is available (usually you
would execute the custom code analysis in the SAP S/4HANA DEV/TEST system). Based on the Custom
Code Analysis Result file and the custom code check content the analysis can be done. For the
different simplification items detailed adaption information are provided based on SAP Notes. In case
the custom code is available on this SAP S/4HANA system the customer can navigate from the Custom
Code Analysis Result Screen to the dedicated custom code to be adapted.
In dependency to the dedicated simplification item the custom code can be adapted already on start
release (for example for Simplification items where the functionality is not available on SAP S/4HANA
or where anyway the custom code is not cleverly done [e.g. in case in current custom code CHAR18 is
directly used and not domain MATNR is referenced]). For the majority of the required custom code
adaptions the installation of the SAP S/4HANA is required. These adaptions need to be done on SAP
S/4HANA target release.
The recommended system landscape for a SAP Business Suite release upgrade is similarly relevant for
a SAP S/4HANA system conversion.
The following figure display the sequence of a system conversion including the custom code
adaptions in an abstract manner.
Figure 5: Abstract sequence of a system conversion including the custom code adaptions
The figure is just an example and not as dedicated landscape recommendation. In reality it can be
assumed that there are more system categories (TEST, QAS) involved and more steps are executed.
For example in a dedicated transition project several system conversions of TEST systems most
probably will be executed.
Within the SAP S/4HANA system conversion project you can distinguish between the following steps
related to your custom code:
General information (information which should always be available independent from the
SAP S/4HANA transition project)
o Number of custom objects (reports or transactions) including modifications and
enhancements.
o SAP objects referenced from your code
o The quality of your custom code
o Custom code documentation and business process documentation
SAP S/4HANA specific information
o Areas of required Custom Code adaption (dependent from dedicated Simplification Item
differs from customer to customer)
o Number of custom objects to be adapted based on the Custom Code Migration Worklist
Based on the Usage and Procedure Logging (UPL) you can switch on a monitoring feature in your
productive system over some weeks time. UPL tracks (with very little performance impact) what code
has been executed. Please take care of also tracking special business events like month-end activities).
More details regarding the Set-Up of the UPL: Link
When you compare the list of used code, with the custom code inventory list, you know what code is
not in use. The Decommissioning Cockpit as part of Custom Code Lifecycle Management in SAP
Solution Manager supports you in that exercise, and helps you to find the right custom objects to
decommission. More details regarding decommissioning with CCML: Link
There is a one-step procedure in the Software Update Manager (SUM) for customers based on SAP
ERP6.0 on Unicode. Customers on older releases (or still with a Non-Unicode system) have to upgrade
(recommended) to SAP Business Suite powered by SAP HANA (ERP 6.0, EHP7, SAP HANA) and then to
SAP S/4HANA. We call this then a two-step procedure
Customers on any DB need to migrate to SAP HANA (in addition to the installation of the SAP S/4HANA
software). The move to SAP HANA database is included in the one-step-procedure and called the
Database Migration Option (DMO) within Software Update Manager (SUM)
Customers with SAP S/4HANA Finance moving to SAP S/4HANA, on-premise edition 1511 have already
adapted to the application simplification in financials area.
Two-Step Procedure
Customers going to SAP S/4HANA, on-premise edition 1511 in a two-step procedure need to adapt
their custom code to the first step target (lets assume in the first step the target is SAP Business Suite
powered by SAP HANA) first and then to the second step target. In case you modified an SAP
Custom Code within SAP S/4HANA, on-premise edition 16
program, and SAP comes with a new version of this program as part of the upgrade or EHP, you will
need to adjust your custom code and your modification (that is: keep it, or go back to SAP standard, or
mix it somehow together. See how good it was to remove unused waste before?). Once you have
done the upgrade and the EHP installation, you will see all modified objects that need to be technically
adjusted in the transactions SPDD8, SPAU9 or SPA_ENH.
Database Migration
If your current system is not already on SAP HANA, you will need to change your database. SAP HANA
behaves under certain conditions different than other databases. For instance, if you used database
hints in your coding, those hints may have to be technically adjusted. Also, during DB migration to SAP
HANA, cluster tables are converted to transparent tables. The implicit sort order of cluster tables is no
longer a given ABAP coding expects data coming to be automatically sorted from the database, and
is subject for inspection (implicitly expecting sorted data is should not be the custom code guideline
for guidelines see for example the following SAP SCN Blog: Link).
Simplification Items describing functionality which is not available in SAP S/4HANA (but available in
SAP Business Suite). Usually the functionality is then covered by a different business process (the
functional equivalent is then mentioned in the Simplification Item).
Simplification Items where the functionality changed within SAP S/4HANA
Simplification Items describing functionality which is available in SAP S/4HANA, but not considered as
SAP S/4HANA target architecture. This functionality might be subject of change in future SAP
S/4HANA releases
The categories of the Simplification Items do have an impact on the existing custom code:
Custom Code related to functionality not available in SAP S/4HANA need to be removed. The customer
need to check if the required functionality is covered by the functional equivalent (within Sap
S/4HANA standard). In case the requirement is not in scope of the standard functionality appropriate
enhancements need to be specified (recommendation: use the standard extensibility tools as far as
possible)
Custom Code related to changed functionality need to be adapted. The details are depending from the
change and the related custom code. Based on the Custom Code Migration Worklist the customer gets
additional information how his custom code needs to be adapted.
Custom Code related to functionality not considered as target architecture is subject of an optional
adaption. The traditional functionality is still supported in SAP S/4HANA accordingly the related
custom code should run in an unchanged manner. Nevertheless the recommendation is to move to
the target architecture functional-wise. Then the related custom code has to follow
8
Transaction SPDD allows you to adjust modifications to ABAP Dictionary objects during a system conversion
9
Transaction SPAU allows you to adjust notes, programs, function modules, screens, interfaces, documentation, and text
elements after a system conversion.
Process customer development objects related to Simplification items with functionality not available
in Sap S/4HANA. Remove the related custom code consider equivalent standard functionality if
required create new enhancements (us recommended extensibility functionality).
Process customer development objects related to Simplification items where the functionality has
been changed. Adapt your custom-code based on the information from custom code migration
worklist and code inspector checks.
Ensure that you start your system conversion with the newest available version of SUM
Execute transaction SPAU
Execute transaction SPDD
1. Reset all candidates which have no difference between last modified version and delivered SAP version
(consider log entries
in /usr/sap/SUM/<systemID>/SUM/abap/log/SPDD_RESET_CANDIDATES.<systemID>, which has been
generated by SUM; see documentation https://websmp203.sap-
ag.de/~sapidb/011000358700000890302012E > Automatic Reset of Non-Adjusted Repository Objects to
SAP Original Version)
2. Extend the S/4 core data model by own custom fields, appends (e.g. in SD appends have to be moved
from old db tables to new db table) as mentioned by pre-checks or related Simplification DB
3. Adjust all other DDic objects in SPDD
Find and migrate dynamic usages in your custom code by using Runtime Check Monitor and Blacklist
Monitor in your Q- and Productive System
Recommendation: Each step above could be parallelized to assign the different tasks to different
processors. To avoid unnecessary adaptations, the migration for functionality not available in SAP
S/4HANA should be completed before adaptations take place.
The offered custom code related tooling does not substitute testing, quality assurance measures to
and regression tests related to your custom code!
Static code checks and automated tests like ATC etc. to avoid regressions
Manual testing of your business transactions
Performance optimizations: Iterative tuning of SQL statements for HANA using SQL Monitor based on
data from the productive system
Document Link
General SAP S/4HANA information sources
SAP SCN - SAP S/4HANA Community Network Link
SAP SCN - SAP S/4HANA Cookbook Link
SAP SCN - The System Conversion to SAP S/4HANA, on-premise edition 1511 - Technical Link
procedure and semantic adaption tasks
SAP SCN - SAP S/4HANA Custom Code Migration Worklist Link
SAP S/4HANA Extensibility
SAP SCN - The Key User Extensibility Tools of SAP S/4 HANA LINK
SAP S/4HANA Extensibility - Whitepaper Link
Custom Code
SAP SCN - Custom Code Management in ABAP Development Link
SAP TechEd replay - ITM103: Efficient Custom Code Management Prepare for SAP HANA: Link
Whats New?
SAP SCN - Usage and Procedure Logging (UPL) Link
SAP SCN - Set-Up UPL Link
SAP SCN - Decommissioning with CCLM in Solution Manager SP12 Link
SAP SCN - Development Guidelines for Greenfield Implementation in sync with SAP Custom Link
Code Management
ABAP custom code migration for SAP HANA - recommendations and Code Inspector SAP Note
variants for SAP HANA migration 1912445
SAP and other SAP products and services mentioned herein as well as their respective logos are
trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other
countries. Please see http://www.sap.com/corporate-en/legal/copyright/index.epx#trademark for
additional trademark information and notices. Some software products marketed by SAP SE and its
distributors contain proprietary software components of other software vendors.
These materials are provided by SAP SE or an SAP affiliate company for informational purposes only,
without representation or warranty of any kind, and SAP SE or its affiliated companies shall not be
liable for errors or omissions with respect to the materials. The only warranties for SAP SE or SAP
affiliate company 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.
In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business
outlined in this document or any related presentation, or to develop or release any functionality
mentioned therein. This document, or any related presentation, and SAP SEs or its affiliated
companies strategy and possible future developments, products, and/or platform directions and
functionality are all subject to change and may be changed by SAP SE or its affiliated companies at any
time for any reason without notice. The information in this document is not a commitment, promise,
or legal obligation to deliver any material, code, or functionality. All forward-looking statements are
subject to various risks and uncertainties that could cause actual results to differ materially from
expectations. Readers are cautioned not to place undue reliance on these forward-looking statements,
which speak only as of their dates, and they should not be relied upon in making purchasing decisions.