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

Function Module/table which can give the attributes data of function module

Former Member
0 Likes
2,343

i need to find out the data belongs to the attributes of a function module.

ex: normal,remteenabled like that..

i need all the data regarding the attributes of a function module.

regards

sitaram.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,221

Please check table

<b>TFDIR</b>

It contains all that you require

15 REPLIES 15
Read only

Former Member
0 Likes
2,222

Please check table

<b>TFDIR</b>

It contains all that you require

Read only

0 Likes
2,221

i know through TFDIR we can get the attributes,

but how those are coming, through some program only........

i need that program name .........

thank u for u r reply....

Read only

0 Likes
2,221

Please check this FM

<b>/SDF/GEN_FUNCS_FUNC_INFO_GET</b>

Read only

0 Likes
2,221

check whether it exists or not. he re iam not getting it .

not exists is the answer.

thanks and regards

Read only

0 Likes
2,221

FUNCTION_IMPORT_INTERFACE exits in 4.6B , which version r u using

Read only

0 Likes
2,221

Hi

I am in SAP 4.7

Check out this FM

<b>OM_FUNC_MODULE_EXIST</b>

Hope fully it shoudl exist in your system

Read only

0 Likes
2,221

hi this is useful for finding the attributes like iimport and export and all.....----

but my requirement is to find the =============

The function module data like whther it is normal or rfc one...

2nd waht is the program behind it.

ex: function_exists.

here in the attributes tab--two subcategory tabs exist.

1.processing type.---noramal or rfc.

2.general data--package,program name,include name.this is my requirement

this is my requirement.----


input-function module name.

output-rfc or normal

-program name

-include name

Message was edited by:

dasr r

Message was edited by:

dasr r

Read only

0 Likes
2,221

Hi,

If you look in the FM OM_FUNC_MODULE_EXIST

the exporting parameter is TFDIR_INFO

This contains

TFDIR_INFO-PNAME - Program Name

TFDIR_INFO-INCLUDE- Include Name

TFDIR_INFO-FMODE - If RFC value = 'R' if normal then blank

Hope this helps

Read only

0 Likes
2,221

if u want only those 3 fields , then u can write a simple select on TFDIR table

select pname include fmode where funcname = <ur func module name>.

Read only

Former Member
0 Likes
2,221

you can refer the tables TFDIR TFDIRT.

Read only

0 Likes
2,221

i know through TFDIR we can get the attributes,

but how those are coming, through some program only........

i need that program name .........

thank u for u r reply....

Read only

Former Member
0 Likes
2,221
data: begin of exception_list occurs 1.
        include structure  rsexc.
data: end of exception_list.

data: begin of export_param occurs 1.
        include structure  rsexp.
data: end of export_param.

data: begin of import_param occurs 1.
        include structure  rsimp.
data: end of import_param.

data: begin of tables_param occurs 1.
        include structure  rstbl.
data: end of tables_param.

call function 'FUNCTION_IMPORT_INTERFACE'
    exporting
      funcname         = 'REUSE_ALV_GRID_DISPLAY'
    tables
      exception_list   = exception_list
      export_parameter = export_param
      import_parameter = import_param
      tables_parameter = tables_param.
Read only

Former Member
0 Likes
2,221

Hi use function module Function_get

Read only

Former Member
0 Likes
2,221

hi,

TFDIR

santhosh

Read only

Former Member
0 Likes
2,221

This is the code written in Function_get

FUNCTION FUNCTION_GET. "10.07.2003

*"----


*"Globale Schnittstelle:

*" IMPORTING

*" FUNCNAME LIKE TFDIR-FUNCNAME

*" TABLES

*" PRMTAB STRUCTURE CATFU

*" EXCEPTIONS

*" FM_NOT_FOUND

*" NAMETAB_FAULT

*" REF_FIELD_MISSING

*" REF_STRUCTURE_MISSING

*"----


