02-05-2009 10:05 PM
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
02-05-2009 10:19 PM
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
02-05-2009 10:14 PM
Do a select on TSTC with program name, if it fails then there's no TCODE.
02-05-2009 10:18 PM
In table TADIR with OBJECT = 'PROG' you have all the programs, if this program isn't in table TSTC then don´t have TCODE.
02-05-2009 10:16 PM
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!!!!!
02-05-2009 10:19 PM
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
02-06-2009 2:46 AM
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
02-06-2009 3:40 AM
try :
SELECT * FROM tstc
INTO TABLE t_tstc
WHERE tcode LIKE 'Z%' OR tcode LIKE 'Y%'
AND pgmna = space.
02-06-2009 3:58 AM
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
02-06-2009 4:31 AM
Hi,
Try this
SELECT * FROM tstc
INTO TABLE t_tstc
WHERE (tcode LIKE 'Z%' OR tcode LIKE 'Y%')
AND pgmna = space.
Cheers,
Surinder
02-06-2009 4:17 PM
check this:
SELECT * FROM tstc
INTO TABLE t_tstc
WHERE tcode LIKE 'Z%'
OR tcode LIKE 'Y%'
AND pgmna = space
AND cinfo = '00' .
02-06-2009 6:06 PM
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
02-06-2009 6:14 PM
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
02-05-2009 10:21 PM
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.