Skip to content
Mar 18 17

Don’t Try Coding ABAP Core Data Services Without Reading This First

by admin
Recommend This Post! Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Pin on Pinterest

ABAP

Jonathan Andre is a lead ABAP developer at IT Partners. Jon is also the President of Andre Technical Consulting LLC located out of Centreville, Virginia. Jon has over 5 years experience with SAP, with a concentration on ECC SD, MM, and IS-OIL modules. Jon’s focus has been in the areas of ABAP OOP and ABAP Web Dynpro. He can be reached at jon.andre@itpsap.com

As we described in the prior blog The ABAP Developer Road Map to SAP HANA, with the advent of SAP HANA, there has been a paradigm shift in the way business applications are developed. The rule-of-thumb is simple: Do as much as you can in the database to get the best performance. This was coined as “Code Pushdown” by SAP. Well, this is also true for the underlying data models of the business applications.

Data modeling in ABAP typically involves organizing your data in database tables/views and often providing some additional high-level services for the applications using the appropriate ABAP frameworks. It is logical to conclude, from the Paradigm-shift of Code Pushdown, that to enable real-time businesses in HANA, we need some of these services ideally also brought closer to the database as well.

For SAP this presented several challenges. High-quality data models should provide a single definition and format for the data. They should be clear and unambiguous, reusable and flexible, even extensible. So how can you capture the semantics of the data model in the database so that the model can be easily reused by different consumers, e.g. by OData clients and by OLAP tools? How can you extend the meta-model to service your applications? What is the solution…?

Introduction to Cored Data Services (CDS)

Core Data Services, or CDS, is a “semantically rich” Data Definition Language (or DDL) created by SAP. It provides an easy to understand and reusable tool that ABAP developers can utilize to execute the “code pushdown” paradigm. CDS has evolved into different variants, but the ABAP developer should chiefly be concerned with two specific ones…The lesser used option is HANA CDS, the database language that can be used to create tables, views, and structures on the HANA database itself. Views created in HANA can be consumed from the Netweaver AS using Native SQL. The second and most important variant of CDS that should concern ABAPers is the ABAP CDS. While significant differences have evolved between the two variants — for example, SAP HANA-based CDS obviously operates on SAP HANA, while ABAP-based CDS operates on most major database platforms as well as SAP HANA, and each has a different type of repository for development objects — both variants pursue the same goal: to represent central data definitions as a common basis for application development of all kinds.

Let’s look at each variant:

HANA CDS: the database language that can be used to create tables, views, and structures on the HANA database itself. Views created in HANA can be consumed from the Netweaver AS using Native SQL.

ABAP CDS: made available with SAP Netweaver 7.40 SP5, is a valuable tool to have when programming for HANA. However, ABAP CDS can be used even if the underlying database is not a HANA database, as it is an open DDL that is supported by many traditional databases as well. ABAP CDS is usually the best choice when designing and creating database views that will need to access the HANA database, and this will be the prime focus of this blog.

ABAP CDS uses an SQL-like syntax, enhanced with some useful additional features. Like any typical  ABAP object, ABAP CDS files are also transportable between Netweaver AS systems, which is an advantage ABAP CDS has over its HANA CDS counterpart. Once transported, an ABAP CDS View will create and deploy the corresponding database view on the target database automatically (requiring no additional steps for the developer or transport manager).

Unlike classical SE11 views, ABAP CDS views can only be created in Eclipse (by utilizing the ABAP Development Tools for SAP Netweaver add-on for Eclipse). The tools can be found at https://tools.hana.ondemand.com/.

Next, we will go through a brief step-by-step guide on how to create a CDS view, as well as features of the DDL source file.

read more…

Recommend This Post! Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Pin on Pinterest
Feb 23 17

The ABAP Developer Road Map to SAP HANA

by admin
Recommend This Post! Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Pin on Pinterest

ABAP

Jonathan Andre is a lead ABAP developer at IT Partners. Jon is also the President of Andre Technical Consulting LLC located out of Centreville, Virginia. Jon has over 5 years experience with SAP, with a concentration on ECC SD, MM, and IS-OIL modules. Jon’s focus has been in the areas of ABAP OOP and ABAP Web Dynpro. He can be reached at jon.andre@itpsap.com