REFRESH: IF_IMPORT, IF_EXPORT, IF_TABLES, IF_EXCEPT, PRMTAB,

IF_CHANGE.

CLEAR: IF_IMPORT, IF_EXPORT, IF_TABLES, IF_EXCEPT, PRMTAB,

IF_CHANGE.

CALL FUNCTION 'FUNCTION_IMPORT_INTERFACE'

EXPORTING

FUNCNAME = FUNCNAME

  • IMPORTING

  • GLOBAL_FLAG = I01

  • REMOTE_CALL = I02

  • UPDATE_TASK = I03

TABLES

EXCEPTION_LIST = IF_EXCEPT

EXPORT_PARAMETER = IF_EXPORT

IMPORT_PARAMETER = IF_IMPORT

CHANGING_PARAMETER = IF_CHANGE

TABLES_PARAMETER = IF_TABLES

EXCEPTIONS

ERROR_MESSAGE = 01

FUNCTION_NOT_FOUND = 02

INVALID_NAME = 03.

IF SY-SUBRC > 0.

RAISE FM_NOT_FOUND.

ENDIF.

PERFORM MOVE_IF_IMPORT.

PERFORM MOVE_IF_CHANGE.

PERFORM MOVE_IF_EXPORT.

PERFORM MOVE_IF_TABLES.

PERFORM MOVE_IF_EXCEPT.

LOOP AT PRMTAB WHERE TABNAME = 'SY '.

PRMTAB-TABNAME = 'SYST'.

MODIFY PRMTAB.

ENDLOOP.

*-- get ddic-information on each field i.e. all im-/export-parameters -*

PERFORM DDIC_INFO_GET_1.

*-- get ddic-information on each field in import/export-structures -


*

PERFORM DDIC_INFO_GET_2.

ENDFUNCTION.

----


  • FORM MOVE_IF_IMPORT *

----


FORM MOVE_IF_IMPORT.

LOOP AT IF_IMPORT.

CLEAR PRMTAB.

PRMTAB-PARAMTYPE = IMPORT.

PRMTAB-NAME = IF_IMPORT-PARAMETER.

IF IF_IMPORT-DBFIELD CA '-'.

ASSIGN IF_IMPORT-DBFIELD(SY-FDPOS) TO <F>.

PRMTAB-TABNAME = <F>.

POSITION = SY-FDPOS + 1.

ASSIGN IF_IMPORT-DBFIELD+POSITION(*) TO <F>.

PRMTAB-FIELDNAME = <F>.

IF PRMTAB-FIELDNAME = SPACE.

PERFORM MOVE_INITIAL.

ENDIF.

PRMTAB-IMPDEFAULT = IF_IMPORT-DEFAULT.

APPEND PRMTAB.

ELSE.

PRMTAB-TABNAME = IF_IMPORT-DBFIELD.

IF PRMTAB-TABNAME = SPACE.

PERFORM MOVE_INITIAL.

PRMTAB-IMPDEFAULT = IF_IMPORT-DEFAULT.

ENDIF.

APPEND PRMTAB.

ENDIF.

ENDLOOP.

ENDFORM.

----


  • FORM MOVE_IF_CHANGE *

----


FORM MOVE_IF_CHANGE.

LOOP AT IF_CHANGE.

CLEAR PRMTAB.

PRMTAB-PARAMTYPE = CHANGE.

PRMTAB-NAME = IF_CHANGE-PARAMETER.

IF IF_CHANGE-DBFIELD CA '-'.

ASSIGN IF_CHANGE-DBFIELD(SY-FDPOS) TO <F>.

PRMTAB-TABNAME = <F>.

POSITION = SY-FDPOS + 1.

ASSIGN IF_CHANGE-DBFIELD+POSITION(*) TO <F>.

PRMTAB-FIELDNAME = <F>.

IF PRMTAB-FIELDNAME = SPACE.

PERFORM MOVE_INITIAL.

PRMTAB-LOWERCASE = SPACE.

