Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Programes with no tcodes

Former Member
0 Kudos

Hi all,

Can you please tell me how can I get the list of all the custom programes those who have no Tcodes assigned to them.

Thanks,

Rajeev

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Check this program..

DATA: t_trdir TYPE STANDARD TABLE OF trdir,
      t_tstc  TYPE STANDARD TABLE OF tstc,
      s_trdir TYPE trdir.

SELECT * FROM trdir
       INTO TABLE t_trdir
       WHERE ( name LIKE 'Z%' OR name LIKE 'Y%' )
       AND   subc = '1'.

SELECT * FROM tstc
       INTO TABLE t_tstc
       WHERE tcode LIKE 'Z%' OR tcode LIKE 'Y%'.
SORT t_tstc BY pgmna.

WRITE: / 'List of programs with no tcodes'.
SKIP 1.

LOOP AT t_trdir INTO s_trdir.
  READ TABLE t_tstc
             TRANSPORTING NO FIELDS
             WITH KEY pgmna = s_trdir-name.
  IF sy-subrc <> 0.
    WRITE: / s_trdir-name.
  ENDIF.
ENDLOOP.

Thanks

Naren

12 REPLIES 12

Former Member
0 Kudos

Do a select on TSTC with program name, if it fails then there's no TCODE.

0 Kudos

In table TADIR with OBJECT = 'PROG' you have all the programs, if this program isn't in table TSTC then don´t have TCODE.

amit_khare
Active Contributor
0 Kudos

One way I can think of is read all data from TRDIR in one internal table for Z Programs and from TSTC in another program then compare and delete.

For alternates refer this -

Total Questions: 249 (84 unresolved)

you are reminded so many times about this earlier also......alas!!!!!

Former Member
0 Kudos

Hi,

Check this program..

DATA: t_trdir TYPE STANDARD TABLE OF trdir,
      t_tstc  TYPE STANDARD TABLE OF tstc,
      s_trdir TYPE trdir.

SELECT * FROM trdir
       INTO TABLE t_trdir
       WHERE ( name LIKE 'Z%' OR name LIKE 'Y%' )
       AND   subc = '1'.

SELECT * FROM tstc
       INTO TABLE t_tstc
       WHERE tcode LIKE 'Z%' OR tcode LIKE 'Y%'.
SORT t_tstc BY pgmna.

WRITE: / 'List of programs with no tcodes'.
SKIP 1.

LOOP AT t_trdir INTO s_trdir.
  READ TABLE t_tstc
             TRANSPORTING NO FIELDS
             WITH KEY pgmna = s_trdir-name.
  IF sy-subrc <> 0.
    WRITE: / s_trdir-name.
  ENDIF.
ENDLOOP.

Thanks

Naren

0 Kudos

Thanks a lot for the solution Naren.... I have got one more query where i need to get the list of all the t-codes that doesn't have any program name and for this I have written the following code with your help:

DATA: t_tstct TYPE STANDARD TABLE OF tstct,

t_tstc TYPE STANDARD TABLE OF tstc,

s_tstct TYPE tstct.

SELECT * FROM tstct

INTO TABLE t_tstct

WHERE ( tcode LIKE 'Z%' OR tcode LIKE 'Y%' ).

SELECT * FROM tstc

INTO TABLE t_tstc

WHERE tcode LIKE 'Z%' OR tcode LIKE 'Y%'

AND pgmna = ' '.

*SORT t_tstc BY pgmna.

WRITE: / 'List of tcodes with no program names'.

SKIP 1.

LOOP AT t_tstct INTO s_tstct.

READ TABLE t_tstc

TRANSPORTING NO FIELDS

WITH KEY tcode = s_tstct-tcode.

IF sy-subrc = 0.

WRITE: / s_tstct-tcode.

SKIP 1.

WRITE: / s_tstct-ttext.

ENDIF.

ENDLOOP.

but somehow the program is skippinjg the condition where I have put that if the tstc-pgmna = ' ' " (space )

and it's pulling all the custom codes irrespective if there is any program name attached to it or not..

can you please tell me... where I am doing it wrong.

THanks,

Rajeev

0 Kudos

try :

SELECT * FROM tstc
INTO TABLE t_tstc
WHERE tcode LIKE 'Z%' OR tcode LIKE 'Y%'
AND pgmna = space.

0 Kudos

Hi Jay,

THanks for the reply.... but it's still behaving in the same way... do you have any idea what might be wrong !!!

Thanks

Rajeev

0 Kudos

Hi,

Try this

SELECT * FROM tstc
INTO TABLE t_tstc
WHERE (tcode LIKE 'Z%' OR tcode LIKE 'Y%')
AND pgmna = space.

Cheers,

Surinder

0 Kudos

check this:

SELECT * FROM tstc
INTO TABLE t_tstc
WHERE tcode LIKE 'Z%'
  OR tcode LIKE 'Y%'
AND pgmna = space
  AND cinfo = '00' .

0 Kudos

Rajeev is looking for programs without a tcode, not tcodes without a program ...

Sorry, I see now that the question switched half way down. Perhaps Rajeev is massaging the requirement...

Edited by: Julius Bussche on Feb 6, 2009 7:08 PM

0 Kudos

Change the where clause in the 2nd select.

SELECT * FROM tstc
INTO TABLE t_tstc
*WHERE ( tcode LIKE 'Z%' OR tcode LIKE 'Y%' )*
AND pgmna = ' '.

But why do you need a Program as SE16/SE16N on TSTC would give the result ?

~Suresh

Edited by: Suresh Datti on Feb 6, 2009 7:19 PM

Jelena
Active Contributor
0 Kudos

Just want to point out that even if there is no transaction code assigned directly to a report, it does not mean that this report is not used in any transaction. It might be called dynamically by another report. I ran into this situation a couple of times.