cancel
Showing results for 
Search instead for 
Did you mean: 

How to use code inspector tcode SCI to find the list of tables against any tcode?

former_member563268
Participant
2,288

Hello All,

I was trying to find a method to fetch the list of all tables used in any program. Wanted same for identifying the list of tables in place in ny executable program. Noted a case, where we can find it using SCI(code inspector) by configuring the variant for the checkbox

Dynamic and Client-Specific Accesses with INSERT, UPDATE, MODIFY, DELETE under security check and again setting up an object set and inspection. But I was facing some issues with the build. Could you please advise if this can be achieved in the same manner. I was able to configure but with no data. Could you please drop in your suggestions.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member1716
Active Contributor

Hello J ABAP,

Apart from the method suggested by Gaurav Karkara there is another simple way to do this, follow the below steps:

1) Go to T-Code SE93 and enter the transaction you are interested to get the Master program details.

2) Now reach out to the table D010TAB and enter the master program name in the field MASTER and execute.

3) In the field TABNAME you will get all the tables used for this Program which also indicates the tables used for the T-Code. You will also get the obsolete details of the tables.

Regards!

loyd_enochs3
Participant
0 Kudos

Hi Satish,

I'm not sure about using SE91 to get the master program name. In my system, that shows the message classes and messages.

And while D010TAB will display the names of the tables used for a master program/T-Code combination, it will also display all the tables referenced by any transaction that calls the master program. One glaring example of this problem is SAPMV45A, which is called by 28 transaction codes. D010TAB returns 3,897 table entries for SAPMV45A.

Granted, SAPMV45A is an outlier and most main programs won't have that much reuse. I personally still prefer the Trace method, since I find it returns a more refined result set.

former_member1716
Active Contributor
0 Kudos

Hello Loyd Enochs,

Thanks for pointing out the T-CODE, it is typo from my end. I just edited the same.

On your opinion on fetching tables from master program yes you are right, ST05 gives more refined result.

Regards!

GK817
Active Contributor

Hi,

You have to use it through transaction ST05. You have to use the option 'Trace Analysis using Code Inspector'.

Here is the detailed blog:

https://blogs.sap.com/2014/02/11/code-inspector-integration-into-sql-trace-of-st05/

https://blogs.sap.com/2007/09/05/the-sql-trace-st05-quick-and-easy/

Regards

GK

former_member563268
Participant
0 Kudos

Thanks Gaurav; but i understand all of this requires an execution of program, pulling trace and then analysing it. I was looking for a mass run; for a bigger list of program/Tcode. And i believe this process will be cumbersome.Is there a better way to achieve this in SCI, getting the list of all tables in use (for any DB operations).

Similar to what Satish suggested, had noted a code using D010TAB and tstc/TSTCT table. But not sure how robust would this be, especially considering different includes / methods.

SELECT tstct~tcode tstct~ttext d010tab~tabname dd02t~ddtext INTO CORRESPONDING FIELDS OF TABLE it_detail FROM tstc INNER JOIN tstct ON ( tstc~tcode = tstct~tcode ) INNER JOIN d010tab ON ( tstc~pgmna = d010tab~master ) INNER JOIN dd02l ON ( d010tab~tabname = dd02l~tabname ) INNER JOIN dd02t ON ( dd02l~tabname = dd02t~tabname ) WHERE tstct~sprsl EQ ‘E’ AND dd02l~as4local EQ ‘A’ AND dd02l~as4vers EQ ‘0000’ AND dd02l~tabclass EQ ‘TRANSP’ AND dd02t~ddlanguage EQ ‘E’.

Regards,

FredericGirod
Active Contributor
0 Kudos

I think you are rebuilding ST03n & SQLM Monitor

former_member563268
Participant
0 Kudos

hello Frederic, Not really. Its more to do with the table list in use (could be SELECT/INSERT/ DELETE/MODIFY/UPDATE operation) for any tcode; and this list is further used for some analysis by Basis team internally. Thats a part of a short project.

Regards.

michael_koehler2
Participant
0 Kudos

Hi J ABAP,

Looks like you need to get some static 'which-table-used' list for a given TCode - and then mass processing a list of TCodes. Any dynamic (ST05 and such) analysis will not cover your requirements. Neither will any approach to analyze TCodes individually.

The problem with the Code Inspector in your use case is that it does not inspect Transactions - but that is not really the fault of the Code Inspector. But rather lies in the fact that a Transaction can call all sorts of programs.

So your requirement is at least two-sided. First, you have to analyze the TCode to find the implementing method (by Report, Program, Class...) of the transaction. This is encoded in the Table TSTC, but somewhat convoluted. Check SAP Program SAPLSEUK Include LSEUKF01, Form 'select_tstc_tables_new' for how that works.

Second, you have to somehow automate the Code Inspector. There are several ways to attempt this; but that IMHO goes beyond the scope of this forum.

Sorry I could not give you a simple answer, but I still hope that helps to get you started.
Mike