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 function module call

Former Member
0 Likes
4,661

Hi all,

can anybody suggest me how to handle import, export and tables parameters in a dynamic function module call if they are associated with TABLE types.

1 ACCEPTED SOLUTION
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
4,454

You might be interested in reading this [http://help.sap.com/abapdocu_702/en/abapcall_function_dynamic.htm].

ya by using that FM i did up to now.

but the issue is , can we actually input the table type data at run-time if yes, how is it possible

My intention of calling a dynamic FM, which actually have to run as normal or standard FM but the output should be in CHAR data type

code snippet for your understanding..

IMPORT PARAMETERS

NAME TYPE TFDIR-FUNCNAME

PARAM1 TYPE CHAR30

PARAM2 TYPE CHAR30

EXPORT PARAMS

IT_EXPO1 TYPE THENV

IT_EXPO2 TYPE THENV

TABLES PARAMS

IT_DATA1 LIKE ZSCHAR4500

IT_DATA2 LIKE ZSCHAR4500

EXCEPTIONS

FUNCTION_NOT_FOUND FUNCTION MODULE NOT FOUND

FUNCTION_MODULE_FOUND FUNCTION MODULE FOUND

*CODE

LOOP AT it_import1 INTO wa_import.

ptab_line-name = wa_import-parameter.

ptab_line-kind = abap_func_exporting.

if wa_import-dbfield is not initial.

CREATE DATA dyn_ref TYPE (wa_import-dbfield).

endif.

if wa_import-dbfield is initial.

data w_type1 type c length 30.

w_type1 = wa_import-typ.

CREATE DATA dyn_ref TYPE (w_type1).

endif.

Edited by: sam_samuel on Aug 11, 2011 4:24 PM

Edited by: sam_samuel on Aug 11, 2011 4:30 PM

39 REPLIES 39