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: 

Function module Dynamic call

former_member156446
Active Contributor
0 Kudos

I am trying to make a dynamic call of function, I am fetching data from  fupararef table and making dynamic calls to functions using the below code


*-- Main call

     CALL FUNCTION function

       PARAMETER-TABLE ptab

       EXCEPTION-TABLE etab.

In debug, when I hog into the function the import parameters are blank even though ptab table is filled correct.

The value is being passed as a ref to data. Not sure why the import parameters A and B are blank in the function( its a simple function to add a + b = c.

1 REPLY 1

naimesh_patel
Active Contributor
0 Kudos

Parameter A and B should be passed as EXPORTING (ABAP_FUNC_EXPORTING = 10) in field KIND. I think you are passing that as IMPORTING (ABAP_FUNC_IMPORTING = 20). Parameter C should be IMPORTING (20).

Now, you may ask why it didn't raise an error as those parameter A and B are not defined as EXPORTING in the FM. The reason is - Dynamic FM call ignores all the parameters which don't exist. Read more at - ABAP Call FM Dynamically with Mystery Parameters! | ABAP Help Blog

Regards,
Naimesh Patel