Wednesday, 31 August 2016

Releasing Internal Table Memory

It is a well known fact, that you release the memory occupied by an internal table using either CLEAR or FREE, where FREE releases also the initial memory area. You normally use CLEAR, if you want to reuse the table and you use FREE, if you  really want to get rid of it and don't want to refill it later on. Assigning an initial internal table to a filled internal table does also release the target table's memory in the same way as CLEAR does.

But last week a colleague pointed out to me that it is not such a well known fact that deleting lines of internal tables with DELETE normally does not release the memory occupied by the deleted lines. Instead, there seem to be people deleting lines of internal tables in order to release memory. Therefore as a rule:

Monday, 29 August 2016

Mocking DAOs with ABAP Test Double Framework

Introduction


The sample below is very basic and no real business logic is included because it focuses on the concepts. For the dependency injection of the daos I used an interface for two reasons. First when more complicated or variants of Daos are needed the interface provides more flexibilty and the ABAP test double framework currently only can mock interfaces.

If you have suggestions, hints or question feel free to comment this document as I am keen on improve my concept, since it will not be the last time I have to write a Dao.

Thursday, 14 July 2016

Dynamic FM call with extra parameter

Use Case 


Consider the scenario in your development, you are reusing a standard FM in your program which is having 2 mandatory import parameters . And you shipped the solution to the customer. Now same FM in the customer system is having one more additional mandatory importing parameter. Now when your program runs and that calls the FM the dump appears in customer system. How to resolve this issue. This can be done by calling the FM dynamically with extra parameter that is not in your system but it is there in customer system. The below post tries to show the same.

The  FM ‘FPM_DEMO_FLIGHT_GET_CARRIER’ having below details as one import and one export parameter.

Wednesday, 6 January 2016

A room with an ABAP CDS view

In Björn Goerke's keynote speech from Barcelona Teched 2015, you may recall that he had crash landed on Mars, and was attempting to escape mars with the help of all of the latest SAP tech available. One of the technologies that we took away from teched, and that Björn used in his keynote was that of the CDS view.

But what if Björn had crashed on Mars and was without a Hana DB? what if he hadn't upgraded yet to full blown Hana, but he wanted to prep for such a future eventuality. That is a similar situation to what I find myself in with my current employer. We have crashed landed too, but we are even further out than Mars... and we have no Hana DB, but can we prep in advance for HANA? perhaps by using CDS Views on our current Oracle DB.

Thursday, 26 November 2015

Building an SAP Query with ABAP Code

ABAP code is used with SAP query tool to enhance the query output.

You can write down the code under the Extras tab for the Infoset in the SQ02 Tcode.

Building an SAP Query with ABAP Code

Tuesday, 10 November 2015

Best font for ABAP Editor?

Which font are you - ABAP developers using in code editor (either in SAP GUI SE38/SE80/SE24... or in Eclipse IDE)?
I have done little research in other programming languages and I found that one of the most preffered non-default one is called Consolas.
So I gave it a try and now I can say that it is great

It is one of the pre-installed fonts in MS Windows since Vista I think...

Here is comparison between default SAP GUI font:

Saturday, 26 September 2015

ABAP News for Release 7.40 - Table Expressions

Table expressions with the syntax

... itab[ ... ] ...

are a new way for accessing table lines in operand positions. You can view a table expression simply as a short form of a READ TABLE statement. The result of a table expression is a single table line. All you have to know is the syntax that does the same as a given READ TABLE statement.

If a table line is not found, the exception CX_SY_ITAB_LINE_NOT_FOUND is raised. No sy-subrc from expressions, of course.

Thursday, 24 September 2015

Creating code inspector Check Variant for client specific naming conventions

1. Creating Check Variant


1.a) Run transaction SCI
 Enter  Check  Variant name and press Create button.

Creating code inspector Check Variant for client specific naming conventions