Chances are that if you work with SAP ABAP, you have heard of SAP HANA by now. You’ve probably heard that it’s “the future” and a “game changer.” You’ve also probably heard that it’s much faster, and it can take tasks that require hours and finish them in minutes. This all sounds wonderful, but technical folks understand that nothing works by magic. What we would like to know is not the what, but the how. What exactly is SAP HANA? How is it able to bring such dramatic improvements to our programs? And finally, how will switching over to SAP HANA impact me as an ABAP developer?

SAP HANA Overview on a Technical Level

SAP HANA is a platform that serves to replace the classical hard disk based data storage system with an in-memory alternative. The SAP HANA Acronym stands for (High-performance ANalytic Appliance). While HANA serves as a replacement for classical hard disk based storage systems, it should be understood that it is more than just a replacement. While HANA can perform any and all features of a traditional DBMS, it also provides many benefits that a classical database server does not. Let’s begin our over overview of SAP HANA by contrasting it to the traditional DBMS.

As a refresher, lets recall how a classical database works. A DMBS manages an array of HDDs that store data in a row based format. Using INSERTS, READS, UPDATES and QUERIES, the database allows users to persist, retrieve, and manage data on demand. The principle drawback of a classical database is the fact that it uses HDDs. Reading, writing, and searching using HDD are an inherent bottleneck to any classical database. Hard disk drives are mechanical devices, requiring a rotating magnetized platter that stores binary data, and a read/write head that accesses and reads that data. (see below)

HDD Drive

Although many advances have been made over the years to improve HDD technology speed and storage capability, the HDD can never match the speed of computer memory. Enter SAP HANA and its in-memory data storage.  By storing the vast majority of data in memory, HANA sidesteps the costly action of reading data from HDDs to provide data to users. Since retrieving data from computer memory is 100,000 times faster than retrieving data from HDDs on average, the speed increases are exponential and instantaneous. Simply changing the architecture from HDD based tomemory based storage is enough to provide drastic speed increases on its own, but SAP HANA takes it a step further by providing features on top of this in-memory platform. This allows for even greater speed of access, data retrieval, and data processing.

SAP HANA Architecture

SAP HANA and Column Stores

A major difference between SAP HANA and traditional databases is that HANA uses column-store for most database tables, while classical DBs use row-store. The row-store approach works well when you often need to retrieve an entire record from the database at the time, but as ABAP developers know, it is much more common to retrieve a subset of fields during processing. In addition, row-storage often provides only two options when searching a non-primary field. You can either create secondary indexes to speed up data retrieval, or risk performing full table scans when retrieving data outside of the primary index.

Below is an example of how data would be stored in traditional DBMS as rows…

Row Based

This data would be stored in a traditional database as follows:
001:Tom,35,0123;
002:Tom,47,0234;
003:Matt,153,0234;
004:Susan,278,1203;
005:Susan,301,0123;

 

Column-store addresses some of these shortcomings of row-store by keeping like fields together. Columnar storage often eliminates the necessity for secondary indexes, because the data is stored in an index-like fashion already. It also allows for common aggregate database functions to be performed much faster. For instance, COUNTs, SUMs, or finding values greater than or less than a particular value can be performed much faster. This is because the like values are stored together in the database, requiring fewer reads to retrieve the data.

Column Based

In a column based system, the data would be stored as follows:
Tom:001,Tom:002,Matt:003,Susan:004,Susan:005;
35:001,47:002,153:003,278:004,301:005;
0123:001,0234:002,0234:003,1203:004,0123:005;

 

SAP HANA Data Compression

Another advantage of storing data as columns, which SAP HANA takes full advantage of, is the ability to easily compress data. Compressing data for rows of data can be complicated since you’re often dealing with many different data types for an individual record. The SAP HANA database provides a series of compression techniques that can be used for the data in the column store, both in the main memory and in the persistence. read more…

Recommend This Post! Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Pin on Pinterest
Jan 17 17

Mastering The Web Dynpro Debugging tool

