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 calling of Function Modules

Former Member
0 Likes
1,118

Hi,

I have the requirement that I have to call the Function Modules dynamcally in my program. i m creating 9 function modules in my developemt and I m maintaining all this function modules in one of the custom table I m creating whicth the part of development please help me.

Thanks&Regards

Uday Kiran

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
899

check

link:[Calling function modules dynamically|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/840ad679-0601-0010-cd8e-9989fd650822#q-29]

8 REPLIES 8
Read only

Former Member
0 Likes
899

SE38

CTRL+F8

Call function

press enter

select abap statement

READ.

It is all yes all explained in there on how to call a function module either with literal 'bladibla' or through a variable.

Kind regards, Rob Dielemans

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
899

Pass a variable as func name and this can be fileld from your custom table.

data: ld_funcname TYPE string.

call fundtion 'func_name'.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
899

Hello guys,

I also thought this question credited a STFW

But a slight thought & i changed my mind. If the interface params for all the FMs in the custom table are same, then the question merits an STFW.

But what if the interface params are diff ? How do we handle this situation ?

BR,

Suhas

Read only

0 Likes
899

Hi Suhas,

what about declaring the signatures as reference types ?

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
899

>

> what about declaring the signatures as reference types ?

Hi Keshav,

Which means at the end of the day all the FMs need to have the same interface if i am not mistaken. Please correct me if i am wrong.

How the OP handles this depends on this business requirements.

BR,

Suhas

Read only

0 Likes
899

Hi Suhas,

The reference types will not be applicable as you said,

what i think is the abap_func_parmbind in type pool abap is use.

just by appending all the signatures into it

and the passing it to a fm created.

check the standard include LV69AF21, how the fm's PRICING_SUBSCREEN_PBO and PRICING_SUBSCREEN_PAI gets called.

The signatures in each fm are different.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
900

check

link:[Calling function modules dynamically|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/840ad679-0601-0010-cd8e-9989fd650822#q-29]

Read only

0 Likes
899

Hello Keshav,

But from which table you get the FM parameters. TFDIR does not help.

BR,

Suhas

PS: I may sound dumb, but i did not google / search in SDN. So please bear with my ignorance