09-08-2008 10:09 AM
Hi,
I'd like to build a calling tree for a given program (or function module anyway).
Something that tells me wich forms or function modules are called in my program.
Something that gives me a hierarchy :
Program1
-
> FM 1
-
> Form 1
-
> Form 2
-
> FM 2
-
> Form 3
-
> Form 4
-
> Form 5
And so on...
Does such a tool exist ?
Thank you for your help.
Q. Saderne
09-08-2008 10:17 AM
yes, these are function modules which used to display tree
CALL FUNCTION 'RS_TREE_CONSTRUCT'
TABLES
nodetab = t_node
EXCEPTIONS
tree_failure = 1
id_not_found = 2
wrong_relationship = 3
OTHERS = 4.
IF sy-subrc <> 0.
sy-msgty = 'S'.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
STOP.
ENDIF.
CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
EXPORTING
callback_program = 'YH1063_TREETEST'
callback_user_command = 'USER_COMMAND'
callback_top_of_page = 'TOP_OF_PAGE'
callback_gui_status = 'TREE'.
where the sturcture of t_node will be like :
fs_node-name = 'Programs. << label name
fs_node-nlength = 50.
fs_node-color = 1.
fs_node-tlevel = 1. << Level depth
APPEND fs_node TO t_node.
and to know about function modules, forms, tables, symbols etc, one must have the knowledge of SCAN statement
t_node is the table which will contain your actual data.
09-08-2008 10:17 AM
yes, these are function modules which used to display tree
CALL FUNCTION 'RS_TREE_CONSTRUCT'
TABLES
nodetab = t_node
EXCEPTIONS
tree_failure = 1
id_not_found = 2
wrong_relationship = 3
OTHERS = 4.
IF sy-subrc <> 0.
sy-msgty = 'S'.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
STOP.
ENDIF.
CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
EXPORTING
callback_program = 'YH1063_TREETEST'
callback_user_command = 'USER_COMMAND'
callback_top_of_page = 'TOP_OF_PAGE'
callback_gui_status = 'TREE'.
where the sturcture of t_node will be like :
fs_node-name = 'Programs. << label name
fs_node-nlength = 50.
fs_node-color = 1.
fs_node-tlevel = 1. << Level depth
APPEND fs_node TO t_node.
and to know about function modules, forms, tables, symbols etc, one must have the knowledge of SCAN statement
t_node is the table which will contain your actual data.
09-08-2008 10:32 AM
Hi,
Thank you for your answer.
These function modules seems to be used to build a tree.
But what I'm looking at is a tool to build automatically a calling tree.
I mean a tool to which I give the program name, and that answers me the call tree.
Do you know such a tool ?
Thanks anyway.
Q. Saderne
09-08-2008 10:20 AM
I'm not aware of exactly such a program in standard SAP. You could write one using the SCAN keyword, which tokenises ABAP code.
Alternatively, you could use the code inspector, which tells you which components of a program get hit as it is run.
How would you want to handle:
IF condition.
PERFORM myform.
ENDIF.
10-06-2008 4:42 PM
10-06-2008 5:41 PM
10-07-2008 1:40 PM
I work on a large an old project.
This will let us analyze and get a better view of some obscure reports...
And we'd like too to build a reverse tree. That is to say as where-used list, but with a hierarchy. It would help in finding the impacts of some devs.
10-07-2008 2:13 PM
Mmm. I understand. But how will you go about recursive form calls? How will you deal with dynamic calls of forms and/or function modules?
It sounds like a good plan, but i doubt it will be helpful as a tool for analysis. As i see it (admittingly, i don't know what you are planning to program in it) you will only see the calls of functions, forms, modules and nothing more. It would only serve as an overview tool.
10-07-2008 2:44 PM
That's why I was looking for an existing tool, because it's a bit tricky to write...
So at the moment an overview tool is better than nothing
But if you know more about the subject, I'd be glad to learn
10-07-2008 2:57 PM
I don't know the release you work with, but on my system (ECC6) there is the code inspector.
I haven't tried it out with a serious program, but it does some analysis on a program.
10-07-2008 3:57 PM
I know Code Inspector, but certainly not completely.
Have some doc about it ?
How would you use it to get a hierarchy of the routines of the program ?
10-07-2008 3:59 PM
Haven't looked at it myself (in a serious way, only wrote a little trash program and ran CI on it). So on my to do list: check out Code Inspector.