This blog is targeted to ABAP technical team working on S4 HANA conversion OR Suit on HANA migration projects.
As we know in Suit on HANA migration and S/4 HANA conversion projects conventional database is replaced by HANA database. Custom code which was running on non-HANA database earlier will not work as it is since HANA database doesn’t sort the data implicitly, it needs to be sorted explicitly.
Hence it is necessary that customer adapts the custom code with respect to HANA database after migration/conversion.
Let’s us consider that customer has completed the migration and conversion. Activities like Unicode conversion, SUM execution, SPAU/SPDD activities are completed. And next activity is custom code adoption/Remediation.
I will try to cover following questions in this blog post based on my experience working on S/4 HANA conversion and Suit on HANA migration projects.
- What are the pre-checks be performed before starting the code adoption?
- How to analyze the impact on custom code impact while migrating to HANA database?
- Which ATC issues need to be fixed to adapt the custom code with respect to HANA database?
- What is the solution of the ATC issues?
Pre-checks to be performed before starting the custom code impact analysis.
In Transaction SCI, check if check variant FUNCTIONAL_DB and FUNCTIONAL_DB_ADDITION are available. If not available, check and implement following SAP notes.
Note: FUNCTIONAL_DB_ADDITION check covers additional performance related checks. Execute this check variant to identify and fix the cases where “Unsecure use Of for All Entries is used.”
If customer NetWeaver system is >7.4 and <= 7.5
If customer NetWeaver system is > 7.5
Open Transaction SCI and check if check variant S4_HANA_READINESS_<release version> is available. If not available, check and implement following SAP notes.
Screenshot 3: S4HANA_READINESS
In Screenshot1 and Screenshot 3, Security Check ad Robust programming checks cover the SAP recommended checks to be performed on the custom code.
Note: This blog is not intended to cover the “S4 HANA Custom Code Checks”.
Activities to be performed before codeAdoption/Remediation.
Execute the check variant FUNCTIONAL_DB and FUNCTIONAL_DB_ADDITION on entire custom code using ATC or SCI transaction. You can also include custom namespaces in case those are also required to be remediated.
In case of S/4 HANA conversion, execute S4_HANA_READINESS_<release> check variant. This check variant covers the checks of FUNCTIONAL_DB. Hence it is not required to execute FUNCTIONAL_DB check again.
Execute ATC Transaction
Execute the ATC check on Z* and Y* packages and also on modified objects.
Check Title and Check Message show the various the ATC issues captured.
Now let’s see what the different issues captured in FUNCTIONAL_DB check and how those can be fixed.
- Syntax Error
For Example: Syntax error in in SAPLXEDF.
This check shows the objects in the Syntax error. Unless these syntax errors are fixed, these objects cannot be analyzed as well. Hence fix all such objects in syntax errors and again execute the ATC checks on such objects.
2. Missing Objects
For Example: Used object Screen 9000 does not exist.
This check shows the missing objects like includes screens etc. Unless these errors are fixed, these objects cannot be analyzed as well. Hence fix all such objects have missing objects and again execute the ATC checks on such objects.
3. Use of Database Hint: %_HINTS
Below is the OPEN SQL statement written with underline database as non-HANA database.
After migration to HANA database, HINTS written in the custom code need to be analyzed and decision need to be taken if those can be retained.
In case of conversion to S/4 HANA, SAP provided HINTs may not be available on new S/4 HANA release. Hence such HINT statements need to be either replaced with new HINT or removed.
4. Use of Native SQL
As per SAP’s recommendations Embedded Native SQL statements betweenEXEC SQLandENDEXEC should no longer be used in the ABAP development though they are supported by SAP. Instead ADBC interface or OPEN SQL to be used to fulfill the requirement.
But even though these SQL statements are not replaced with ADBC or OPEN SQL, functionality is not going to impact.
Refer the SAP Help Native SQL
Hence such issues can either be suppressed using pragma or need to be corrected.
5. Use of ADBC Interface
As motioned in point No 3. ADBC classes can still be used in the development. Hence these classes can be replaced with OPEN SQL or can be continued to be used as it is.
In below example Method EXECUTE of ADBC class CL_SQL_STATTEMENT is used to execute the native SQL.
*&---------------------------------------------------------------------**& Report Z_ADBC*&---------------------------------------------------------------------**&*&---------------------------------------------------------------------*REPORT z_adbc.CLASS demo DEFINITION. PUBLIC SECTION. CLASS-METHODS main. PRIVATE SECTION. CLASS-DATA: BEGIN OF result_line, carrid TYPE sflight-carrid, connid TYPE sflight-connid, fldate TYPE sflight-fldate, END OF result_line, result_tab LIKE TABLE OF result_line.ENDCLASS.CLASS demo IMPLEMENTATION. METHOD main. DATA carrid TYPE sflight-carrid. DATA cols TYPE adbc_column_tab. cols = VALUE #( ( CONV adbc_name( 'CARRID' ) ) ( CONV adbc_name( 'CONNID' ) ) ( CONV adbc_name( 'FLDATE' ) ) ). cl_demo_input=>request( CHANGING field = carrid ). TRY. DATA(result) = NEW cl_sql_statement( )->execute_query( `SELECT carrid, connid, fldate ` && `FROM sflight ` && `WHERE mandt = ` && `'` && sy-mandt && `' AND` && ` carrid = ` && cl_abap_dyn_prg=>quote( to_upper( carrid ) ) ). result->set_param_table( itab_ref = REF #( result_tab ) corresponding_fields = cols ). IF result->next_package( ) > 0. SORT result_tab BY carrid connid fldate. cl_demo_output=>display( result_tab ). ENDIF. CATCH cx_sql_exception INTO DATA(err). cl_demo_output=>display( err->get_text( ) ). ENDTRY. ENDMETHOD.ENDCLASS.START-OF-SELECTION. demo=>main( ).
Hence such issues can either be suppressed using pragma or need to be corrected.
6. SELECT SINGLE is possibly not unique
Here is a code which is running on non-HANA database and using SELECT SINGLE statement.
This code is supposed to SELECT the Document no 0000000005.
The output of the program is 0000000005.
Now let’s execute similar SEELCT SINGLE statement on HANA database.
Expected Output is 00000018.
However Actual output is 00000021.
As we discussed in the beginning of this blog, explicit Sorting of data is required on HANA database.
Since Explicit sorting is missing in code written on HANA database incorrect result was obtained.
How to correct this issue? Code needs to be adjusted as below.
After making these changes output is
The explicit SORTING by Primary key is required when ALL Key Fields are not passed to SELECT statement written on Transparent table and Views. If the output of such incorrect select statements are used for further processing like validation, calculation etc. the functionality will be impacted.
This might work in cases where SELECTs are written to validate the existence of at least one record in the table. But it is recommended to adjust all such issues before handing over code for functional testing.
Similarly, for all below ATC errors do the explicit sorting after SELECT statement, before READ statement, before DELETE adjacent, before LOOP..ENDLOOP.
7. READ .. BINARY SEARCH for result of statement
8. DELETE … FROM/TO for result of statement
9. DELETE … INDEX for result of SELECT statement.
10. LOOP AT itab. AT … ENDAT
11. LOOP AT itab. AT FIRST/LAST… ENDAT
12. LOOP AT itab. EXIT/RETURN/LEAVE
13. LOOP AT itab FROM/TO for result of statement
14. READ TABLE … INDEX for result of SELECT statement
15. READ TABLE … INDEX 1 for result of statement
16. READ TABLE … INDEX C_CONST for result of statement
17. SELECT … FOR (former) cluster table
18.SELECT … FOR (former) pool table
19. DELETE ADJACENT DUPLICATES for result of statement
- Custom code adaptation must be done with respect to HANA database in Suit on HANA Migration and S/4 HANA conversion projects.
- Use FUNCTIONAL_DB and FUNCTIONAL_DB_ADDITION check variant in ATC to perform custom code analysis.
- FUNCTIONAL_DB_ADDITION is not mandatory though since it covers performance related checks.
- Explicit sorting of the data must be done for various statements we discussed in the blog.
In next blog I will try to cover some unique scenarios of custom code adaptation.
The SQL Monitor is the recommended tool for optimizing SQLs in custom code during the migration to SAP HANA.What can the custom code check in SAP S 4HANA be used for? ›
Custom Code Check in S/4HANA:
The Custom Code Analysis tool for SAP S/4HANA, analyses custom code and evaluates it in comparison to a list of best practices. Customers can then utilize the report it produces to remedy any problems with their code.
ABAP and SAP HANA - ABAP Keyword Documentation. SAP HANA is a platform, independent from AS ABAP, used for high-performance analysis of large volumes of data. SAP HANA works with the SAP HANA database, which is based on in-memory technology.What is the difference between SAP ABAP and SAP ABAP on HANA? ›
One basic difference which might help you choose your field is that HANA is in-memory database and ABAP is primarily coding. Monetary gain is not the basis you should choose your field as both offer you nearly same packages. But there is one more term SAP ABAP on HANA which means you can use HANA on the ABAP platform.What are the three tools that might be used in a migration to SAP HANA? ›
- Code Performance Analyzer.
- ABAP Code Fixing Tool.
- Project Management and Sprint Planning.
What are the three best approach for Transitioning and optimizing ABAP applications to SAP HANA? There are 3 correct answers to this question. Detect Optimize Innovate Scaling Tuning. You perform a static code check using the Code Inspector (SCI).What is custom code adaptation? ›
Custom Code Adaption
After the system conversion, we perform functional adaptations in custom code. We need to adapt any modifications related to ABAP dictionary objects using Transaction SPDD. After system conversion (SUM), we adapt modifications related to repository objects using transaction SAPU and SPAU_ENH.
The ABAP Test Cockpit (ATC) is a tool for doing static and dynamic quality checking of ABAP code and associated repository objects. The checks are only executed for the selected master programm. To start the ATC check, choose Program → Check → ABAP Test Cockpit (ATC).What does custom code mean in SAP? ›
Custom code management is the central point of access for all functions that you use to monitor and manage the lifecycle of custom developments from creation to deletion. You can continually optimize your developments and configure how they are implemented or affected by changes to SAP objects.What are best practices when programming in ABAP for SAP HANA? ›
- Use snake_case. Name your variables, methods, classes, etc. ...
- Use consistent spelling. ...
- Avoid obsolete statements. ...
- Do not use magic numbers. ...
- Avoid deep nesting. ...
- Use automated code checks. ...
- Delete dead code. ...
- Do not ignore errors.
It's easy to be confused about SAP HANA vs S4 HANA–the two sound very similar. To put it simply, SAP HANA is the in-memory database technology that runs the SAP landscape. S4 HANA is the business suite launched as the next-generation ERP designed to run exclusively on the HANA database.Does SAP S 4 Hana use ABAP? ›
ABAP Platform 2022 is the technology platform underlying SAP S/4HANA 2022 and is shipped as part of SAP S/4HANA 2022.What is the difference between ABAP script and SAP HANA expert script? ›
During processing of ABAP based BW Transformation, the source data package is processed row by row. But in HANA based BW transformation, the data can be transferred directly from source object to target object within a single processing step. This eliminates the data transfer between DB layer and Application layer.Does SAP ABAP HANA require coding? ›
In simple words, SAP ABAP does require Coding knowledge for creating SAP applications. However, SAP ABAP basics don't require Coding expertise at a basic level. If you are striving to become an ABAP developer, you would most likely learn how SAP platform works, when it comes to using the ABAP programming.Is SAP ABAP outdated? ›
ABAP can't die because its the easiest development tool . It can be easily seen that if you see development cost ABAP development can be completed in less time as compared to Java. And SAP is not stopping ABAP but just given an option to develop in java. However it will be good for ABAP Developers to learn java.Which SAP tools can you use to help analyze custom code in your system to prepare for a system conversion to SAP S 4HANA? ›
The tool of choice for SAP S/4HANA and SAP HANA checks is the ABAP Test Cockpit (ATC) with remote code analysis. You set up only one central ATC check system for all static checks of your custom ABAP code in your system landscape, which needs to be migrated to SAP S/4HANA.Which preparation steps must be performed for an SAP HANA migration? ›
- Align your SAP ERP migration plan with your business goals. ...
- Prepare your system requirements and needs. ...
- Create an SAP ERP change team. ...
- Confirm all your integrations and add-ons will work in your new SAP instance. ...
- Custom code migration and installation.
The SAP S/4HANA migration cockpit is SAP's standard solution to migrate business data from legacy data sources to SAP S/4HANA or SAP S/4HANA Cloud. This migration tool comes with guided procedures, predefined content, and a modelling environment: the migration object modeler.Which tool do you use to upgrade and SAP HANA system? ›
This is a simple operation using the HDBLCM database lifecycle management tool.