ENDIF.

PRMTAB-IMPDEFAULT = IF_CHANGE-DEFAULT.

APPEND PRMTAB.

ELSE.

PRMTAB-TABNAME = IF_CHANGE-DBFIELD.

IF PRMTAB-TABNAME = SPACE.

PERFORM MOVE_INITIAL.

PRMTAB-LOWERCASE = SPACE.

PRMTAB-IMPDEFAULT = IF_CHANGE-DEFAULT.

ENDIF.

APPEND PRMTAB.

ENDIF.

ENDLOOP.

ENDFORM.

----


  • FORM MOVE_IF_EXPORT *

----


FORM MOVE_IF_EXPORT.

LOOP AT IF_EXPORT.

CLEAR PRMTAB.

PRMTAB-PARAMTYPE = EXPORT.

PRMTAB-NAME = IF_EXPORT-PARAMETER.

IF IF_EXPORT-DBFIELD CA '-'.

ASSIGN IF_EXPORT-DBFIELD(SY-FDPOS) TO <F>.

PRMTAB-TABNAME = <F>.

POSITION = SY-FDPOS + 1.

ASSIGN IF_EXPORT-DBFIELD+POSITION(*) TO <F>.

PRMTAB-FIELDNAME = <F>.

IF PRMTAB-FIELDNAME = SPACE.

PERFORM MOVE_INITIAL.

PRMTAB-LOWERCASE = SPACE.

ENDIF.

APPEND PRMTAB.

ELSE.

PRMTAB-TABNAME = IF_EXPORT-DBFIELD.

IF PRMTAB-TABNAME = SPACE.

PERFORM MOVE_INITIAL.

PRMTAB-LOWERCASE = SPACE.

ENDIF.

APPEND PRMTAB.

ENDIF.

ENDLOOP.

ENDFORM.

----


  • FORM MOVE_IF_TABLES *

----


FORM MOVE_IF_TABLES.

LOOP AT IF_TABLES.

CLEAR PRMTAB.

PRMTAB-PARAMTYPE = ITAB.

PRMTAB-NAME = IF_TABLES-PARAMETER.

PRMTAB-TABNAME = IF_TABLES-DBSTRUCT.

IF PRMTAB-TABNAME = SPACE.

PRMTAB-TABNAME = 'RSSOURCE'.

  • RAISE REF_STRUCTURE_MISSING.

ENDIF.

APPEND PRMTAB.

ENDLOOP.

ENDFORM.

----


  • FORM MOVE_IF_EXCEPT *

----


FORM MOVE_IF_EXCEPT.

LOOP AT IF_EXCEPT.

CLEAR PRMTAB.

PRMTAB-PARAMTYPE = EXCEPT.

PRMTAB-NAME = IF_EXCEPT-EXCEPTION.

APPEND PRMTAB.

ENDLOOP.

ENDFORM.

----


  • FORM DDIC_INFO_GET_1 *

----


  • get ddic-info on each each im-/export and itab-field *

----


FORM DDIC_INFO_GET_1.

CLEAR TABNAME_SAVE.

SORT PRMTAB BY TABNAME PARAMTYPE.

COUNT = 0.

READINDEX = 1.

DESCRIBE TABLE PRMTAB LINES COUNT.

WHILE READINDEX <= COUNT.

READ TABLE PRMTAB INDEX READINDEX.

  • CHECK PRMTAB-FIELDNAME <> SPACE.

IF PRMTAB-TABNAME <> SPACE AND PRMTAB-TABNAME <> TABNAME_SAVE.

TABNAME_SAVE = PRMTAB-TABNAME.

PERFORM NAMETAB_GET USING PRMTAB-TABNAME RC.

IF RC = 0 OR RC = 8.

LOOP AT PRMTAB

WHERE TABNAME = TABNAME_SAVE.

IF PRMTAB-TABNAME = 'SYST' AND

