Additional Blogs by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Introduction
I want to say upfront that long time Java programmers probably won’t find too much of interest in this weblog. I wanted to write today about an old ABAP developer’s first couple of weeks’ experiences with the Java Development environment. I in no way claim to be an expert on Netweaver Java development. Instead I just wanted to give my impressions.

That being said let me give the reader a little background on how I approached Java Development. Anyone who has read my weblogs in the past knows that I am a long time ABAP developer. I actually started on an SAP implementation project right out of college. Although I of course had programming classes in college, the first language that I worked with on a day to day basis was ABAP.

These were the early days of the 3.0 release of R/3, so good tutorials and training materials on ABAP were difficult to come by. Today we often take for granted the great sources of education like SDN. In those days I learned ABAP by debugging and taking apart standard SAP applications.

Because of my past experiences, I will always have a special place in my heart for ABAP and I still feel that it is a very important skill set for SAP developers to foster. At my previous job, we were a small development group that already had strong ABAP skills. Taking this into account, we decided to focus on ABAP and not take advantage of the Java development tools within the SAP environment. That is really the strength of Netweaver – to allow customers to choose the tools that are right for their particular situation.

In my new position however I need to be able to represent custom development from both sides of Netweaver – ABAP and Java. So although I’m not leaving my ABAP roots behind, I am staking off on a new journey of discover in the Java side of the world.

What I have discovered over the last two weeks is that Netweaver Developer’s Studio and Java Development within that environment isn’t all that foreign. I actually found a surprising number of comfortable similarities to the ABAP environment. That is what I want to focus on today. So if you are an ABAP developer that has never had the opportunity to explore the Netweaver Developer’s Studio, hopefully I can show you some things that will make you want to at least go exploring.

Local vs. Central
I know that I said that I was going to focus on similarities, but this is one major difference between the ABAP Development Environment and the Netweaver Developer’s Studio that I want to point out right up front.

The ABAP environment takes a very Centralized approach to everything. Programs sources are stored and manipulated on the central server. There is no real offline development. Likewise many objects (data dictionary, classes, etc), are global and can be easily used and referenced for other objects. As ABAP developers, we sometimes tend to think very globally as well because of the structure of this environment.

On the other hand, the Netweaver Developer’s Studio takes a very different approach. Development is done offline on a Java Engine installed on the programmer’s workstations. Sources are checked in and out. Likewise many objects have scope local to their project instead of being global.

These are two rather different approaches. Each approach has its own strengths and weaknesses. I don’t mean to debate either approach – instead I only bring it up because it is an important aspect to the developer’s mindset.

Java Dictionary
The first place I started as I was learning Java was with the Java Dictionary. ABAP is very database centric. Everything from source code storage, table creation, and SQL is integrated into the ABAP environment. That being a given, I didn’t approach the Java Environment with nearly the same expectations. I am happy to say upfront that I was pleasantly surprised by how much of the “Data Dictionary” approach was also present in the Netweaver Developer’s Studio.

First of all, we have the ability to create Simple Types in the Java Dictionary. The Simple Type is really the equal to the ABAP Data Type (or Data Element) and Domain.

Image 1 – Simple Type Definition

Similar to what you can do in a Domain in ABAP, you can define a set of allowed values for a Simple Type. This is called Enumeration. Later if you use this simple type as the Type of a bound Attribute in WebDynpro, UI elements such as the DropDownListBox will use this set of values automatically. This integration with the dictionary is what ABAP developers have come to expect.

Image 2 – Simple Type Enumeration

Also in the Simple Type, we have the ability to setup labels that can be used automatically at different levels of UI elements.

Image 3 – Simple Type Representation

The creation of Simple Types are great for setting up reusable fields with metadata that can be integrated into the UI; however the Java Diction also gives us some very familiar tools for the creation of data base tables.

Image 4 – Table Creation

As you can see in Image 4, the table creation and editing utility looks very much like the corresponding utility in ABAP. Just like in ABAP you have the ability to define the types for each field in your tables locally or to refer to existing simple types. To extend the similarities, there are also tabs in the editor for creating table indexes and setting up table buffering. In the end, I found the Java Dictionary very similar to the ABAP data dictionary.

WebServices
WebServices are obviously an important technology in both the Java and ABAP worlds. In ABAP outbound WebServices are built onto of the existing RFC technology. Any RFC enabled function module can easily be turned into a WebService.

Although not an exact match, EJBs are a close equivalent to Function Modules in the Java World. Although Object Oriented, EJBs serve the main remote execution capabilities within Java. Similar to RFCs in ABAP, EJBs form the main underling layer of WebServices in Java.

But this is really where the differences end. Building WebServices in ABAP and Java uses very similar technology and maintenance applications. In both environments, a wrapper is placed around the native development object. This wrapper is called a Virtual Interface.

Image 5 – Virtual Interface Maintenance

Both the WebService Definition (Image 6) and Configuration (Image 7) levels had maintenance screens that are nearly identical to their ABAP counterparts.

Image 6 – WebService Definition


Image 7 – WebService Configuration

Finally when calling WebServices, you need a level of abstraction to hide the connection details to corresponding system. In both ABAP and Java, this layer is called a Logical Port. The maintenance and features of the Logical Port is very similar in both ABAP and Java.

Image 8 – WebService Logical Port

JSP
The ABAP technology BSP is obviously based quite heavily upon JSP. The original ideas of JSP with tag libraries and the mixture of server side scripting are also the basis of BSP.

There are some differences that I observed. JSP has the close cousin of Servlets. Where Servlets for event handling sit as a separate development object in JSP, BSP integrates its event handlers into a single object. BSP also deviates from JSP as it began to integrate more MVC functionality into the core framework.

Although I found nice similarities between JSP and BSP, I didn’t spend a tremendous amount of time on this tool. I instead moved quickly onto WebDynpro.

WebDynpro
I came to WebDynpro Java from a rather unique perspective. Java WebDynpro has been available since the release of Netweaver04. On the other hand ABAP WebDynpro will only be available with Netweaver04S (although you can download a sneak preview from SDN right now). I had the opportunity to approach Java WebDynpro after already having spent a fair amount of time in WebDynpro ABAP.

What I found that right away I was able to use WebDynpro Java. The vast majority of the development theories surrounding WebDynpro are exactly the same in Java and ABAP. I already understood the structure of Views, Windows, Components, and Contexts. I took about a half hour to play with the Developer’s Studio to get a feel for the only slightly different development UI.

Image 9 – WebDynpro Java

There are obviously some differences between the two tools. When coding methods, in ABAP you have the Code Wizard. In Java you don’t have the code wizard, but you do have better code completion in the editor. I find myself liking each approach. When I work in ABAP, I miss the code completion. When coding in Java, I miss the code wizard. Ideally we would have both features in each tool.

Likewise the two tools differ in the way that you interact with methods. In Java, all methods are displayed together in one coding window.

Image 10 – Java WebDynpro Methods

On the other hand, ABAP has two modes - one that structures its methods more like the global class builder.

Image 11 – ABAP WebDynpro Methods

And one that is just like the Java Approach.

Image 12 - ABAP WebDynpro Methods Implementation View

Overall however I found most of the differences very minor and that they didn’t interfere with my ability to work.

Closing
I think the reader can see that I was pleasantly surprised by how much of my ABAP skill set I was able to reapply to Java Development in the Netweaver Studio. Although I am certainly not trying to convince any ABAP developers to switch to Java, it has been an enjoyable experience to expand my horizons.

11 Comments