Professional Documents
Culture Documents
March 2016
Table Of Contents
1. SAP Modernization Via Automation 3
2. Custom Code Health Check 8
3. Concluding Thoughts 35
Appendix
Manual Approach
0 10 20 30 40 50 60
Time in Weeks
Analysis Code Changes Integration Testing UA Testing
Your custom code has a rich and deep history like many of our
clients
Wear and tear on this system is natural and leads to business
process complications, fire drills, and under performance
Duplicative and unused custom code is expensive to maintain, but
provides no value to IT or business users
What if you could reduce your custom code footprint, have it behave
more like standard code, improve real business outcomes, and do it
all in an economic and predictable manner?
Version: 6.05
Unicode Enabled: No
UC/Release/RTE,
Coding Standard, 26,074 At least 40% of the identified issues
292,310
HANA, 32,634 are medium to high severity and are
affecting your code performance
(Upgrade + Performance) Issues / Total Issues % % of Objects with Issues / Total Objects
30.0% 80.0% Sempra,
25.0% Sempra, Peer Group, 70.0% 64.4% Peer Group,
19.9% 20.5%
60.0% 53.0%
20.0%
50.0%
15.0% 40.0%
10.0% 30.0%
20.0%
5.0%
10.0%
0.0% 0.0%
Upgrade + Performance + HANA % Objects with Issues
COPYRIGHT © 2016 SMARTSHIFT TECHNOLOGIES. ALL RIGHTS RESERVED 13
NX7 System Commonality
COMMONALITY ANALYSIS COMPARES CUSTOM OBJECTS TO OTHER CUSTOM OBJECTS
1,400
There are over 1,000+ custom
1,200 1,148 1,152 objects in the system that contain
1,000
986 94%+ similar lines of code to other
859
custom objects
800 688
0
100.0% 99%+ 98%+ 97%+ 96%+ 95%+ 94%+
# of Objects
450
399
417 There are over 400 custom objects in
400 367 the system that contain 80%+ similar
350
309 lines of code to SAP standard
300 objects in
250
UC/Release/RTE issues are areas where code can be optimized to ensure compliance
with current and future upgrades
Resolution: smartShift detected the use of either WS_UPLOAD and WS_DOWNLOAD statements, or older UPLOAD and DOWNLOAD
functions, none of which are Unicode-compliant. smartShift replaces these obsolete FM's to the appropriate Unicode-compliant functions. This
in turn leads to proper data usage and Unicode compliance.
The HANA platform is fundamentally different from traditional RDBMS systems and requires a
significant refactoring of embedded SQL, a time consuming and error prone process when
done manually.
HANA issues include what you must do and what you should do to take full advantage of the
HANA platform:
#600 SELECT on former cluster/pooled tables without ORDER BY
#712 SELECT * should be avoided, instead only required fields should be selected if applicable
#723 Avoid data transfer between database and internal table using loops. Use INTO TABLE and
FROM TABLE additions instead
#729 SELECT/ENDSELECT as existence check.
Pre-smartShift Post-smartShift
SELECT * SELECT b~lifnr b~bukrs INTO TABLE lt_lfb1 "$smart: 3/17/16 #712 #728
INTO CORRESPONDING FIELDS OF TABLE lt_lfa1
FROM lfa1
FROM lfa1 AS A INNER JOIN lfb1 "$smart: 3/17/16 #728
WHERE stcd2 = gt_vendor_create-stcd2 AS B ON b~lifnr = a~lifnr "$smart: 3/17/16 #110 #728
AND ktokk = gt_vendor_create-ktokk WHERE a~stcd2 = "$smart: 3/17/16 #110 #728
AND pstlz LIKE lc_zip
AND loevm = ' '. wr_vendor_c reate-stcd2 "$smart: 3/17/16 #110 #728
IF sy-subrc = 0. AND a~ktokk = "$smart: 3/17/16 #110 #728
SELECT * wr_vendor_create-ktokk "$smart: 3/17/16 #110 #728
INTO CORRESPONDING FIELDS OF TABLE lt_lfb1
FROM lfb1 AND a~pstlz LIKE lv_lc_zip "$smart: 3/17/16 #728 #909
FOR ALL ENTRIES IN lt_lfa1 AND a~loevm = ' ' AND b~loevm = ' ' "$smart: 3/17/16 #728
WHERE lifnr = lt_lfa1-lifnr AND b~bukrs IN s_bukrs. "$smart: 3/17/16 #728
AND loevm = ' '
AND bukrs IN s_bukrs.
IF sy-subrc = 0.
There are a broad array of performance issues that accumulate over time. The
cumulative effects are often significant.
Pre-smartShift Post-smartShift
Resolution:
smartShift detects and uses the field symbol instead of explicit work areas or header lines. When an internal table is read, there are overheads for copying the
table line to the work area. If field symbols are used instead, this overhead is mitigated. The result is a an improvement in performance, especially if large
or complex internal tables exist. This also allows ease of processing nested internal tables.
In this particular case, there should be an improvement in speed of the process for the AP Vendor Create or Change.
Maintainability issues result in hidden costs as modifications and bug-fixes can take
longer, which creates a continuous stream of “technical debt”
Pre-smartShift Post-smartShift
DESCRIBE TABLE gt_input LINES gi_total. *$smart (W) 3/17/16 - #164 DESCRIBE TABLE ... LINE is obsolete and is
IF gi_total = 0. *$smart (W) 3/17/16 - #164 replaced with LINES( .... ) (A)
MESSAGE e000
WITH 'Empty customer file'. gv_gi_total = LINES( it_input ). "$smart: 3/17/16 #164 #909
ENDIF. IF gv_gi_total = 0. "$smart: 3/17/16 #909
MESSAGE e000
WITH 'Empty customer file'.
ENDIF.
DESCRIBE TABLE ... LINE is obsolete and should be replaced with LINES( .... )
Obsolete syntax has a detrimental impact on performance.
Resolution:
smartShift detected the use of the DESCRIBE TABLE ... LINE statement, which is obsolete. smartShift replaces DESCRIBE TABLE ... LINES
with LINES (....)
Changes in references and obsolete table counts with improved syntax should improve performance. In this particular case, this
should accelerate the AP Vendor Create or Change Process.
Stability issues are latent problems that are likely to manifest themselves as technology
is progressively upgraded.
RANGES: RG_VARHI FOR CKRCO-VARHIEBG, *$smart (W) 3/17/16 - #112 Use of RANGES is obsolete in ABAP Objects (A)
TYPES RTYPE_RG_VARHI TYPE RANGE OF CKRCO-VARHIEBG. "$smart: 3/17/16 #112
RG_OBJNR FOR KKBC-OBJNR,
DATA RT_RG_VARHI TYPE RTYPE_RG_VARHI. "$smart: 3/17/16 #112
RG_KSTAR FOR KKBC-KSTAR. DATA WR_RG_VARHI TYPE LINE OF RTYPE_RG_VARHI. "$smart: 3/17/16 #112
*$smart (W) 3/17/16 - #112 Use of RANGES is obsolete in ABAP Objects (A)
TYPES RTYPE_RG_OBJNR TYPE RANGE OF KKBC-OBJNR. "$smart: 3/17/16 #112
DATA RT_RG_OBJNR TYPE RTYPE_RG_OBJNR. "$smart: 3/17/16 #112
DATA WR_RG_OBJNR TYPE LINE OF RTYPE_RG_OBJNR. "$smart: 3/17/16 #112
*$smart (W) 3/17/16 - #112 Use of RANGES is obsolete in ABAP Objects (A)
TYPES RTYPE_RG_KSTAR TYPE RANGE OF KKBC-KSTAR. "$smart: 3/17/16 #112
DATA RT_RG_KSTAR TYPE RTYPE_RG_KSTAR. "$smart: 3/17/16 #112
DATA WR_RG_KSTAR TYPE LINE OF RTYPE_RG_KSTAR. "$smart: 3/17/16 #112
Resolution:
smartShift detected the use of the RANGES statement and declared RANGES tables, which is obsolete. smartShift will replace RANGES with
code patterned on other internal table conversions. In future releases, this would result in a syntax error which has now been corrected –
preventative measures. In this particular case, this would allow the Hierarchy Read and Hierarchy Code Range Report to be in syntax
compliance for all future releases of SAP
Architecture issues are areas where code can be aligned with known SAP best structural
practices
Pre-smartShift Post-smartShift
DATA: DATA:
gt_vendor_create LIKE TABLE OF gs_vendor it_vendor_create LIKE TABLE OF "$smart: 3/17/16 #110 #909
WITH HEADER LINE. s_vendor "$smart: 3/17/16 #110 #909
DATA: . "$smart: 3/17/16 #110
gt_vendor_change LIKE TABLE OF gs_vendor DATA: wr_vendor_create LIKE s_vendor. "$smart: 3/17/16 #110
WITH HEADER LINE. DATA:
it_vendor_change LIKE TABLE OF "$smart: 3/17/16 #110 #909
s_vendor "$smart: 3/17/16 #110 #909
. "$smart: 3/17/16 #110
DATA: wr_vendor_change LIKE s_vendor. "$smart: 3/17/16 #110
Security issue are areas where customizations have introduced unnecessary risks into
your system as well as potential compliance concerns
Pre-smartShift Post-smartShift
Resolution: smartShift detected the ABAP variable SY-UNAME and SYST-UNAME where it is used inside a condition (outside of a condition is not
considered). smartShift provides information to the customer for review, and if needed, a resolution can be applied to reduce compliance and
security related issues. In this particular case report is restricted by user name, smartShift can identify such potential breaches of user
authorizations
There are over 24,9000+ Hardcoding occurrences identified across 7,500+ custom
objects
smartShift detected the use of hardcode occurrences that can be replaced with the SAP
standard recommended approach
Confidential
COPYRIGHT © 2015 SMARTSHIFT TECHNOLOGIES. ALL RIGHTS RESERVED 39
Case Study: Nestle
HANA Optimization & Scope
Landscape Simplification
• 11 SAP production systems
• Remove split architecture custom code
• 116,334 custom objects in scope
• Enable and optimize for SAP HANA
• Automated dual maintenance over
• Create custom code compliance rules 3 years due to 40,000 SAP transports annually
• Automated dual maintenance
Highlights
• 3 Phase approach for the SAP HANA migration over
Benefits one year
• Reduced project time by over 30% • Custom code compliance rules created in
• Exceeded committed automation targets cooperation with the customer & SAP
• Lowering total cost of ownership • Customer applied a part of the manual code
• Reduced testing effort adjustments
• Used Code Inspector for validation
Highlights
Benefits
• Project time: 2 weeks for each run
• Better predictability with analysis services
• Fast turn around with on time delivery, to assure tight
• Lowering total cost of ownership project schedule
• High quality reduced testing effort and number of test
• High quality delivery and preventive fixing of potential
cycles
runtime errors
• Early testing with sandbox approach reduces project
time • Analysis results helped in formulating the processes
as part of target testing
Benefits Highlights
• Reduced project time by months. • Project time: 3 weeks
• Higher staffing flexibility due to code • Code Optimization for maintainability, stability,
standardization performance and security
• Lowering total cost of ownership • Automatic remediation of SAP modifications
• Reduced testing effort • Enforcing of customer naming standards