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

Dynamic parameters in function module

Former Member
0 Likes
946

Hi. I need to write a program that can call various different function modules based on what the user inputs.

For example, if the user chooses "BAPI_USER_GET_DETAIL" I need to then call that function module. There is a list of about 30 functions they can choose from.

I can read in the function interface using FUNCTION_IMPORT_INTERFACE and have got the import, changing and tables parameters being entered in an editable ALV.

Now I just need to work out how to call the function module.

I could spend ages hard coding all the various combinations, but what I would like to do is call the function totally dynamically.

I know this wouldn't work, but this sort of thing:

CALL FUNCTION p_funct

EXPORTING

<imp_1> = <val_1>

<imp_2> = <val_2>.

Has anyone got any ideas?

Thanks a lot,

Dave.

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
832

You can have a look at my reply here

4 REPLIES 4
Read only

kesavadas_thekkillath
Active Contributor
833

You can have a look at my reply here

Read only

ThomasZloch
Active Contributor
0 Likes
832

What release are you working with? I think from 6.10 the options PARAMETER-TABLE and EXCEPTION-TABLE were added to the CALL FUNCTION statement for such purposes.

As always, ABAP F1 help has the details.

Thomas

Read only

0 Likes
832

Heh, You guys are quick and here i was debugging how the 'Pattern' button pop up dialogue calls an FM... Sheesh .

Read only

0 Likes
832

Hi. I think you've solved it, thanks a lot.

Just checking it all now, will be back shortly.

Can't believe it was that simple, spent ages looking through SDN and google. I was searching for dynamic function, not bapi, so I missed that posting too.

Regards,

Dave.