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

how to execute function module dynamically

Former Member
0 Likes
654

Hi, I have list of function modules in internal table and I have to execute function modules one after the other. Could anyone please advice how can we execute FM dynamically/how to execute FM one by one.

Thanks in advance.

4 REPLIES 4
Read only

ThomasZloch
Active Contributor
0 Likes
562

See ABAP online docu for the CALL FUNCTION statement, the name can be passed dynamically inside a loop at your internal table.

All function modules should have the same interface, otherwise things would become very complex or ugly.

Thomas

Read only

awin_prabhu
Active Contributor
0 Likes
562

Hi

check below code.

REPORT zdemo.

DATA: BEGIN OF itab OCCURS 0,

name TYPE string,

END OF itab,

wa LIKE itab.

wa-name = 'GUI_RUN'. <-- FM1 name

APPEND wa TO itab.

wa-name = 'GUI_DOWNLOAD'. <-- FM2 name

APPEND wa TO itab.

LOOP AT itab INTO wa.

CASE wa-name.

WHEN 'GUI_RUN'. <-- Call FM1

CALL FUNCTION 'GUI_RUN'

EXPORTING

command = 'cmd'.

WHEN 'GUI_DOWNLOAD'. <-- Call FM2

-code-

ENDCASE.

ENDLOOP.

Edited by: Sap Fan on Mar 20, 2009 4:11 PM

Read only

Former Member
0 Likes
562

check source code LRWCLF01 line 535.

Read only

Former Member
0 Likes
562

Use BDC ( call transaction).

Edited by: BrightSide on Mar 20, 2009 3:17 PM