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 check if function module exist

Former Member
0 Likes
9,710

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,811

OM_FUNC_MODULE_EXIST

is a FM which does it.

Regards,

ravi

8 REPLIES 8
Read only

Former Member
0 Likes
3,812

OM_FUNC_MODULE_EXIST

is a FM which does it.

Regards,

ravi

Read only

Former Member
0 Likes
3,811

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

Read only

Former Member
0 Likes
3,811

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

Read only

Former Member
0 Likes
3,811

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

Read only

Former Member
0 Likes
3,811

Hi,

U can check it in table <b>tfdir</b>.

Rgds,

Prakash

Read only

Former Member
0 Likes
3,811

Hi,

Check tfdir table.

Regards

Amole

Read only

Former Member
0 Likes
3,811

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.

Read only

Former Member
0 Likes
3,811

CALL FUNCTION 'FUNCTION_EXISTS'

               EXPORTING

                 funcname                 = ls_mapping-function

*         IMPORTING

*           GROUP                    =

*           INCLUDE                  =

*           NAMESPACE                =

*           STR_AREA                 =

              EXCEPTIONS

                function_not_exist       = 1

                OTHERS                   = 2