Application Development 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: 

RFC access to Function Module metadata

Former Member
0 Kudos
1,421

I'm looking for an API that will allow my program to:

1. Get a list of RFC-callable BAPIs available in my R/3 system.

2. Get all the metadata for a particular BAPI. I.e. the list of all the imports, exports and tables and their descriptions.

Are there standard SAP function modules that perform either of these tasks?

What I want to do with task 2 is generate the logic to call the BAPI within my own GUI, and not require my user to go to the SAP GUI and, say, generate an skeleton RFC C program.

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
318

Don't know if there is a standard function module. But you can build your own. You just need to read the FUPARAREF table to get the importing/exporting parameters. And the TFDIR table to check if its an RFC.

Regards,

Rich Heilman

3 REPLIES 3

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
319

Don't know if there is a standard function module. But you can build your own. You just need to read the FUPARAREF table to get the importing/exporting parameters. And the TFDIR table to check if its an RFC.

Regards,

Rich Heilman

andreas_mann3
Active Contributor
0 Kudos
318

hi,

use class CL_FUNCTION_BUILDER_DATA

Andreas

0 Kudos
318

Here is some sample code to retreive these values from database, implement this code in a custom RFC enabled function module.




report zrich_0002.


data: xattributes type tfdir.
data: isignature type table of fupararef with header line.


parameters: p_func type tfdir-funcname.


select single * from tfdir into xattributes
             where funcname = p_func.

select * into table isignature from fupararef
             where funcname = p_func.


write:/ xattributes-funcname, xattributes-fmode.

skip 1.

loop at isignature.

  write:/ isignature-parameter,
          isignature-paramtype,
          isignature-structure,
          isignature-defaultval.

endloop.

Please remember to award points for helpful answers and mark your post as solved when solved completely. Thanks.

REgards,

Rich Heilman