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

Automated interface analysis

Former Member
0 Likes
1,002

Hello,

I would like to analyze the interfaces of function modules or classes automatically. Somehow like runtime time identification (cl_abap_*descr) for function modules or classes.

Concerning function modules I'm thinking of a method looking like this:

param_tab = cl_fm_analysis( fm_name = 'function_module_name' )

It should return a table of parameter names and corresponding types:

name    | param_type | data_type
--------+------------+----------
name    | importing  | string
surname | importing  | string
age     | exporting  | i

for example.

In the case of class analysis things are a bit more difficult. Maybe one needs to read all method names first and then get the description of a single method of a specific class in the same way as mentioned above for a function module.

Any ideas on how to achieve this - maybe there's already some code provided by SAP ?

Thanks in advance and best regards,

Patrick Baer

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
871

Hello Patrick,

There's a table called FUPARAREF. Just take a look at it and you're through with Function Modules.

Take a look at the Database view VSEOMEPARA (and the corresponding join tables, if required ) and you're through with the Classes as well.

Is this what you're looking for? If yes, then please reward points and mark the thread as answered. Else, please get back with any additional information you might require.

Regards,

Anand Mandalika.

7 REPLIES 7
Read only

Former Member
0 Likes
872

Hello Patrick,

There's a table called FUPARAREF. Just take a look at it and you're through with Function Modules.

Take a look at the Database view VSEOMEPARA (and the corresponding join tables, if required ) and you're through with the Classes as well.

Is this what you're looking for? If yes, then please reward points and mark the thread as answered. Else, please get back with any additional information you might require.

Regards,

Anand Mandalika.

Read only

0 Likes
871

Anand,

thanks for your answer. What I intended to do is certainly realizable with the tables / views you provided. I'm still wondering if there comes any kind of program predefined by SAP that accomplishes the task (similar to the RTTI classes).

Best regards,

Patrick Baer

Read only

0 Likes
871

Hello Patrick,

As far as I understand, the information that you are trying to obtain is actually static. It is NOT dynamic.

Let us say we have a class called CL_GUI_ALV_GRID. This class is already defined in the class library and the information is available in the database in the relevant tables. And the definition of the interface parameters cannot change at runtime!!

With too much of talk about making things more <i>dynamic</i> and <i>generic</i>, I understand that it is easier to get carried away by it. But in this case, you do not really need RTTI, because the type is known at compile time itself.

Hope you see the point.

Regards,

Anand Mandalika.

Regards,

Anand Mandalika.

Read only

0 Likes
871

Anand,

certainly RTTI has been a bad example because it is in fact giving dynamic information whereas the information I want to retrieve is static.

So I can clearly see your point and you are right.

But I intenend to ask a different thing:

just the question if there is some kind of program already provided by SAP (function module, class, whatever) that realizes the functionality described in my initial posting. Very likely this would even be based on the tables and views you proposed to use - it's just like I don't want to build something that already exists.

Best regards,

Patrick Baer

Read only

0 Likes
871

Hi Patrick,

here's a method, which analyzes function modules:

METHOD: <b>cl_fb_parameter_db=>read</b>

regards Andreas

Read only

0 Likes
871

Hi,

Further to Andreas' suggestion, You could try out the CL_OO* classes for getting the information on the Class components.

Regards,

Anand Mandalika.

Read only

0 Likes
871

Thanks to both of you Andreas and Anand !

I will use the classes you suggested.

Sorry I could award only one of you with "Solved Problem" - you deserved it both. But Anand you got a total of 12 points in this thread through two very helpful answers which should be sufficient as well

Best regards,

Patrick Baer