Tuesday 27 April 2021

Getting acquainted with automating ABAP unit testing – Part 8

Part 7 – Write a second unit test

To recap from the preceding blog, we had added a new unit test method to call subroutine get_flights_via_carrier three times, each time using a different carrier value, and found that this unit test method issued two failures, suggesting that one of the carrier values did not cause a test failure. Here is the source code as we left it in the previous blog:

Monday 26 April 2021

Getting acquainted with automating ABAP unit testing – Part 7

Part 6 – Using the correct method call syntax to request a unit test assertion

To recap from the preceding blog, we had changed the call to method assert_not_initial of class cl_abap_unit_assert so that it uses the standalone static method call syntax instead of the former dynamic method call syntax. We also know there is a bug in the production code: the ALV report presents rows for the wrong airline. Here is the source code as we left it in the previous blog:

Monday 19 April 2021

Getting acquainted with automating ABAP unit testing – Part 6

Part 5 – Fix the production code bug identified by the first unit test

To recap from the preceding blog, we corrected the bug exposed by a failing unit test. Now the unit test passes and the program, when executed, produces an ALV classic list report instead of issuing an error message, though the rows appearing in the report do not necessarily match the value specified on the initial selection screen. Here is the source code as we left it in the previous blog:

Sunday 18 April 2021

How to use a RFC Function module using RESTful ABAP Programming

I got a requirement to use RFC function module to get the data third party system. Using ABAP programming it is a cake walk for any ABAP developer. But, my client asked to use Eclipse and CDS to achieve this functionality. As many of us are new to Eclipse and CDS views. After doing R&D and found one reference to achieve my requirement. I hope this blog helps to all those who are going to start using Eclipse ADT for their developments.

1. Create a CDS view using templet “Custom entity with parameters”.

2. Create custom entity as per your required output and make sure to give the Class name “ABAP:ZCL_RFC_DETERMINE_JURISDICTION” where you are going to call your function module.

Friday 16 April 2021

Getting acquainted with automating ABAP unit testing – Part 5

Part 4 – Complete the process of writing the first unit test

To recap from the preceding blog, we added an assertion to our unit test method, and when we executed the unit test it promptly detected a failure after calling production-code subroutine set_alv_field_catalog. Here is the source code as we left it in the previous blog:

Thursday 15 April 2021

How To Switch Between ABAP Editor’s Insert (INS) And Overwrite (OVR) Modes.

Personally, I am not a fan of the overwrite mode in text editors and believe it is a relic from the past that has found its way into modern editors. In command line text editors (big time vim fan here), OVR mode can be very useful and efficient but It is hard for me to fathom the use of OVR mode in modern text editors. I believe most of my readers will also share the same sentiment.

There are very easy methods of switching between the two modes (INS and OVR) to match your preference but some users will face an uphill battle in changing between these modes due to hardware and software constraints. In this tutorial I will walk you through a method that will reliably afford you the ability to make this switch in a no frills style.

Wednesday 14 April 2021

RSA Encryption in ABAP

Recently I stumbled across a lot of unanswered questions about RSA encryption. Here I will try to provides some examples how to use public/private key encryption in ABAP. All the overhead like certificates, trust, revocation and key generation will not be touched here. The keys will be generated with openssl.

Example 1 – Using own RSA implementation  in ABAP.

RSA encryption is quite simple. All you need is integer arithmetic – mainly modular exponentiation. The only problem is, the integers involved are longer than ABAP and most other languages can handle by default. 

Monday 12 April 2021

Getting acquainted with automating ABAP unit testing – Part 4

Part 3 – Continue the process of writing the first unit test

To recap from the preceding blog, we applied the “for testing” clause to the one and only unit test method defined for the local class named tester, resulting in that empty method being invoked by the test runner of the ABAP Unit Testing Framework. Here is the source code as we left it in the previous blog:

Sunday 11 April 2021

Getting acquainted with automating ABAP unit testing – Part 3

To recap from the preceding blog, we changed our example program to include a virtually empty unit test class. Here is the source code as we left it in the previous blog:

Part 2 – Begin the process of writing the first unit test

program.

*----------------------------------------------------------------------

* Define Selection Texts as follows:

*   Name     Text

*   -------- -------------------------------

*   CARRIER  Airline

Friday 9 April 2021

How to Conduct Automatic Quality Check of ABAP Code in SAP S/4HANA and SAP ECC?

Introduction

SAP ABAP Quality Check for Coding. Every Company does It but still there are numerous Issues that Is not filtered and causes chaos In SAP Production System. There are some basic steps that a Technical Consultant needs to follow but since we are all Humans, we can make mistakes. On an average every Company spends at least 5-10 hours in resolving Quality Issues that should have been caught in the normal quality check process. SAP Is smart enough to do Its own quality check with the help of customized specification from different customers based on their requirements and guidelines.

Now with the current trend of reduce workforce the QA Code Team Is non-existant. ABAP Code Quality check still Is very Important to make sure erroneous code Is never moved to the Production Environment.

Wednesday 7 April 2021

Getting acquainted with automating ABAP unit testing – Part 2

Part 1 – Initiating the execution of automated ABAP unit tests

To recap from the preceding blog, we created a program having no object-oriented statements, then initiated the execution of its non-existent automated unit tests, either through ABAP Editor menu path Program > Execute > Unit Tests or by pressing keyboard combination Ctrl+Shift+F10, and received the warning message indicating there are no automated unit tests for it. Here is the source code as we left it in the previous blog:

Tuesday 6 April 2021

Getting acquainted with automating ABAP unit testing – Part 1

Are you still manually unit testing your ABAP programs? Are you bothered by the exorbitant amount of time and effort required to complete those tests? Do you dread the drudgery associated with manually preparing those tests for execution? Is the pain and agony you endure while executing those tests about the same as it was the last time you underwent this tedious process? Does this whole experience leave you exhausted once you have succeeded in running all those manual unit tests?

If you answered “Yes” to any of those questions, then perhaps you are willing to consider an alternative, one that can simplify the process, significantly reduce the time it takes to complete it and eliminate virtually all of the associated misery: automating the unit testing of ABAP programs.

It is my guess that there is a large segment of ABAP programmers who remain unaware that automated unit testing is possible with ABAP. Even among those who are aware of it but still do not use it, many of them are under the mistaken impression that it is capable only of testing ABAP code written using the object-oriented programming model. This series of blogs is intended to acquaint you with the process of creating automated unit tests for ABAP programs, particularly for those programs containing not a shred of object-oriented code.

Monday 5 April 2021

SAP Multichannel Foundation for Utilities and Public Sector(MCF) enhancement using BAdI Implementation

The purpose of this article is to explain the developers how standard MCF service(ERP_ISU_UMC) can be utilized to incorporate the custom requirements.

SAP NetWeaver Gateway Service model extensibility can be achieved on different levels :

1. OData entity structure extension(Using append structure to add custom fields)

2. OData entity logic extension(for example , adding additional validations)

3. Addition of new OData entities