abap code remediation using atc and transport blocking for hana
DESCRIPTION
SAP Abap on Hana Code remediationTRANSCRIPT
Intel Information Technology Intel Confidential – for internal use
only
Agenda
• ABAP Code Remediation ABAP Test Cockpit
ATC Demo Code Remediation Examples
ABAP Test Cockpit result for ECC FB0 custom code Transport blocking
Intel Information Technology Intel Confidential – for internal use
only
ABAP Code Remediation
ABAP code remediation is to prepare custom code work flawlessly with SAP HANA.ABAP Code remediation is required because• DB Migration
Need to take care of DB specific code (Native SQLs, DB Hints) • SAP HANA Architecture
Column based architecture . Code to Data Paradigm
• De-pooling / De-clustering During HANA migration most of the pool and (A001, A010) cluster tables
(KONV, CDPOS, BSEG) will be transformed to transparent table
Intel Information Technology Intel Confidential – for internal use
only
ATC – ABAP Test CockpitATC – ABAP Test Cockpit is new global Code Inspector. This static code checker can be used to prepare Custom ABAP code for HANA. The ABAP Test Cockpit is directly integrated into the ABAP workbench as well as in the ABAP Development Tools for Eclipse. SAP recommends below 3 Variants
(preconfigured checks), using ATC, for custom code migration to HANA and performance tuning. FUNCTIONAL_DB
This check variant contains checks that are regarded as mandatory for the analysis of ABAP custom code as part of an SAP HANA migration. FUNCTIONAL_DB_ADDITION
This check variant contains additional checks that are not directly linked with the SAP HANA migration, but locate potential functional errors and SQL statements with poor performance. Thus the checks in this check variant are not mandatory for the SAP HANA migration, but they are recommended by SAP. PERFORMANCE_DB
This contains all the main static SQL performance checks.
Custom variant Y_HANA_DB_AND_ADDITION crated in FI0 combining the FUNCTION_DB and FUNTIONAL_DB_ADDITION variant content.
Intel Information Technology Intel Confidential – for internal use
only
SQL Monitor• It is performance analysis tool / utility can be used – not only but especially – for the purpose of optimizing
custom code for SAP HANA.• Traces each and every SQL statement coming from an ABAP program - this includes OPEN SQL, native SQL
and SQL statements coming from the ABAP kernel• SQL Monitor can run in a productive system without disturbing business processes and can be run before
HANA migration SAP recommend measurement period of 1-2 weeks Allows downloading SQL Monitor data in order to import it in a development system where the code corrections are
done.
It captures data like What are the most expensive and most frequently executed SQLs? Which SQL
reads/writes maximum of records, has the highest execution time, often executed SQL statements in custom code Which of the business processes run a huge number of SQL statements or work with a lot of data?
Derives the entry point of each process driving the traced SQL statement. The entry point can be a transaction, report, RFC module or URL
Intel Information Technology Intel Confidential – for internal use
only
SQL Performance Tuning Worklist
The SQL Performance Tuning Worklist tool enables to find ABAP SQL code that has potential for performance improvement in productive business processes. This tool combines new ABAP code scans (ABAP Test Cockpit or Code Inspector ) with monitoring and analysis utilities (SQL Monitor and Coverage Analyzer), and automatically creates a condensed worklist. The resulting findings allow to rank and filter the worklist according to specific performance issues
Intel Information Technology Intel Confidential – for internal use
only
ATC Check ResultFunctional check:
• Priorities 1 and 2 indicate serious problems that usually need to be fixed as quickly as possible, since they may affect the correct functioning of a program.
• Lower priorities indicate less severe quality problems.
Functional Checks Description Priority 1
Priority 2
Priority 3
Search problematic statement for result of SELECT/OPEN CURSOR without ORDER BY
Binary search, Delete after filling internal table without sort order, or loop to search an internal table without sort by.
167 32 676
Test Existence of a Program Program does not exist in system but entry in available in TADIR table
5
Scan a Program Include Programs are missing 10 Critical Statement Certain statements that are critical for security or that
threaten program stability are used. 38
Table Attributes Check Examines the technical settings (transport attributes, buffering) and the secondary index of database tables
21 1 215
Unsecure use of FOR ALL ENTRIES
The driver table (internal table) is not checked for zero records. When that happens, program will read the complete DB table
113 547
Analysis of WHERE condition in UPDATE and DELETE
Where clause check for UPDATE AND DELETE statement 3 2
Analysis of WHERE condition for SELECT
Examines the WHERE condition of the SELECT statement for not using Where clause, Index fields, etc.
37 57
243 243 1438
Intel Information Technology Intel Confidential – for internal use
only
Add Order by for Select statement from Transparent tableSQL DB interface adds sorting by primary key to dataset selected . After migrating to HANA DB, developers need to add explicit Order by / sort command based on processing needs.
Start adding Order by to select statements from transparent tables wherever possible now before HANA migration!.
Intel Information Technology Intel Confidential – for internal use
only
Add Sort Order for Pool/Cluster Tables Converted
SQL DB interface adds sorting by primary key to pool/cluster table processing. During HANA migration pool/cluster tables are converted to transparent tables. After migrating to HANA DB, developers need to add explicit sort command based on processing needs.
Can only be fixed after HANA migration.
Intel Information Technology Intel Confidential – for internal use
only
Add Sort Order to Internal Table ProcessingSQL DB interface adds sorting by primary key to internal table. After migrating to HANA DB, this sorting is not automatically done by system, developers need to add explicit sort command based on processing needs. e.g. Binary search internal table, delete adjacent duplicates. Sort must be added for binary search to work.
Start coding with explicit sort order now before HANA migration!
Intel Information Technology Intel Confidential – for internal use
only
Check Driver Table Before execute “For all Entries”Check the driver table to make sure it’s not empty before a “FOR ALL ENTRIES” statement is executed. If the driver table is empty, all the data records are read from the database. Large volume of returned data may cause a short dump.
Start checking driver table now before HANA migration!.
Intel Information Technology Intel Confidential – for internal use
only
Critical statements
DB hits are used to improve the performance. DB hints are Database specific and need to remove as it will not be required with HANA DB. This change will happen with HANA DB migration.
Can only be fixed after HANA migration.
15Intel Information Technology Intel Confidential – for internal use
only
Inflight Projects & Unplanned Maintenance FixesNew process being put in place for migration through PtP (Path to Prod)• During the Remediation of code for HANA on ECC
• We have seen code for inflight projects as well as prod fixes land into PROD without checking for HANA compliance
• This forces us to ensure we have a plan in place to limit HANA code issues going forward
• This will have implications on how you release code into PtP• The aim is to make it as painless as possible while protecting the
environment
16Intel Information Technology Intel Confidential – for internal use
only
Transport Release Block Process
We will be using the Y_HANA_DB_ADDITION Code Inspector Variant to the default variant in the ABAP Test Cockpit (ATC)• This variant might change in the future to incorporate Security
checksFor all new code, ADs must check against both the Y_HANA_DB_ADDITION as well as the YINTEL_GLOBAL_QAC_L1 to ensure issues are resolved.If you are fixing existing code, you must check against the Y_HANA_DB_ADDTION and resolve issues that might arise.• Due to the possibility of old code written before the QAC process &
Naming standard changes, it is not expected for you to fix these
17Intel Information Technology Intel Confidential – for internal use
only
Transport Release BlockUpon Transport release, any priority 1 & 2 errors will result in a Pop-UpYou can choose to display the errors, it will give you a list of errors to look at• Double-Clicking the ATC Checks, will give
you a list of issues• Correct priority 1 & 2 issues and the
system should allow you to release the transport
• If the issue is a false positive, you can use pseudo comments to prevent the error
• Specific Line End comment to hide error
21Intel Information Technology Intel Confidential – for internal use
only
Sprint 1 Timelines
Time lines Sprint 1 ww10 – ww24
Remediate code in DEV, Unit Test Pre-Test in CONS – can run parallel to remediation Each remediated object will move to CONS as soon as it’s remediated, unit-tested AND Pre-Test in CONS is done To ensure a consistent completion of above deliverables, use status that we have in the remediation
spreadsheet. These statuses are captured in object remediation workflow i.e. object Development status = “Ready for Test” and Test Status = “QC test case & pre-test completed”.
Post-Test done in CONS once code migrated WW24/WW25 ALL Post migration CONS Testing must be done
ww27 – ww28 CONS Post-Test on HANA DB to ensure remediated code works on HANA DB ** SAs will be quite busy here with regressing testing as well for MR, so need to ensure Post-Test happens fairly
quickly ww29.3
ww29.2 Go/No Go Prod Migration
22Intel Information Technology Intel Confidential – for internal use
only
Sprint 2 (HANA Related Code, Must Go with HANA DB)Time lines Sprint 2 (Current PROD Target is ww32.6) WW22.3-WW22.5
SPDD/SPAU Done ww23 – ww26
Pre-Test in CONS HANA Dependent Code Remediated and tested
ww27 – ww28 (CONS will be upgraded to HANA by this time) Migrate Code to CONS Post-Test in CONS on HANA DB Defect resolution
WW32.6 PROD Go Live with MR & HANA
Intel Information Technology Intel Confidential – for internal use
only
ATC Check Result- Functional check Details
Search problematic statement for result of SELECT/OPEN CURSOR without ORDER BY :
Test Existence of a Program
Back
Intel Information Technology Intel Confidential – for internal use
only
ATC Check Result- Functional check Details
Scan a Program
Critical Statement
Back
Intel Information Technology Intel Confidential – for internal use
only
ATC Check Result- Functional check Details
Table Attributes Check
Unsecure use of FOR ALL ENTRIES
Back