0% found this document useful (0 votes)
62 views11 pages

Finding ABAP Source Code in SAP

The document discusses where ABAP source code is stored in SAP. It explains that when an ABAP program is created, the source code is initially only stored in main memory on the application server. When the program is saved, the source code is compressed and inserted into the REPOSRC table in the database. When the program is activated, the source code is compiled to bytecode, compressed, and inserted into the REPOLOAD table. This allows the source code to be accessed for development and the bytecode to be interpreted for runtime.

Uploaded by

Simon Delkes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views11 pages

Finding ABAP Source Code in SAP

The document discusses where ABAP source code is stored in SAP. It explains that when an ABAP program is created, the source code is initially only stored in main memory on the application server. When the program is saved, the source code is compressed and inserted into the REPOSRC table in the database. When the program is activated, the source code is compiled to bytecode, compressed, and inserted into the REPOLOAD table. This allows the source code to be accessed for development and the bytecode to be interpreted for runtime.

Uploaded by

Simon Delkes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Where Can You Find Your ABAP Source Code? [Link]

([Link]

LEARN AND INNOVATE WITH SAP EXPERTS

ABAP MENTOR
All posts Classical ABAP Developer (/category/[Link])
OO ABAP Developer (/category/[Link])
ABAP Architect (/category/[Link])
SAP Integration Developer (/category/[Link])

Search here... 

How to Change the Theme of Your ABAP Workbench Tools? (/post/how-to-change-the-


[Link])
Subscribe for SAP: Getting Started Challenge (/post/subscribe-for-sap-getting-started-
[Link])

WHERE CAN YOU FIND YOUR ABAP SOURCE CODE? (/POST/WHERE-CAN-YOU-


[Link])
26. January 2016 / in [8] ABAP Report Developer (/category/[Link]), ABAP Workbench (/category
/[Link]), Classical ABAP Developer (/category/[Link]) / by abapmentor
([Link]

1 van 11 12-5-2023 11:10


Where Can You Find Your ABAP Source Code? [Link]

OVERVIEW
SAP stores your ABAP code in the d a t a b a s e . But what does it actually mean? Let me explain
this on an example.

RELEASED!!!

I have good news for you. My latest course, the A B A P Wo r k b e n c h : T h e B i g P i c t u r e


([Link] is available on Pluralsight.
Watch the C o u r s e O v e r v i e w ([Link]
name=abap-workbench-big-picture-m0&mode=live&clip=0&course=abap-workbench-big-
picture) for free here.

YOU CREATE A NEW ABAP PROGRAM

2 van 11 12-5-2023 11:10


Where Can You Find Your ABAP Source Code? [Link]

It all starts with that you c r e a t e a new ABAP program. In parallel, the system creates a l o c k
on the Application Server for this ABAP program with your user id. Then you start typing the
source code.

It's a really simple program. It adds two numbers and prints out their results.

Z_ABAP_DEMO

3 van 11 12-5-2023 11:10


Where Can You Find Your ABAP Source Code? [Link]

1 REPORT z_abap_demo.
2
3 DATA(result) = 3 + 2.
4 WRITE result.

This program only exists on the Application Server i n t h e m a i n m e m o r y , since you have not
saved it yet.

ABAP WORKBENCH: THE BIG PICTURE (SNEAK PREVIEW)


This is a sneak preview of the course, A B A P Wo r k b e n c h : T h e B i g P i c t u r e on Pluralsight. If
you want to be informed about the release date and other useful content in this topic, just
sign up!

GET ME INFORMED! (HTTPS://[Link]/LEADBOX/145AA6873F72A2%3A16D0589D3346D

YOU SAVE THE ABAP PROGRAM


Once you s a v e the program, the system automatically places the source code into the
database. More precisely, the system places your code into the database table, called
R E P O S R C . So, there is a table in the database, called REPOSRC, into which the system
inserts a new record.

REPOSRC

PROGRAM STATUS SOURCE CODE (COMPRESSED) ...

Z_ABAP_DEMO I FFDC000000121F9D023A0651862006578600... ...

A new record for your newly created ABAP program, called, Z _ A B A P_ D E M O . Of course in
inactive version �rst. But that's not the point. The point is the system places your source code
into a simple t a b l e � e l d .

No, you are wrong. This is your source code, but in a c o m p r e s s e d format.

It is actually compressed using a so-called L e m p e l - Z i v a n d H u f f m a n compression method.

4 van 11 12-5-2023 11:10


Where Can You Find Your ABAP Source Code? [Link]

So, if you want, you can write a simple decompression tool, and decompress this value. That
would result this source code above.

But of course, it's not necessary. The A B A P E d i t o r does it for you. Whenever you open this
ABAP program using the ABAP Editor, the system reads this row from the REPOSRC table.
Then decompress the content of this �eld, and display it for you.

Okay. What happens next?

YOU ACTIVATE THE ABAP PROGRAM


Yes. If you're ready, you a c t i v a t e your code. With this activation, the system changes the
status of your program from i n a c t i v e to a c t i v e in the REPOSRC table.

REPOSRC

PROGRAM STATUS SOURCE CODE (COMPRESSED) ...

Z_ABAP_DEMO A FFDC000000121F9D023A0651862006578600... ...

And... In parallel, it translates your ABAP code to a so-called platform-independent b y t e


c o d e by the A B A P c o m p i l e r .

ABAP BYTE CODE

...
21 L ccgi CB 0000 0003 0000 0002
25 S WRIB 01 0000
26 S WRIT 00 001B
27 S WRIB 00 0000
28 S ---- 00 0000
29 N xper 16 0DB9 001C 001D
31 S PERP 80 0001
...

And places this byte code into another table, named R E P O LO A D .

REPOLOAD

5 van 11 12-5-2023 11:10


Where Can You Find Your ABAP Source Code? [Link]

PROGRAM STATUS LOAD (COMPRESSED) ...

Z_ABAP_DEMO A FF653F0000121F9D026DD7DA83AB2ACEF8B... ...

So, the system inserts a new record with this generated byte code into this table. Also in a
c o m p r e s s e d format. So, this platform-independent byte code and your ABAP source code
are also i n d e p e n d e n t from any o p e r a t i n g s y s t e m s .

Whenever you modify this source code in the ABAP Editor and then save the changes, the
system will update the corresponding row in the REPOSRC table.

And whenever you activate these changes, the system re-generates the platform-
independent byte code and updates the corresponding row in the REPOLOAD table.

WHY DO WE NEED TWO FORMS OF THE SAME ABAP CODE?


On the one hand, whenever you d i s p l a y or e d i t this ABAP source code for example with the
A B A P E d i t o r , the system will read and update the corresponding row in the REPOSRC table.

So, the �rst form is for d e v e l o p m e n t purposes.

On the other hand, the ABAP byte code is l o a d e d and i n t e r p r e t e d by the A B A P R u n t i m e


E n v i r o n m e n t when you execute the ABAP program.

So, the second form is for r u n t i m e purposes.

DEVELOP, ACTIVATE AND RUN

6 van 11 12-5-2023 11:10


Where Can You Find Your ABAP Source Code? [Link]

Alright. Let's see this example once again in one piece.

1 . You c r e a t e a new ABAP program in the ABAP Editor.


2 . After you s a v e it, the system inserts a new record for this program into the R E P O S R C
table.
3 . Once you a c t i v a t e the program,
4 . the system g e n e r a t e s the platform-independent byte code.
5 . Then automatically i n s e r t s this byte code into the R E P O LO A D table.
6 . Finally, when someone r u n s this ABAP program,
7 . the ABAP Runtime Environment l o a d s this byte code to the memory (if it's needed). Then
i n t e r p r e t s it as operating system-speci�c machine language commands.

SUMMARY
So, as you could see the ABAP Source Code and also the ABAP Byte Code are both p l a t f o r m
independent.

The system only translates the byte code to operating system-speci�c machine language
commands at the last stage, a t r u n t i m e .

7 van 11 12-5-2023 11:10


Where Can You Find Your ABAP Source Code? [Link]

This makes ABAP operating system independent programming language.

If you liked it , please share it! Thanks!

Tags: ABAP ([Link] Source Code


([Link] ABAP Workbench: The Big
Picture ([Link]
/ABAP+Workbench%3a+The+Big+Picture), Pluralsight ([Link]
[Link]/?tag=/Pluralsight), ABAP Report ([Link]
/ABAP+Report)

Currently rated 5.0 by 5 people

SHARE THIS POST


Share

IF YOU LIKED THIS POST, GET REGULAR UPDATES.

First Name

Email Address

GET UPDATES

RELATED POSTS

Where Can You Find Your ABAP Source Code? (/post/where-can-you-�nd-your-abap-source-


[Link])
Overview SAP stores your ABAP code in the database. But what does it actually mean? Let me explain t...

5 Ways to Improve the Readability of Your ABAP Code Part IV. - Formatting Does Matter

8 van 11 12-5-2023 11:10


Where Can You Find Your ABAP Source Code? [Link]

(/post/5-ways-to-improve-the-readability-of-your-abap-code-part-iv-formatting-does-
[Link])
Overview First of all Happy and Successful New Year to my dear readers! I hope you all had a great h...

5 Ways to Improve the Readability of Your ABAP Code Part V. - The Proper Use of Comments
(/post/5-ways-to-improve-the-readability-of-your-abap-code-part-v-the-proper-use-of-
[Link])
Overview In the last few posts we have talked about why to use meaningful identi�er names, why to a...

9 van 11 12-5-2023 11:10


Where Can You Find Your ABAP Source Code? [Link]

([Link]

ABAP MENTOR (HTTP://[Link]/TEAM/DETAILS/GONCZYA)


Practical Guide for ABAP Developers

First Name

Email Address

GET UPDATES

CATEGORIES

 ABAP Workbench (/category/[Link])

 ABAP Editor (/category/[Link])

 ABAP Dictionary (/category/[Link])

 Class Builder (/category/[Link])

 SOA Manager (/category/[Link])

 Web Application Builder (/category/[Link])

 SAP GUI (/category/[Link])

 Transformation Editor (/category/[Link])

10 van 11 12-5-2023 11:10


Where Can You Find Your ABAP Source Code? [Link]

LATEST POSTS

Simple way to import deep XML in ABAP (/post/simple-way-to-import-deep-xml-in-


[Link])

Simple way to generate deep XML in ABAP (/post/simple-way-to-generate-deep-xml-in-


[Link])

How to Change the Theme of Your ABAP Workbench Tools? (/post/how-to-change-the-


[Link])

Where Can You Find Your ABAP Source Code? (/post/where-can-you-�nd-your-abap-source-


[Link])

Subscribe for SAP: Getting Started Challenge (/post/subscribe-for-sap-getting-started-


[Link])

11 van 11 12-5-2023 11:10

You might also like