Skip to Content

Let’s review what we have learned so far. Through SQL trace and debugging, we have learned below:

1. When we click activate button in ABAP development tool ( I call it Eclipse now in this blog ), there are several corresponding ABAP objects generated and table entries inserted. Through debugging we know lots of related logic are implemented in package SDDL.

2. When we test read & search function against the odata service created on top of the CDS view, the operation is delegated to CL_SQL_STATEMENT~EXECUTE_QUERY.

And now I ask myself, since what we have typed in Eclipse is pure text, how does ABAP backend interpret the text and convert it into ABAP DDIC objects? The only hint we have is the SDDL package. There are more than 10 classes in it. Although an experienced ABAP developer can easily identify which class is responsible for the text->ABAP view conversion just according to the class name and description, whereas ABAP newbies need more time to practice their intuition.

/wp-content/uploads/2016/03/clipboard1_905954.png

The tip here is, if you are not sure which class is what you are looking for, then always start with what you have already known. In our case it is CL_SQL_STATEMENT~EXECUTE_QUERY. Set breakpoint on this method and type some more characters in Eclipse, the breakpoint is triggered immediately.

From the callstack, we know that every time after you type something in Eclipse, it will fire Syntax check request to ABAP backend.

/wp-content/uploads/2016/03/clipboard2_905955.png

You can observe this via in the bottom part of your Eclipse.

/wp-content/uploads/2016/03/clipboard3_905956.png

From the callstack we find a class CL_DD_DDL_HANDLER which implements interface IF_DD_DDL_HANDLER which seems is what we look for. Open this class and there is a method GET_VIEWDEF_FROM_SRC, which indicates the method converts the SouRCe code to ABAP VIEWDEFinition. Set breakpoint in it and click activate button again in Eclipse.

/wp-content/uploads/2016/03/clipboard4_905960.png

/wp-content/uploads/2016/03/clipboard5_905961.png

This class will parse source code:

/wp-content/uploads/2016/03/clipboard6_905962.png

/wp-content/uploads/2016/03/clipboard7_905963.png

/wp-content/uploads/2016/03/clipboard8_905964.png

From the code, it is very clear that the parse output, view definition in ABAP format is used to generate ABAP database view.

/wp-content/uploads/2016/03/clipboard9_905965.png

There is also another approach which can allow you to get a clearer view:

Open the “ABAP Communication Log” view:

/wp-content/uploads/2016/03/clipboard10_905966.png

Switch on Logging:

/wp-content/uploads/2016/03/clipboard11_905967.png

Then make some dummy change on your view, then you can observe the following six requests sent to ABAP backend.

The highlighted “abapCheckRun” is just the syntax check we already learned.

/wp-content/uploads/2016/03/clipboard12_905968.png

Double click on the request to see request detail. Here the view source code is encoded in Base64 format stored in chkrun:content.

/wp-content/uploads/2016/03/clipboard13_905969.png

We can of course see the original text from some decode-encode online conversion website:

/wp-content/uploads/2016/03/clipboard14_905970.png

If you could like to debug any request you see in ABAP communication log view, please refer to this document: An example to help you understand how does ADT work .

/wp-content/uploads/2016/03/clipboard15_905971.png

When you click activate button in Eclipse, you can know that a syntax check is always performed before the real activation.

/wp-content/uploads/2016/03/clipboard16_905972.png

To report this post you need to login first.

2 Comments

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

  1. Peter Inotai

    Hi Jerry,

    Thanks for this blog.

    “ABAP Communication Log” was new to me, it looks quite useful for me.

    I’m looking forward for your further blogs.

    Best regards,

    Peter

    (0) 

Leave a Reply