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: 

Call Fm dynamically

Former Member
0 Kudos

Hi all,

I am using FP_FUNCTION_MODULE_NAME fm to get a fm name of a Interactive/PDF form.

I want to know that when i get this FM name how to call it dynamically.

Points will be sured for valuable answers.

Thanks

Sanket sethi

5 REPLIES 5

Former Member
0 Kudos

use

call function fm_name

where fm_name will be the function module name u got

0 Kudos

But i don't call FM name at runtime meanwhile we can get fm

Name into a variable so that we can use any other palce.

Suggst where we can call this one.

former_member705122
Active Contributor
0 Kudos

Hi,

Check this:

CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name = pa_form
IMPORTING
e_funcname = fm_name.

Call function module FP_FUNCTION_MODULE_NAME and pass the form

name to it. You will receive parameter e__funcname, which will contain the name

of the generated function module.

Parameter fm_name will automatically contain the name of the appropriate generated function module.Since this generated function module is always called dynamically, no changes in the application program are necessary.

Regards

Adil

former_member188685
Active Contributor
0 Kudos

Step 1

Execute your Adobe Form in SFP transaction, there it will give the function module, take that function name.

now in your Driver program first call the function FP_FUNCTION_MODULE_NAME for this pass the formname, you will get the function name.

step2

CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'

EXPORTING

i_name = form_name

IMPORTING

e_funcname = lv_function.

step3

now call the function using the pattern with the name from step1.

pass all required parameters.

HemendraS
Participant
0 Kudos

Data: LV_FORM_NAME TYPE FPWBFORMNAME,

LV_FM_NAME TYPE RS38L_FNAM,

FP_TEST_DUMMY TYPE FPINTERFACETYPE.

Now pass the form name in LV_FORM_NAME .

CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'

EXPORTING

I_NAME = LV_FORM_NAME

IMPORTING

E_FUNCNAME = LV_FM_NAME

E_INTERFACE_TYPE = FP_TEST_DUMMY.

U'll get the FM name in LV_FM_NAME.

Now

GS_DOCPARAMS-LANGU = 'E'.

  • GS_DOCPARAMS-COUNTRY = 'US'.

CALL FUNCTION LV_FM_NAME

EXPORTING

/1BCDWB/DOCPARAMS = GS_DOCPARAMS

  • LFA1 = LFA1

  • MBMFKTO_PDF = GT_MFKTO_PDF

IMPORTING

/1BCDWB/FORMOUTPUT = FP_RESULT

EXCEPTIONS

USAGE_ERROR = 1

SYSTEM_ERROR = 2

INTERNAL_ERROR = 3

OTHERS = 4.

Hope this might give answer to U.

Regards

Hemendra.