‎2008 Aug 14 3:17 PM
Hi everyone,
As per the requirement, I need to build a program which will list down all custom objects (tables, data element, domain, function module & etc) in a given program.
Could you please tell which is optimized way to write the program and which are the tables/function modules I need to use.
Thanks in advance.
Regards,
Balaji Viswanath.
‎2008 Aug 14 3:38 PM
Look at function modules of function group [SEUA|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=seua&adv=false&sortby=cm_rnd_rankvalue].. This group cover the "Where used" functionnality in developper workbench.
To identify "Customs object", select development classes with Namespace /0CUST/.
Regards
‎2008 Aug 14 3:21 PM
‎2008 Aug 14 3:27 PM
hi ,
you can find lots of program here
http://www.guidancetech.com/people/holland/sap/abap/
Program to list all sap tables
REPORT ZZBGS044 MESSAGE-ID Z1 LINE-COUNT 65 LINE-SIZE 132
NO STANDARD PAGE HEADING.
*----
*
Description: This program list all tables in regards to the *
selection criteria. *
*
Customizing: You need not to make any customizing to use this program*
*
Change of You only have to check that tables, functions and *
release: includes till exists. Bedst just to check and run the *
program. *
*
Programmer: Benny G. Sørensen *
Date: July 1995 *
*
SAP R/3 2.2F *
*----
Corrections----
*
Date Userid Correction *
xx-xx-xxxx xxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx *
*----
*
TABLES: DD02V "SAP tables view
.
DATA: BEGIN OF DYNTAB OCCURS 2000.
INCLUDE STRUCTURE BDCDATA.
DATA: END OF DYNTAB.
DATA: BEGIN OF TABLES OCCURS 100.
INCLUDE STRUCTURE DD02V.
DATA: END OF TABLES.
DATA: L TYPE I,
REPL(30) TYPE C VALUE '????????????????????????????'.
FIELD-SYMBOLS:
.
PARAMETERS:
TABLE(30) TYPE C,
TITLE(74) TYPE C LOWER CASE DEFAULT ' ',
DOWNLOAD(1) TYPE C DEFAULT ' ',
FILENAME(65) TYPE C DEFAULT 'c:SAPDOC?',
EXCEPT(30) TYPE C DEFAULT ' '.
START-OF-SELECTION.
IF TABLE = ''.
TABLE = '*' .
ENDIF.
IF TITLE = ''.
TITLE = '*' .
ENDIF.
TRANSLATE TABLE USING '*%'.
TRANSLATE TITLE USING '*%'.
CONDENSE EXCEPT NO-GAPS.
L = STRLEN( EXCEPT ).
IF L > 0.
ASSIGN REPL(L) TO
.
ENDIF.
SELECT * FROM DD02V INTO TABLES
WHERE DDLANGUAGE = SY-LANGU
AND TABNAME LIKE TABLE
AND DDTEXT LIKE TITLE.
HIDE DD02V-TABNAME.
IF EXCEPT NE ''.
REPLACE EXCEPT LENGTH L WITH
INTO TABLES-TABNAME.
ENDIF.
TRANSLATE TABLE USING '% '.
CONDENSE TABLE NO-GAPS.
IF TABLES-TABNAME CS TABLE.
WRITE:/ TABLES-TABNAME, ' ', TABLES-DDTEXT.
APPEND TABLES.
ENDIF.
ENDSELECT.
IF DOWNLOAD NE ''.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
FILENAME = FILENAME
FILETYPE = 'WK1' "ASC, WK1, DBF, DAT, bin
TABLES
DATA_TAB = TABLES.
ENDIF.
AT LINE-SELECTION.
SET PARAMETER ID 'DOB' FIELD SY-LISEL(30) .
CALL TRANSACTION 'SE12' AND SKIP FIRST SCREEN.
AT PF8.
CHECK SY-LISEL <>
''.
SET PARAMETER ID 'DTB' FIELD SY-LISEL(10) .
REFRESH DYNTAB.
PERFORM DYNPRO USING:
'X' 'SAPMSTAZ' '0100' "Selection screen
,' ' 'DD02V-TABNAME' SY-LISEL(10).
CALL TRANSACTION 'SE16' USING DYNTAB MODE 'A' .
FORM DYNPRO USING DYNBEGIN NAME VALUE.
IF DYNBEGIN = 'X'.
CLEAR DYNTAB.
MOVE : NAME TO DYNTAB-PROGRAM,
VALUE TO DYNTAB-DYNPRO,
DYNBEGIN TO DYNTAB-DYNBEGIN.
APPEND DYNTAB.
ELSE.
CLEAR DYNTAB.
MOVE: NAME TO DYNTAB-FNAM,
VALUE TO DYNTAB-FVAL.
APPEND DYNTAB.
ENDIF.
ENDFORM.
Yogesh N
‎2008 Aug 14 3:38 PM
Look at function modules of function group [SEUA|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=seua&adv=false&sortby=cm_rnd_rankvalue].. This group cover the "Where used" functionnality in developper workbench.
To identify "Customs object", select development classes with Namespace /0CUST/.
Regards
‎2008 Aug 14 3:49 PM
Hi Balaji,
In program Use the Table TADIR which is Directory for Repository objects
In that specify the PGMID as R3TR and OBJ_NAME as Y* and Z*.
if you write a select query on those conditions then you will get the list of custom developed objects..
Before that check the table entries of table TADIR based on the conditions
You can also check these threads for sample code...
Hope this would help you.
Good luck
Narin
‎2008 Aug 18 1:08 PM
Hi Narin,
Thanks for your reply, just want to clarify that your answer and the link you had refered deals with finding the custom object in a system. Whereas my question is how to find custom object in a given program. We have completed the activity of finding all custom objects in the system, whereas now to determine the complexity of each program (one of the factor) is to find out the custom objects within the custom program. Obviously we can go inside the program and find out the custom objects (i.e. custom table, data element, domain & etc) used, since no. of custom programs are more we're trying to get it through program.
Regards,
Balaji Viswanath.
‎2008 Aug 18 1:26 PM
Hi,
Is there any certain format followed in certain format if so...
Use READ REPORT <param> statement.
PARAMETER:
p_repid like sy-repid.
READ REPORT p_repid.
IF SY_SUBRC EQ 0.
search for the format of the string of custom object
like parameters as i defined like 'p_' and so on...
ENDIF.
For any clarifications revert back.
Good luck
Narin
‎2008 Aug 18 1:50 PM
Hi Narin,
Thanks again for your reply.
Not sure how READ REPORT work for function pool/module/class methods. Also as per the requirement we want to get the list of nth object. i.e. if we found custom data element then we want to drill down and find whether it's using custom domain (in case it uses custom domain). Is there any other way/approach than scanning the program for certian pattern(since it doesn't sounds fool-proof). For example I am looking for something like SE80 where it list all objects used in the program (again it doesn't list function modules used whereas we want that also).
Regards,
Balaji Viswanath.
‎2011 Nov 04 10:58 AM
If you want to find the repository objects that are included a particular parent object (i.e. all repositoy objects declarations in a program) then use the function module
REPOSITORY_ENVIRONMENT_RFC
do 28 times.
assign component sy-index of structure ls_envi_types to <fs_char>.
<fs_char> = 'X'.
enddo.
CALL FUNCTION 'REPOSITORY_ENVIRONMENT_RFC'
EXPORTING
OBJ_TYPE = lv_obj_type
ENVIRONMENT_TYPES = ls_envi_types
OBJECT_NAME = lv_obj_name
TABLES
ENVIRONMENT_TAB = lt_info_envi
* SOURCE_OBJECTS =
Pass the object type (e.g. OBJ_TYPE = PROG), object name (e.g. OBJECT_NAME = program name) and populate the ENVIRONMENT_TYPES with the markers (X) for the object types that you want returned, in this case you probably want all.
ENVIRONMENT_TAB then returns the child objects (data elements, domains etc.) that are declared n the program. Check the source system owner for each of these objects will then tell you whether they are SAP or custom.