Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
vijair
Explorer
2,723
Signature is the Exporting/Importing parameters of the function module. See below, for the function module REUSE_ALV_GRID_DISPLAY have many exporting, importing and table parameters.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
* I_CALLBACK_PROGRAM = ' '
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
* IS_LAYOUT =
* IT_FIELDCAT =
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
* IT_EVENTS =
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* I_HTML_HEIGHT_TOP = 0
* I_HTML_HEIGHT_END = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab =
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.

When we start working for a project, we usually create a new function group. All FMs will be included in this function group (There may be cases like multiple function group created for same project or same function group for multiple projects ). When we create a function group, there will be a program automatically generated with prefix SAPL.

Eg: If the function group name is Z_TEST, then the program name will be SAPLZ_TEST.

We can open this program in the ABAP editor. There will be one include after TOP include with name LZ_TESTUXX. This include will have all the function modules used in the function group. There will be separate includes for each function modules. Name of these includes will be like LZ_TESTU01, LZ_TESTU02 etc..

 

Table TFDIR helps us to find all the FMs in the function group, we need to pass the above program name as input to PNAME field. We just need to pass all these FMs into table FUPARAREF to get the signature details of  all FMs.

Below code can be used to fetch the details.

TOP
 TYPES: BEGIN OF fm_sign,
funcname TYPE tfdir-funcname,
parameter TYPE fupararef-parameter,
paramtype TYPE fupararef-paramtype,
structure TYPE fupararef-structure,
optional TYPE fupararef-optional,
END OF fm_sign.

CONSTANTS: c_prefix TYPE c LENGTH 4 VALUE 'SAPL'.

DATA: lt_signature TYPE STANDARD TABLE OF fm_sign,
fng_name TYPE char40,
msg TYPE REF TO cx_salv_msg,
alv TYPE REF TO cl_salv_table,
layout_settings TYPE REF TO cl_salv_layout,
layout_key TYPE salv_s_layout_key,
columns TYPE REF TO cl_salv_columns_table,
functions TYPE REF TO cl_salv_functions_list.

INCLUDE zfmsignature_top.

START-OF-SELECTION.
PARAMETERS FnGrp TYPE char30.
END-OF-SELECTION.
CONCATENATE c_prefix FnGrp INTO fng_name.

SELECT tfdir~funcname fupararef~parameter fupararef~paramtype fupararef~structure fupararef~optional
INTO CORRESPONDING FIELDS OF TABLE lt_signature
FROM fupararef AS fupararef INNER JOIN tfdir AS tfdir ON fupararef~funcname EQ tfdir~funcname
WHERE tfdir~pname EQ fng_name AND tfdir~funcname NOT LIKE 'TABLE%'.
TRY.
cl_salv_table=>factory(
IMPORTING
r_salv_table = alv
CHANGING
t_table = lt_signature ).
layout_settings = alv->get_layout( ).
layout_key-report = sy-repid.
layout_settings->set_key( layout_key ).
layout_settings->set_save_restriction( if_salv_c_layout=>restrict_none ).
columns = alv->get_columns( ).
columns->set_optimize( ).
functions = alv->get_functions( ).
functions->set_all( ).
CATCH cx_salv_msg INTO msg.
ENDTRY.
alv->display( ).


If we created custom tables and generated table maintenance generator, then there will be two additional FMs in the function group with below names.

  1. TABLEFRAME_functiongroupname.

  2. TABLEPROC_functiongroupname.


We should remove these two FMs in the output, to achieve that in where clause filtering is used for funcname.

 

Selection Screen looks like Below.



 

Output



 

Here parameter I - Input, E - Exporting , T- Table and optional parameter's are marked with 'X'.

 
9 Comments
Labels in this area