SAP logical database includes macro implicitly. How?

Viewed 562

We are writing a tool in Java that parses and transforms ABAP code. We therefore have no intention to write new ABAP code but our tool has to handle all of ABAP, even obsolete statements. Furthermore, I'm not an ABAP expert.

One object we see uses a macro begin_of_block that is defined in object RFDBRMAC. That include is loaded in case the logical database BRF is used; using another logical database as well as no logical database at all will not load it. But neither its corresponding object SAPDBBRF nor its includes mention RFDBRMAC. In particular, none of the former include the latter.

How does assigning the logical database BRF to a program makes it include RFDBRMAC?

Demo program using logical database BRF. The macro is known Demo program using logical database BRF. The macro is known

Demo program using a different logical database. The macro is unknown Demo program using a different logical database. The macro is unknown

2 Answers

In transaction SE36 display the logical DB BRF. Then click the pushbutton 'Selections' (or Menu: Goto / Selections or Shift + F1). This will display the include DBBRFSEL, where the selection screen is defined for the logical DB. On the bottom of this include you'll find what you are looking for.

To generalize this for all logical DBs, the selection screen is named DBxxxSEL where xxx is the name of the logical database, and is automatically included in all programs which use this logical database.

In addition to Jozsef's perfect answer I can add that you can utilize table D010INC which holds all include relations between programs and includes.

enter image description here

Thus it's very easy to find such includes programmatically.

Related