Skip to Content
I was quite surprised by the gamut of answers I received when I asked this question informally to various ABAP developers. They weren’t quite sure of it. Ok, everybody knows that ABAP is a fourth generation, high level language. But how many of us are sure as how an ABAP report is executed? Does it have a compiler or an Interpreter or both (hmm)?? Well, the answer is: “To some extent it has both”. To elaborate it: Before an ABAP program is executed, the ABAP compiler must translate it into an intermediate language. This form of program i.e. the program in this intermediate form is called an ABAP load. Then the ABAP virtual machine comes into the picture. ABAP virtual machine is an interpreter for ABAP loads, that is, it can execute ABAP loads. You can somewhat correlate the whole scenario with the process of Java compilation-interpret process.  Before continuing, we need to know what processing blocks are. Well, you might know that an ABAP program has a modular structure. These modules are called as processing blocks. It is just rephrasing stunt. Logically, if we see any ABAP program, it contains two parts: 1.     The first part has the global declarations.  2.     And the second part contains the processing blocks.  There are several types of processing blocks which includes dialog modules and subprograms. More precisely, there are the following types of processing blocks:  1. Dialog modules 2. Event blocks 3. Subprograms (subroutines, function modules and methods).  The dialog modules are called from the screen flow logic. The subprograms are called using ABAP statements which themselves are part of some other processing block and event blocks are called from outside an ABAP program.  Now the ABAP load contains processing blocks in one-to-one correspondence to the processing blocks of the ABAP program, that is, for each processing block in the ABAP program, there is exactly one processing block in the corresponding ABAP load.”  Before executing any processing block, it is first be determined whether the corresponding ABAP program has already been compiled or not. If it had been already compiled, the ABAP Virtual Machine can immediately begin executing the processing block; else the ABAP compiler must first translate the ABAP program into an ABAP load and then execute it.  This was a broad overview of the compilation process of ABAP program. I may write about the structure of ABAP Load and detailed process of compilation in my later blogs.   Btw just for the information, if you have access to the database, you can view the ABAP reports in D010S table and ABAP Loads in D010L table.  
To report this post you need to login first.

28 Comments

You must be Logged on to comment or reply to a post.

  1. Anonymous
    hey Puru,

    Nice info, this question was in my mind since long, but i nvr took pains to find it out. Glad u did the job, and mst say job well done.

    Cheers!
    Ashish

    (0) 
  2. Valery Silaev
    Puru,

    Thanks, excellent info! I was always curious about this.

    Now the second big question — what is bytecode format for these loads? Unfortunately, it seems to be not published by SAP…

    Just imaging that you can write program in Python or Ruby, then compile it to bytecode of ABAP VM and execute as regular ABAP code… Sweet dreams 😉

    VS

    (0) 
    1. Peter Inotai
      Hi Valery,
      It’s a very good question.
      I can imagine it depends on the platform, if it’s unicode or non-unicode system. Might depends on the OS, as well. I’m also very curious to know.
      Best regards,
      Peter
      (0) 
    1. Valery Silaev
      Ashutosh,

      Nothing surprising, actually.
      Now it is de-facto standard to use managed environment and virtual machine. Besides Java and ABAP there is also .NET that folllows this model.

      VS

      (0) 
      1. Puru Govind Post author
        Just wondering, with which language this standard(managed environment n VM) started with? Sailing back to history, I guess its ABAP, since this language was very much in existence when James gosling was even contemplating to write Java.

        Puru

        (0) 
        1. Ilan Shani
          You should notice that the abap code is not copmplied to real intermediate language!

          Part of the key of repoload table (which contains the loads), is the OS, that means, if you have one system with several diffrent WAS os (such as windows/unix), than the repoload table would have twice records.

          The compiler first be determined whether the corresponding ABAP program has already been compiled at the same operation system, if not is creates a new load only for the current operation system.

          That means, the abap compiler creates a new load for every program at every operation system, on-the-fly.

          (0) 
    2. Ilan Shani
      You should notice that the abap code
      is not copmplied to real intermediate language.

      Part of the key of “repoload” table (which contains the loads), is the OS, that means, if you have one system with several diffrent WAS os (such as windows/unix), than the repoload table would have twice records.

      The compiler first be determined whether the corresponding ABAP program has already been compiled at the same operation system, if not is creates a new load only for the current peration system.

      This means, that the compiler creats intermediate language for each operation system,
      on-the-fly.

      (0) 
  3. Harel Gilor
    The tables D010L & D010S are no longer exists in the ECC5 and ECC6 (I have checked for my self).

    I think that the main reason for this is because of the new model of enhancements spots.

    Would you rearrange my thoughts about please?

    (0) 
  4. Daniel Krupavaram
    I had read in an ABAP text book which says  that the ABAP programs are neither interpreted nor complied but they are generated.

    I m not sure how they are generated.

    (0) 
  5. Alexander Schuchman
    I like how SE16 generates a dump when you try to view REPLOAD.  I assume this is so that customer don’t go messing around in this table and destroy their own systems.(or maybe there’s an actual techie reason?)
    The DBA/Basis guys are probably happy to hear this.
    -Alex
    (0) 
  6. Shaily Chaudhary
    Well, Impressive blog indeed…
    But  the question that is still there in my mind is what is the name of the compiler or the interpreter used so?

    could you plz let me know?

    (0) 
  7. Anonymous
    I waiting for your “the structure of ABAP Load and detailed process of compilation”.
    (0) 

Leave a Reply