PRMTAB-FIELDNAME = 'REPID'.

PRMTAB-DATATYPE = 'CHAR'.

PRMTAB-INTTYPE = 'C'.

PRMTAB-DDLEN = 40.

PRMTAB-INTLEN = 40.

MODIFY PRMTAB.

ELSE.

LOOP AT NAMETAB

WHERE TABNAME = PRMTAB-TABNAME

AND FIELDNAME = PRMTAB-FIELDNAME

AND LANGU = SY-LANGU.

PERFORM MOVE_NAMETAB.

MODIFY PRMTAB.

ENDLOOP.

ENDIF.

ENDLOOP.

ELSE.

RAISE NAMETAB_FAULT.

ENDIF.

ENDIF.

READINDEX = READINDEX + 1.

ENDWHILE.

SORT PRMTAB.

ENDFORM.

----


  • FORM DDIC_INFO_GET_2 *

----


  • solve all im-/export and itab-structures *

  • get ddic-info *

----


FORM DDIC_INFO_GET_2.

LOOP AT PRMTAB

WHERE PARAMTYPE = IMPORT OR PARAMTYPE = EXPORT OR

PARAMTYPE = CHANGE OR PARAMTYPE = ITAB.

CHECK PRMTAB-TABNAME <> SPACE.

CHECK PRMTAB-FIELDNAME = SPACE.

PERFORM NAMETAB_GET USING PRMTAB-TABNAME RC.

IF RC = 0 OR RC = 8.

CASE PRMTAB-PARAMTYPE.

WHEN IMPORT.

PRMTAB-PARAMTYPE = IMP_STRUC_FIELD.

WHEN CHANGE.

PRMTAB-PARAMTYPE = CHA_STRUC_FIELD.

WHEN EXPORT.

PRMTAB-PARAMTYPE = EXP_STRUC_FIELD.

WHEN ITAB.

PRMTAB-PARAMTYPE = ITAB_FIELD.

ENDCASE.

LOOP AT NAMETAB.

PRMTAB-FIELDNAME = NAMETAB-FIELDNAME.

PERFORM MOVE_NAMETAB.

APPEND PRMTAB.

ENDLOOP.

ELSE.

RAISE NAMETAB_FAULT.

ENDIF.

ENDLOOP.

ENDFORM.

----


  • FORM NAMETAB_GET *

----


  • --> RC *

----


FORM NAMETAB_GET USING TABNAME RC.

CALL FUNCTION 'NAMETAB_GET'

EXPORTING

LANGU = SY-LANGU

TABNAME = TABNAME

IMPORTING

HEADER = TABHEAD

TABLES

NAMETAB = NAMETAB

EXCEPTIONS

INTERNAL_ERROR = 4

NO_TEXTS_FOUND = 8

TABLE_HAS_NO_FIELDS = 12

TABLE_NOT_ACTIV = 16.

RC = SY-SUBRC.

ENDFORM.

----


  • FORM MOVE_NAMETAB *

----


  • ........ *

----


FORM MOVE_NAMETAB.

PRMTAB-DATATYPE = NAMETAB-DATATYPE.

PRMTAB-INTTYPE = NAMETAB-INTTYPE.

PRMTAB-DDLEN = NAMETAB-DDLEN.

PRMTAB-INTLEN = NAMETAB-INTLEN.

PRMTAB-DECIMALS = NAMETAB-DECIMALS.

PRMTAB-LOWERCASE = NAMETAB-LOWERCASE.

PRMTAB-SIGN = NAMETAB-SIGN.

ENDFORM.

----


  • FORM MOVE_INITIAL *

----


  • ........ *

----


FORM MOVE_INITIAL.

PRMTAB-DATATYPE = 'CHAR'.

PRMTAB-INTTYPE = 'C'.

PRMTAB-DDLEN = 20.

PRMTAB-INTLEN = 20.

PRMTAB-LOWERCASE = 'X'.

ENDFORM.