‎2009 Mar 20 3:01 PM
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.
‎2009 Mar 20 3:08 PM
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
‎2009 Mar 20 3:11 PM
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
‎2009 Mar 20 3:15 PM
‎2009 Mar 20 3:16 PM
Use BDC ( call transaction).
Edited by: BrightSide on Mar 20, 2009 3:17 PM