‎2012 Mar 09 11:12 AM
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.
‎2012 Mar 09 11:28 AM
‎2012 Mar 09 11:28 AM
‎2012 Mar 09 11:30 AM
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
‎2012 Mar 09 11:35 AM
Heh, You guys are quick and here i was debugging how the 'Pattern' button pop up dialogue calls an FM... Sheesh .
‎2012 Mar 09 11:55 AM
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.