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: 

Custom Program List

Former Member
0 Kudos

I want to prepare list of all custom objects in system for UPgrade purpose.

Forms - List output type , print program and smart forms/scripts - Printer type used for printing

Interfaces - Reports - Inventory report etc

Extensions -

Is there any T-code to list all outputs. If not whats the best way to do so.

Thank you.

AP

13 REPLIES 13

former_member181962
Active Contributor
0 Kudos

Go to nace transaction

or go to table TNAPR.

Regards,

Ravi

0 Kudos

This is good for only forms and scripts

0 Kudos

Hi AP,

Use this code and leverage it to build your report program.

FORM GET_DATA .

  SELECT * FROM TADIR WHERE
           OBJECT IN SOBJECT
           AND OBJ_NAME IN SOBJNAME
           AND DEVCLASS IN SDEV.
    CLEAR OBJEXIST.
    IF TADIR-OBJECT NE 'TYPE'.
      PERFORM OBJ_EXIST_CHECK.
    ELSE.
      OBJEXIST = 'X'.
    ENDIF.
    IF OBJEXIST EQ 'X'.
      CLEAR ITAB.
      MOVE-CORRESPONDING TADIR TO ITAB.
      APPEND ITAB.
    ELSE.
      MOVE TADIR TO ITAB_ERR.
      APPEND ITAB_ERR.
    ENDIF.
  ENDSELECT.



    SELECT * FROM SMODILOG.
      CLEAR TADIR.
      SELECT SINGLE * FROM TADIR WHERE
            PGMID EQ 'R3TR'
            AND OBJECT EQ SMODILOG-OBJ_TYPE
            AND OBJ_NAME EQ SMODILOG-OBJ_NAME .
      IF SY-SUBRC EQ 0.
        CLEAR OBJEXIST.
        IF TADIR-OBJECT NE 'TYPE'.
          PERFORM OBJ_EXIST_CHECK.
        ELSE.
          OBJEXIST = 'X'.
        ENDIF.
        IF OBJEXIST EQ 'X'.
          READ TABLE ITAB WITH KEY OBJECT = TADIR-OBJECT
                                   OBJ_NAME = TADIR-OBJ_NAME.
          IF SY-SUBRC NE 0.
            CLEAR ITAB.
            MOVE-CORRESPONDING TADIR TO ITAB.
            APPEND ITAB.
          ENDIF.
        ELSE.
          MOVE TADIR TO ITAB_ERR.
          APPEND ITAB_ERR.
        ENDIF.
      ENDIF.
    ENDSELECT.

ENDFORM.                    " GET_DATA


FORM OBJ_EXIST_CHECK .

  CLEAR OBJEXIST.

  CALL FUNCTION 'CHECK_EXIST'
    EXPORTING
      I_TADIR              = TADIR
    IMPORTING
      E_EXIST              = OBJEXIST
    EXCEPTIONS
      TR_NO_CHECK_FUNCTION = 1
      OTHERS               = 2.
  IF SY-SUBRC <> 0.
*    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


ENDFORM.                    " OBJ_EXIST_CHECK

Remember the code above is just to give you an idea on how to build your own tool. If you have any issues feel free to let me know.

Cheers

VJ

Former Member
0 Kudos

Hi,

AP try to look up into NAST and NACH tables to find the used output types. Not all output types defined in youe system might be really used, Use this tables to identify which ones are recently used.

If you want to look up for other report and programs look at table TADIR, TFDIR, TRDIR and MODSAP tables where you can find out all the custom objects.

Take a look at the CROSS table this is a very very usefull tool for upgrade projects. This helps to identify the dependent objects for any custom development.

Take a look at the program RSDEPEND.

You can find all SAP programs modified in your company in table SMODILOG table.

Let me know if you want to know how to use them.

Cheers

VJ

Message was edited by: Vijayendra Rao

0 Kudos

Can you please write how should I proceed to prepare the custom object list.

Like start from TADIR ...

I want all custom reports, Interfaces, forms/scripts, extensions.

How can I use all the tables and reports in systematic fashion.

Thank you very much.

AP

0 Kudos

Hi,

Did u get an idea with the above code? I hope the logic is very simple and not that complex.

If you need more info let me know.

Cheers

VJ

0 Kudos

Can you paste complete code?

Thank you,

AP..

Message was edited by: AP

0 Kudos

Hi AP,

I have copied few more lines. The rest of the portion in my program is very specific to our organization and i cant share the entire program as its against our policy to do so.

I am sure you should be able to take it forward from here.

1). Define selection screen

2). Based on the selection screen define the where clause.

3). USe the Get_Data form mentioned in my earlier post to get the basic data

4). USe the PROCESS_DATA form to process your data.

( the code is attached )

5). Write your report output.

