Application Development and Automation 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: 
Read only

How to identify various objects used in code

Former Member
0 Likes
703

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

6 REPLIES 6
Read only

Former Member
0 Likes
668

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

Read only

Former Member
0 Likes
668

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

Read only

Former Member
0 Likes
668

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

Read only

Former Member
0 Likes
668

check the complete program given in this thread

кu03B1ятu03B9к

Read only

Former Member
0 Likes
668

check this FM too

GET_GLOBAL_SYMBOLS

Read only

Former Member
0 Likes
668

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