Search code examples
abapbapifunction-module

Handling function module interfaces in bulk?


Is there a way to access the import parameters passed into a function module without addressing them individually? Does ABAP store them in some internal table, so I can work with them by looping through rows in some table, or fields of a structure?

We can use the PATTERN function, knowing only the function module's name, to have ABAP print out the function module's interface for us, so I'm wondering where this information is stored and if I can work with it once the function group has been loaded into memory.

Thanks in advance!


Solution

  • You can use the function module RPY_FUNCTIONMODULE_READ to obtain information about the parameter structure of a function module and then access the parameters dynamically. This has several drawbacks - most noticeably, the user doing so will need (additional) S_DEVELOP authorizations, and logging this way will usually impose a serious performance impact.

    I'd rather add the function module parameters to the logging/tracing function manually once - with a sufficiently generic method call, it's not that difficult. I also tend to group individual parameters into structures to facilitate later enhancements.