FORM PROCESS_DATA .

  DATA : COUNT TYPE I,
         PNAME LIKE TFDIR-PNAME,
         RNAME LIKE TRDIR-NAME,
         WA_DNAM LIKE TDCT-DNAM.         " Dialogue Module

  DATA : LEN TYPE I,
         WA_MCONAME LIKE DD23T-MCONAME.


  TABLES : TFDIR, TRDIR.

  DATA LOC_TAB LIKE ITAB OCCURS 0 WITH HEADER LINE.
  DATA ITAB_MAIN LIKE ITAB OCCURS 0 WITH HEADER LINE.



* Get FMs for Function Group
  LOOP AT ITAB WHERE OBJECT EQ 'FUGR'
           AND DEVCLASS IN SDEV.
    CLEAR : PNAME.
    CONCATENATE 'SAPL' ITAB-OBJ_NAME INTO PNAME.
    CONDENSE PNAME.
    SELECT * FROM TFDIR WHERE PNAME EQ PNAME.
      CLEAR TADIR.
      MOVE : 'LIMU' TO TADIR-PGMID,
             'FUNC' TO TADIR-OBJECT,
             TFDIR-FUNCNAME TO TADIR-OBJ_NAME,
             ITAB-DEVCLASS TO TADIR-DEVCLASS.
      PERFORM OBJ_EXIST_CHECK.
      CLEAR OBJEXIST.
      IF OBJEXIST EQ 'X'.
        CLEAR : LOC_TAB, RNAME, TRDIR.
        CONCATENATE 'L' ITAB-OBJ_NAME 'U' TFDIR-INCLUDE INTO RNAME.
        CONDENSE RNAME.
        SELECT SINGLE * FROM TRDIR WHERE NAME EQ RNAME.
        MOVE-CORRESPONDING TADIR TO LOC_TAB.
        MOVE TRDIR-UNAM TO LOC_TAB-AUTHOR.
        MOVE ITAB-SRCSYSTEM TO LOC_TAB-SRCSYSTEM.
        IF TRDIR-UDAT EQ SPACE.
          MOVE TRDIR-CDAT TO LOC_TAB-LCDATE.
        ELSE.
          MOVE TRDIR-UDAT TO LOC_TAB-LCDATE.
        ENDIF.
        APPEND LOC_TAB.
      ENDIF.
    ENDSELECT.
  ENDLOOP.

* Link Higher level Objects.

* Sub Objects of Dialogue Module 'DIAL'.
  LOOP AT ITAB_MAIN WHERE OBJECT EQ 'DIAL'
           AND DEVCLASS IN SDEV.
    CLEAR WA_DNAM.
    MOVE ITAB_MAIN-OBJ_NAME TO WA_DNAM.
    CLEAR PNAME.
    SELECT SINGLE PROG INTO PNAME FROM TDCT
       WHERE DNAM EQ WA_DNAM.

    READ TABLE ITAB WITH KEY PGMID = 'R3TR'
                                OBJECT = 'PROG'
                                OBJ_NAME = PNAME.
    IF SY-SUBRC EQ 0.
      MOVE ITAB_MAIN-REFOBNUM TO ITAB-HLOBNUM .
      MODIFY ITAB INDEX SY-TABIX.
    ENDIF.
  ENDLOOP.


* Match Code Objects -> Match Code ID

  LOOP AT ITAB WHERE OBJECT EQ 'MCID'
           AND DEVCLASS IN SDEV.
    LEN = STRLEN( ITAB-OBJ_NAME ).
*    DESCRIBE FIELD ITAB-OBJ_NAME LENGTH LEN .
    LEN = LEN - 1.
    WA_MCONAME = ITAB-OBJ_NAME(LEN).
    READ TABLE ITAB_MAIN WITH KEY PGMID = 'R3TR'
                               OBJECT = 'MCOB'
                               OBJ_NAME = WA_MCONAME.
    IF SY-SUBRC EQ 0.
      MOVE ITAB_MAIN-REFOBNUM TO ITAB-HLOBNUM .
      MODIFY ITAB .
    ENDIF.
  ENDLOOP.

* Include Programs.
  LOOP AT ITAB WHERE OBJECT EQ 'PROG'
                     AND HLOBNUM EQ SPACE
                     .
    CHECK ITAB-DEVCLASS IN SDEV.
    CLEAR RNAME.
    SELECT SINGLE MASTER INTO RNAME FROM D010INC
     WHERE INCLUDE = ITAB-OBJ_NAME.
    CHECK SY-SUBRC EQ 0.

    IF RNAME(4) EQ 'SAPL'.                " Function Group
      MOVE RNAME+4 TO PNAME.
      READ TABLE ITAB_MAIN WITH KEY PGMID = 'R3TR'
                                    OBJECT = 'FUGR'
                                    OBJ_NAME = PNAME.
      IF SY-SUBRC EQ 0.
        MOVE ITAB_MAIN-REFOBNUM TO ITAB-HLOBNUM .
        MODIFY ITAB .
      ENDIF.
    ELSE.
      READ TABLE ITAB_MAIN WITH KEY PGMID = 'R3TR'
                                    OBJECT = 'PROG'
                                   OBJ_NAME = RNAME.
      IF SY-SUBRC EQ 0.
        MOVE ITAB_MAIN-REFOBNUM TO ITAB-HLOBNUM .
        MODIFY ITAB .
      ENDIF.
    ENDIF.
  ENDLOOP.

