‎2006 Jun 22 11:23 AM
Hi All!
Does anyone know how to check if function module, which name is provided by the user, exists?
I have to execute a function but when user provides a incrrect name - i receive a short dump. I would like to chceck if this function exists before execution and if not - warn user with message box.
Thanks
Tomek
‎2006 Jun 22 11:24 AM
‎2006 Jun 22 11:24 AM
‎2006 Jun 22 11:26 AM
Hai
Check the following
<b>Go to SE80 & Give Program Name
it will shows all the objects List for the Program
then check if Function Module Exist or not</b>
Go to se93 and give the tcode to find the main program associated to it.
Go to se38 and give the main program.
Find the package associated to it.Go to->Object Directory Entry.
Go to smod transaction.
Press f4.
Press Information System Button.
Give the Project(Dev Class).
Press enter.
Find the enhancements associated
Thanks & regards
Sreeni
‎2006 Jun 22 11:26 AM
SELECT SINGLE * FROM tfdir INTO v_funcname WHERE funcname = function_module.
if sy-subrc <> 0.
*function module dose not exist.
endif.
Message was edited by: Chandrasekhar Jagarlamudi
‎2006 Jun 22 11:28 AM
Hi,
u can check this table: tfdir
try like this:
SELECT SINGLE * FROM tfdir INTO tfdir_info
WHERE funcname = function_module.
IF sy-subrc <> 0.
error message.
ENDIF.
rgds,
latheesh
Message was edited by: Latheesh Kaduthara
‎2006 Jun 22 11:30 AM
‎2006 Jun 22 11:30 AM
‎2006 Jun 22 11:38 AM
REPORT z_tmtest MESSAGE-ID zz.
PARAMETER: a_fname LIKE tfdir-funcname.
PERFORM test_fun_exist USING a_fname.
----
FORM test_fun_exist *
----
Test FM Exists
----
FORM test_fun_exist USING f_funcname LIKE tfdir-funcname.
CALL FUNCTION 'OM_FUNC_MODULE_EXIST'
EXPORTING
function_module = f_funcname
EXCEPTIONS
not_existent = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e001.
ENDIF.
ENDFORM.
‎2016 Apr 26 11:39 PM
CALL FUNCTION 'FUNCTION_EXISTS'
EXPORTING
funcname = ls_mapping-function
* IMPORTING
* GROUP =
* INCLUDE =
* NAMESPACE =
* STR_AREA =
EXCEPTIONS
function_not_exist = 1
OTHERS = 2