by admin
Recommend This Post! Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Pin on Pinterest

ABAP

Jonathan Andre is a lead ABAP developer at IT Partners. Jon is also the President of Andre Technical Consulting LLC located out of Centreville, Virginia. Jon has over 5 years experience with SAP, with a concentration on ECC SD, MM, and IS-OIL modules. Jon’s focus has been in the areas of ABAP OOP and ABAP Web Dynpro. He can be reached at jon.andre@itpsap.com

This month’s article will be a study in the use of little-known tool available in the ABAP Debugger, the Web Dynpro Tool. The author is a co-worker and a friend.  I first worked with Jon during his tenure as a SAP ABAP developer on a DOD project. Jon is an extremely intelligent and motivated developer. His desire to take “ownership” of the task assigned and see it through to completion is evidence of his strong work ethic and commitment to excellence. I am sure you will find this month’s post informative and actionable in your current working environment.

Introduction to the Web Dynpro Debugger Tool

Web Dynpro can be a tricky technology to master. The complex interaction of views, windows, components and contexts can at times be difficult to understand and frustrating to work with. Debugging Web Dynpro applications with the standard debugger is often even more frustrating than developing for it. It requires navigating an endless number of web of objects, never quite knowing the best way to reach the next view or window you want to investigate.

Fortunately, SAP has provided a very useful Web Dynpro tool that can be used to debug Web Dynpro applications. This tool allows users to analyze their Web Dynpro applications real time in a structured format that resembles regular Web Dynpro development in SE80.

This post will focus on introducing the Web Dynpro tool using an example scenario that I often see in practice. Along the way, I’ll attempt to point out other useful features that should help readers become more comfortable with the Web Dynpro tool, and debugging Web Dynpro applications in general.

Preparing to Use the Web Dynpro Tool

In this example we have a view element (a TextView to be exact) that is displaying the incorrect information (not actually true, but let’s pretend). This TextView displays the current sequence number of a bill of material item, so I would like to determine when it is being populated and what business logic is being used to populate it. (see below)

Web Dynpro

Before I’m ready to begin using the Web Dynpro tool, I need some very basic information about the element and view I am investigating (I have explained where to find this information at the end of this article for those less familiar with Web Dynpros).

  1. Component of the view: /SAPPSSRM/WDC_DO_SUBCON
  2. View itself: V_SUBCON
  3. TextView ID: ZSUBCON_SEQUENCE_NO_EDITOR
  4. Context Node of Attribute: ZSUBCON_COMP
  5. Name of Node Attribute: SEQUENCE_NO
  6. This can all be determined by navigating to the view within the Web Dynpro Explorer in SE80.

For this particular case, I notice that there is a context binding for my TextView.  TextView ZSUBCON_SEQUENCE_NO_EDITOR is bound to ZSUBCON_COMP->SEQUENCE_NO, and so by tracking the value of the SEQUENCE_NO attribute, I will be able to determine the value of the TextView itself.

Web Dynpro

With this information in hand, I would also like to set a breakpoint with the WDDOMODIFY method of the V_SUBCON view controller to serve as a good starting point in the investigation. (see below)

Web Dynpro WDDOMODIFY

After we set our breakpoint, we are ready to execute Web Dynpro application and, hit our breakpoint. Once the code has stopped at this point and our debugger has opened, we can retrieve the Web Dynpro tool and begin the investigation.

read more…

Recommend This Post! Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Pin on Pinterest
Dec 20 16

Using Operating System Commands in ABAP

by admin
Recommend This Post! Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Pin on Pinterest

ABAPAnthony Cecchini is the President of Information Technology Partners (ITP), an SAP consulting company headquartered in Pennsylvania, with offices in Vienna, VA. ITP offers comprehensive planning, resource allocation, implementation, upgrade, and training assistance to companies. Anthony has over 20 years of experience in SAP business process analysis and SAP systems integration. His areas of expertise include SAP NetWeaver integration; ALE development; RFC, BAPI, IDoc, Dialog, and Web Dynpro development; and customized Workflow development. You can reach him at ajcecchini@itpsap.com.

Interacting with the HOST OS using ABAP