* Function Modules.

  LOOP AT ITAB WHERE OBJECT EQ 'FUNC'
           AND DEVCLASS IN SDEV.
    CLEAR : TFDIR, PNAME.
    SELECT SINGLE * FROM TFDIR WHERE FUNCNAME EQ ITAB-OBJ_NAME.
    MOVE TFDIR-PNAME+4 TO PNAME.
    READ TABLE ITAB_MAIN WITH KEY PGMID = 'R3TR'
                                  OBJECT = 'FUGR'
                                  OBJ_NAME = PNAME.
    IF SY-SUBRC EQ 0.
      MOVE ITAB_MAIN-REFOBNUM TO ITAB-HLOBNUM .
      MODIFY ITAB .
    ENDIF.
  ENDLOOP.
ENDFORM.                    " PROCESS_DATA

I hope the above helps

Cheers

VJ

Message was edited by: Vijayendra Rao

0 Kudos

Some more questions:

Will this program give me all the custom objects.

On selection screen do you have OBJECT,OBJ_NAME AND DEVCLASS or r anything more.

For output you use itab table. Is that correct.

THank you,

AP..

Message was edited by: AP

0 Kudos

Can you please paste your data declaration part.

Thank you.

AP

0 Kudos

Hi AP,

Thats rite you have three fields on the selection screen.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS SOBJECT FOR WA_MAIN-OBJECT.
SELECT-OPTIONS SOBJNAME FOR WA_MAIN-OBJ_NAME.
SELECT-OPTIONS SDEV FOR WA_MAIN-DEVCLASS.

There are many more specifc for our use you can enhance as you want for your org.

Data declration is like this

DATA ITAB LIKE TADIR OCCURS 0 WITH HEADER LINE.

DATA ITAB_ERR LIKE TADIR OCCURS 0 WITH HEADER LINE.

VJ

To answer your question. There are minor limitations of the tool.

The tool cannot identify the following custom objects

1). Custom Fonts, Custom Page formats, Custom device types

2). Custom VOFM routines

3). Partner profiles/ ALE Linkages etc

4). Number range objects

5). Customizing objects etc

Cheers

VJ.

If you are ok with the info close the thread if you need any more details let me know.

Message was edited by: Vijayendra Rao

Message was edited by: Vijayendra Rao

0 Kudos

Hi AP,

were u able to come up with a consolidated report to download custom program list (to excell/ any other format)...

kindly share the same over here. even i need to have a list of all the Z prog, FM, user exits, BADIs that were developed before...

Debs

0 Kudos

Hi,

Check this code :

DATA : BEGIN OF i_tadir OCCURS 0,

object LIKE tadir-object,

obj_name LIKE tadir-obj_name,

devclass LIKE tadir-devclass,

END OF i_tadir.

SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.

PARAMETERS: p_dev LIKE rseux-ck_value OBLIGATORY. "dev class

SELECTION-SCREEN END OF BLOCK a1.

START-OF-SELECTION.

SELECT object obj_name devclass

FROM tadir

INTO TABLE i_tadir

WHERE devclass = p_dev.

Loop at i_tadir.

write 😕 i_tadir-object ,i_tadir-obj_name

endloop.

<b>if you want includes :</b>

DATA : BEGIN OF i_tadir OCCURS 0,

object LIKE tadir-object,

obj_name LIKE tadir-obj_name,

devclass LIKE tadir-devclass,

END OF i_tadir.

DATA : BEGIN OF i_list_1 OCCURS 0 ,

prnm LIKE rs38m-programm,

END OF i_list_1.

DATA : BEGIN OF i_list OCCURS 0 ,

prnm LIKE rs38m-programm,

END OF i_list.

SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.

PARAMETERS: p_dev LIKE rseux-ck_value OBLIGATORY. "dev class

SELECTION-SCREEN END OF BLOCK a1.

START-OF-SELECTION.

SELECT object obj_name devclass

FROM tadir

INTO TABLE i_tadir

WHERE devclass = p_dev.

IF NOT i_tadir[] IS INITIAL.

LOOP AT i_tadir.

i_list_1-prnm = i_tadir-obj_name.

APPEND i_list_1.

ENDLOOP.

ENDIF.

LOOP AT i_list_1.

i_list = i_list_1-prnm.

APPEND i_list.

CLEAR :i_list.

REFRESH :i_list.

*get the list of includes

CALL FUNCTION 'GET_INCLUDETAB'

EXPORTING

progname = i_list_1-prnm

TABLES

incltab = i_list.

LOOP AT i_list.

i_list = i_list_1-prnm.

APPEND i_list.

ENDLOOP.

ENDLOOP.

Loop at i_list.

write 😕 i_list-prnm

endloop.

Regards

Appana

Message was edited by: L Appana