2009 Feb 03 5:23 PM
Hi All,
Can anyone tell me how can I list down various objects used in a program.
For example in a report program if I am calling a function module, calling an include program, implementing a class and so on. Now I want to list down the objects used in the above program.
Thanks in advance,
Venkat
2009 Feb 03 6:01 PM
I would have doubts that this exists, however, wouldn't be to bad to write one yourself.
You can use
READ REPORT prog INTO itab.
To get the source of a program and then use SEARCH for each verb you're looking for. Be sure
to change the case to lower or upper to match your search string.
Then again.. SE80 shows most of what you mentioned.
Edited by: Paul Chapman on Feb 3, 2009 1:01 PM
2009 Feb 03 6:08 PM
I dont have sap system to give u exact answer but do like this->
RPY_PROGRAM_READ
this fm will give u source code in an internal table, u can use this.
besided this, check other FM's in its function group they all serve nearly identical purpose close to requirement.
the function group has fms to read fms, includes etc
also check this
RS_GET_ALL_INCLUDES
кu03B1ятu03B9к
Edited by: kartik tarla on Feb 3, 2009 11:44 PM
2009 Feb 03 6:19 PM
This can get you started.
DATA:
code_rec(132),
itab LIKE STANDARD TABLE OF code_rec.
DATA:
obj_text(40),
it_search LIKE STANDARD TABLE OF obj_text.
PARAMETERS:
prog TYPE sobj_name.
START-OF-SELECTION.
PERFORM search_table.
REFRESH itab.
READ REPORT prog INTO itab.
CHECK sy-subrc = 0.
LOOP AT itab INTO code_rec.
TRANSLATE code_rec TO UPPER CASE.
LOOP AT it_search INTO obj_text.
SEARCH code_rec FOR obj_text.
CHECK sy-subrc EQ 0.
WRITE:/ 'Found ', obj_text, 'in', code_rec.
ENDLOOP.
ENDLOOP.
*&---------------------------------------------------------------------*
*& Form search_table
*&---------------------------------------------------------------------*
FORM search_table.
REFRESH it_search.
PERFORM add_a_search USING 'CALL FUNCTION'.
ENDFORM. " search_table
*&---------------------------------------------------------------------*
*& Form add_a_search
*&---------------------------------------------------------------------*
FORM add_a_search USING p_text.
obj_text = p_text.
TRANSLATE obj_text TO UPPER CASE.
APPEND obj_text TO it_search.
ENDFORM. " add_a_search
2009 Feb 03 6:53 PM
2009 Feb 04 9:55 AM
2009 Feb 04 11:06 AM
Thanks for all your useful inputs.
My question exactly means is there any program/function module/standard tool to list down various includes, function modules and so on used in a program. I don't want to download the source code and search whether it contains a function module or include in it. I want the list of objects in a single shot.
Please help.
Venkat