Skip to Content
Author's profile photo Jerry Wang

A Small tip to get all transparent tables used in ABAP code

If you need a list of all transparent tables used in a given ABAP class ( or function module, objects which belong to a given transport request, etc ) for analysis usage, you could follow the tips below, it is very simple but efficient.

Suppose you need to scan ABAP class CL_CRM_OPPORTUNITY_IMPL to find out all transparent tables used by this class.

1. use tcode SCI, create a new check variant:

/wp-content/uploads/2015/06/clipboard1_724720.png

Enable “Table Names from SELECT statements” and save variant.

/wp-content/uploads/2015/06/clipboard2_724727.png

2. create a new inspection:

/wp-content/uploads/2015/06/clipboard3_724728.png

Specify the class to be scanned, and load the check variant created in step one, then execute the inspection.

/wp-content/uploads/2015/06/clipboard4_724729.png

3. Once inspection is done, you see a green light and could get the inspection result by clicking button below:

/wp-content/uploads/2015/06/clipboard5_724730.png

All accessed tables are listed there:

/wp-content/uploads/2015/06/clipboard6_724731.png

Double click on each entry and the ABAP code will automatically be opened. Quite easy, isn’t it? 🙂

Summary

As we know that the code inspection is done statically by scanning source code so any other tables which are accessed dynamically by dynamic SQL in the runtime will not appear in the scan result of code inspector. If you need to get the COMPLETE list of the tables involved within a given part of ABAP codes, it is recommended to use transaction code ST05, ST12 or SAT to trace the scenario in the runtime.

Further reading

1. ABAP Code inspector is far more than a static code scanner but in my opinion a powerful weapon which is for every ABAPer worth adding it to your toolbox. For more extensive usage on it to make your life easier, please read this document Useful tips regarding ABAP code inspector that you may not know .

2. Besides the approach to get accessed table list introduced in this blog, there is another approach using transaction code SQF, which is also done based on static code scan. For details please read ABAP static analysis tool SQF.

Assigned Tags

      10 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Cool, man.

      And which Jerry Wang you are? we have same one in SH 😉 .

      regards,

      Archer

      Author's profile photo Jerry Wang
      Jerry Wang
      Blog Post Author

      Hi Dengyong,

      I know the Jerry you mentioned. However,  I am the Jerry located in CD, CRM dev 🙂

      Best regards,

      Jerry

      Author's profile photo Former Member
      Former Member

      Yes, It is very useful. Good thinking Jerry.

      Author's profile photo Former Member
      Former Member

      Good Post and thanks for sharing the informaiton..

      Author's profile photo Christian Drumm
      Christian Drumm

      Hi Jerry,

      the code inspector performs a static code analysis. Therefore, this approach won't be able to list all tables. Any table that is dynamically read during runtime won't be in the result list.

      If you really want to get all tables used during run time you need to trace the object e.g. using ST01.

      Best,

      Christian

      Author's profile photo Jerry Wang
      Jerry Wang
      Blog Post Author

      Hi Christian,

      Thanks a lot for pointing it out. Now I add it to the summary part in order not to cause any misunderstanding about this usage 🙂

      Best regards,

      Jerry

      Author's profile photo Former Member
      Former Member

      simply suprb

      Author's profile photo Former Member
      Former Member

      Hi ,

      thanks for sharing the information.

      this is usefull information....

      Author's profile photo swadhin ghatuary
      swadhin ghatuary

      Good Job. Keep Posting.

      Author's profile photo Alexander Winter
      Alexander Winter

      There is an inverse Where-used functionality called "Environment" in the where-used menu Usability, which should achieve the same. It lists any type of repository object that is called or referred by the object in scope.  I accidentially stepped into it some years ago and found it very useful sometimes.

      There is only one shortcoming: The object you want to scan the "environment" of which must be referred by at least one other object in order to enter the where-used screen. This is often the case with reports, which are not stand-alone by nature but often also stand up-front.  If that's the case, there is no standard means to call the environment  functionality as far as I know.

      It's good then to have the trick Jerry described in this blog – thanks a lot!