SAP does such a good job of abstracting its surrounding environment that we rarely take the features of its host operating system into account. The reality is that ABAP isn’t particularly good at solving certain problems. Rather than trying to reinvent the wheel with convoluted solutions, it’s best to solve these problems with the right tool. And sometimes, that tool is sitting on the operating system just waiting to be used.

For instance, at one of our current clients, I was working on their EDW team and needed to archive a file from a “process” directory to an “archive” directory after processing. I was surprised to see a relatively seasoned developer was using ABAP logic to achieve this. They were opening a new file in the “archive” directory, writing the contents, and closing the file and finally deleting the file from the “processing” directory. I changed the code to utilize the UNIX MOVE command. It was much less code and leveraged the existing UNIX Command.

In this blog, I want to show you how to interact with the host operating system of SAP NetWeaver AS ABAP. Specifically, I’ll introduce you to a framework that SAP provides as part of the standard to define external commands in a highly portable manner. After explaining the basics of this framework, we will look at an example of how to define and use the external commands.

Programming in ABAP with External Commands

Unlike other programming interfaces provided in ABAP, there is no built-in language statement that you can use to execute external commands. Instead, you must define these commands within the system so that they can be executed via standard API functions. Let’s begin by exploring how to maintain the external commands.

Maintaining External Commands

OS Host External commands are maintained using Transaction SM69. As you can see from the screen shot below, a lot of commands are delivered by SAP in every NetWeaver system; consequently, it’s always a good idea to see if SAP has already configured the command you’re looking to execute instead of creating a new command definition from scratch.

SM69 Maintain External Commands

OK, let’s take a deeper look. In order to show you how to configure your own custom external commands, let’s look at one delivered by SAP. The PING command is available on any SAP NetWeaver AS ABAP host. The PING command will determine whether an IP address is reachable on a network.

read more…

Recommend This Post! Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Pin on Pinterest
Nov 12 16

Running ABAP Traces in the New Debugger

by admin
Recommend This Post! Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Pin on Pinterest

ABAPAnthony Cecchini is the President of Information Technology Partners (ITP), an SAP consulting company headquartered in Pennsylvania. ITP offers comprehensive planning, resource allocation, implementation, upgrade, and training assistance to companies. Anthony has over 20 years of experience in SAP business process analysis and SAP systems integration. His areas of expertise include SAP NetWeaver integration; ALE development; RFC, BAPI, IDoc, Dialog, and Web Dynpro development; and customized Workflow development. You can reach him at ajcecchini@itpsap.com.

Running Traces in the ABAP Debugger

I was recently on a Skype learning session at a client where the topic was “Advanced Debugging Techniques”. The developer delivering the live training was showing examples of using Debugger Scripting. For those that need a refresher on what that is, check out our blog post, Fast, and Easy SAP ABAP Debugger Scripting.

While explaining how to execute a statement trace for an SAP ABAP Program using the delivered script “RSTPDA_SCRIPT_STATEMENT_TRACE”, one of our new ABAP developers asked if there was a way to trace SQL, similar to running ST05. And this Blog post was born…

The Answer is a resounding YES! Not only can you trace SQL, but you can trace buffers, RFC’s, Enqueues, and the Classic SE30 ABAP Trace.

Lets run an example using the ST05 Performace trace. If you need a refresher on what this trace is, and how to interpret it take a look at our blog post ABAP Database SQL Analysis Using The Performance Trace parts one and two. Please note you also require ECC SAP_ABA release 702.

Running ST05 in the ABAP Debugger

First, we need to be debugging something with SQL. So for this blog post I am going to use a liitle program ztony_demo_traces. Here is the code below:

REPORT ztony_demo_traces.

TABLES: vbak.

SELECT *
FROM vbak
INTO vbak.
ENDSELECT.

BREAK-POINT.

SELECT SINGLE *
FROM vbak
INTO vbak
WHERE vbeln = '0000004969'.

BREAK-POINT.

OK, let’s put a BREAK_POINT on the first select and run the program. The debugger should pop up and land you in the Standard Tab.

read more…

Recommend This Post! Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Pin on Pinterest

Pin It on Pinterest

Share This