tags:

views:

336

answers:

2

I don't know a thing about ABAP, apart from it has an OO side, and I would like to have some kind of helicopterview of it before I start to look at it in detail. I know I can find all of this when studying it , but like I said for starters I like to know what I am dealing with.

  • Is it (always) compiled?
  • Typestem : Is it strongly typed? Does it use type inference?
  • Inheritance : single / muliple, interface-like structures ?
  • Collections : Has it collections apart from arrays ? Has it generic collections? Does it use List comprehension ?
  • How about (con/contra/in)variance in arrays, returntypes, parametertypes, overriding?
  • Any Exceptionhandling?
  • Any build in design by contract support?
  • Anything remarkable as oposed to other well known languages?
  • ...

Any general info about characteristics basically would be welcome!

+12  A: 

Is it (always) compiled?

ABAP is "compiled" into a sort of byte-code (called "load" for historical reasons) that is then executed by a virtual machine inside the kernel. You can compare this with Java, with one big difference: The load is not machine-independent, but optimized for the target machine type. This means that in a system landscape with several different types of application servers, you might have multiple pre-compiled loads for a single program. Not that you'll ever see any of this - the entire compilation process is handled automatically.

Typestem : Is it strongly typed? Does it use type inference?

Strongly typed with a system of generic types on top. Note that there's a complete data dictionary that is integrated into the language - very handy.

Inheritance : single / muliple, interface-like structures ?

Single inheritance. Interfaces are supported, including composite interfaces and implementation component renaming (two interfaces IF_FOO and IF_BAR can both define a method BAZ, and a class implementing both interfaces will then have two methods IF_FOO~BAZ and IF_BAR~BAZ).

Collections : Has it collections apart from arrays? Has it generic collections? Does it use List comprehension?

What you know as "array" in other programming languages does not really exist in ABAP - you'll usually use so-called "internal tables" instead. Think database-like structured in-memory tables. There are some ideas of collection classes spread out through different modules, but the canonical way to do this is to use internal tables - define a so called table type of lines that either represent references to instances or structures that contain such a reference.

How about (con/contra/in)variance in arrays, returntypes, parametertypes, overriding?

Arrays: see above. Overriding: You can not change the method signature when implementing interface method or overriding superclass methods. As for the parameters - that depends on whether you transfer data (or data references) or object references. In general, upcasting may happen implicitly while you have to perform the downcasting explicitly.

Any Exceptionhandling?

Yes. More than one way - again for to historical reasons (backward compatibility). Class-based exceptions are supported.

Any build in design by contract support?

None that I'm aware of.

Anything remarkable as oposed to other well known languages?

Lots of stuff. You might want to check http://www.volker-wegert.de/en/node/17 and http://www.volker-wegert.de/en/node/21 for an admittedly biased overview :-)

vwegert
Very frienly tx! I also tried to vote you up, but I still have to register it seems.. I might come back later for that.
Marc
Great answer, enlightened me a lot too. Curious that the proponent at http://www.volker-wegert.de/ uses PHP-based open source free Drupal to provide content management for their site. Curious because there could be some interesting "mash-ups" if there was an interface between SAP and Drupal. Keeping the systems separate in development, but when they are put together, some interesting possibilities could occur, e.g. a powerful web front end/web based apps for SAP provided by Drupal.
Rob
@Rob: I'm more into mashing up Java, EMF, XText and ABAP. PHP and ABAP is not really my kind of fetish :-)
vwegert
@vwegert: sounds good to me. It's a great opportunity if your organisation or setup has bought the licenses for using Java with SAP as these seem to be an add-on and not every organisation has them. Also, not every organisation allows developer-users outside the SAP competency centre to develop it. Thanks again for your answer, I will continue to watch commentary about ABAP and SAP with interest.
Rob
@Rob: negative, you don't need additional licenses to use Java with R/ using RFC calls :-)
vwegert
@vwegert: thanks - looks like I have been given misinformation. So: you are saying that any and every SAP installation comes with the built-in capability for a Java program to talk to SAP directly? Actually I think the licensing cost statement was based on the need for an additional user seat to do this communication. Is an extra user required? Well it's encouraging to know that SAP might not be so solipsistic after all :)
Rob
@vwegert: Is Java with R/ using RFC calls the same as the SAP Netweaver?
Rob
@Rob: Please don't use the term NetWeaver unless you have to - that's a fuzzy marketing name for a lot of things. The "R/" was supposed to be "R/3" (typo). Of course you need the user licenses if you want to work with a R/3 system, but you don't need additional licenses if you already have licenses for the ABAP applications (AFAIK and IANAL). And capability: Yes, take a look at JCo (and maybe RCER, shameless plug...)
vwegert
+4  A: 

I'll try to provide some things the previous reply hasn't, while skipping what they did mention:
Is it (always) compiled?
Well, the interface for the programmer says "Activate", not compile, but that's because there is built in version management. When you Activate something, it compiles it, and makes the source and binary versions the "active" version. If someone tries to run source that isn't compiled, it will automatically be compiled as they run it.


Typestem : Is it strongly typed?
Basically, yes. ABAP is like a strange cross between Pascal and COBOL. There are "Field Symbols", which are like pointers. There are also now generic types. (And generic field pointers). One of the coolest things is that there is no difference between ABAP types and Database types. Any table you make will become a structure type automatically. That is to say, ABAP is integrated with the database in a way that almost no other languages are. You can also write SQL, which is actually part of the ABAP, as opposed to being just a string, like in other languages.
Inheritance : single / muliple, interface-like structures ?
There are interface structures, I don't usually use them. If you made a lot of re-usable classes, they would be a good idea, though.
Collections : Has it collections apart from arrays ? Has it generic collections? Does it use List comprehension ?
Better, it has "Internal tables", which are basically a type of dynamic array. They can be declared from almost any type, including those in the data dictionary. They can be looped, sorted, etc. There are several types, including hashed and sorted variants.
Any Exception handling?
Both OOP and non-OOP types.
Anything remarkable as oposed to other well known languages?
As the other poster said, a lot. It is very good at anything to do with database operations, and re-using complex structures and data types. It is naturally is cross-database and cross-platform (OS, and processor). It has a very good version management and transport system. The whole SAP system has very good multi-language support. You can get simple screens with appropriate titles and selection boxes automatically, which means that you can do less programming and more work. You don't have to map between DB types and language types, etc.
Things it's less than good at:
1. Numbers are typically stored as ASCII, this makes it less than fast at math in many applications.
2. Most of the data structures are very normalized, meaning your data may be spread across 50 tables sometimes. "Star" queries are very common. Built in functions to retrieve data (f.e. Logical Databases) are your friend in those cases.
3. SAP tried to be everything to everyone, so there are a lot of configuration options, etc., and sometimes a function doesn't do what you expected it to based on past behavior.
4. ABAP is sometimes very verbose. Try using the "pattern" button on something simple like GUI_DOWNLOAD.
5.SAP was very ambitious with what they took on, and thus ran into limitations of hardware, operating systems, and RDBM systems early-on. Thus, they have legacy kludges to deal with it that aren't pretty. (Pool Tables, Cluster tables, etc.)
6. When you activate a program, it doesn't do full compatibility checking with the function modules used. There are situations where something will activate with no problem, but then crash at run-time, even in cases where it could have been caught at compile time.

Noah