SAP Function Modules

LVC_FILTER SAP Function module







LVC_FILTER is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name LVC_FILTER into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: SLVC_DIALOG
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM LVC_FILTER - LVC FILTER





CALL FUNCTION 'LVC_FILTER' "
  EXPORTING
*   i_callback_programm = SPACE  " sy-repid
    it_fieldcat =               " lvc_t_fcat
*   it_selected_cols =          " lvc_t_col
*   it_value_unit =             " lvc_t_refs
*   it_grouplevels =            " lvc_t_grpl
    is_layout =                 " lvc_s_layo
*   is_selfield =               " lvc_s_self
*   it_groups =                 " lvc_t_sgrp
*   is_filt_layout =            " flt_s_layo
*   it_events =                 " lvc_t_evts
*   i_no_dialog =               " char01        Character Field Length 1
*   it_except_qinfo =           " lvc_t_qinf
*   i_ignoring_case =           " char01
  IMPORTING
    et_filter_index =           " lvc_t_fidx
    et_grouplevels_filter =     " lvc_t_grpl
    et_filter_index_inside =    " lvc_t_fidx
    e_filter_flagname =         " char40
  TABLES
    it_data =                   " table
  CHANGING
    ct_filter =                 " lvc_t_filt
  EXCEPTIONS
    NO_CHANGE = 1               "
    .  "  LVC_FILTER

ABAP code example for Function Module LVC_FILTER





The ABAP code below is a full code listing to execute function module LVC_FILTER including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
ld_et_filter_index  TYPE LVC_T_FIDX ,
ld_et_grouplevels_filter  TYPE LVC_T_GRPL ,
ld_et_filter_index_inside  TYPE LVC_T_FIDX ,
ld_e_filter_flagname  TYPE CHAR40 ,
it_it_data  TYPE STANDARD TABLE OF TABLE,"TABLES PARAM
wa_it_data  LIKE LINE OF it_it_data .

DATA(ld_ct_filter) = 'Check type of data required'.
DATA(ld_i_callback_programm) = 'some text here'.
DATA(ld_it_fieldcat) = 'some text here'.
DATA(ld_it_selected_cols) = 'some text here'.
DATA(ld_it_value_unit) = 'some text here'.
DATA(ld_it_grouplevels) = 'some text here'.
DATA(ld_is_layout) = 'some text here'.
DATA(ld_is_selfield) = 'some text here'.
DATA(ld_it_groups) = 'some text here'.
DATA(ld_is_filt_layout) = 'some text here'.
DATA(ld_it_events) = 'some text here'.
DATA(ld_i_no_dialog) = 'some text here'.
DATA(ld_it_except_qinfo) = 'some text here'.
DATA(ld_i_ignoring_case) = 'some text here'.

"populate fields of struture and append to itab
append wa_it_data to it_it_data. . CALL FUNCTION 'LVC_FILTER' EXPORTING * i_callback_programm = ld_i_callback_programm it_fieldcat = ld_it_fieldcat * it_selected_cols = ld_it_selected_cols * it_value_unit = ld_it_value_unit * it_grouplevels = ld_it_grouplevels is_layout = ld_is_layout * is_selfield = ld_is_selfield * it_groups = ld_it_groups * is_filt_layout = ld_is_filt_layout * it_events = ld_it_events * i_no_dialog = ld_i_no_dialog * it_except_qinfo = ld_it_except_qinfo * i_ignoring_case = ld_i_ignoring_case IMPORTING et_filter_index = ld_et_filter_index et_grouplevels_filter = ld_et_grouplevels_filter et_filter_index_inside = ld_et_filter_index_inside e_filter_flagname = ld_e_filter_flagname TABLES it_data = it_it_data CHANGING ct_filter = ld_ct_filter EXCEPTIONS NO_CHANGE = 1 . " LVC_FILTER
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_ct_filter  TYPE LVC_T_FILT ,
ld_et_filter_index  TYPE LVC_T_FIDX ,
ld_i_callback_programm  TYPE SY-REPID ,
it_it_data  TYPE STANDARD TABLE OF TABLE ,
wa_it_data  LIKE LINE OF it_it_data,
ld_et_grouplevels_filter  TYPE LVC_T_GRPL ,
ld_it_fieldcat  TYPE LVC_T_FCAT ,
ld_et_filter_index_inside  TYPE LVC_T_FIDX ,
ld_it_selected_cols  TYPE LVC_T_COL ,
ld_e_filter_flagname  TYPE CHAR40 ,
ld_it_value_unit  TYPE LVC_T_REFS ,
ld_it_grouplevels  TYPE LVC_T_GRPL ,
ld_is_layout  TYPE LVC_S_LAYO ,
ld_is_selfield  TYPE LVC_S_SELF ,
ld_it_groups  TYPE LVC_T_SGRP ,
ld_is_filt_layout  TYPE FLT_S_LAYO ,
ld_it_events  TYPE LVC_T_EVTS ,
ld_i_no_dialog  TYPE CHAR01 ,
ld_it_except_qinfo  TYPE LVC_T_QINF ,
ld_i_ignoring_case  TYPE CHAR01 .

ld_ct_filter = 'some text here'.
ld_i_callback_programm = 'some text here'.

"populate fields of struture and append to itab
append wa_it_data to it_it_data.
ld_it_fieldcat = 'some text here'.
ld_it_selected_cols = 'some text here'.
ld_it_value_unit = 'some text here'.
ld_it_grouplevels = 'some text here'.
ld_is_layout = 'some text here'.
ld_is_selfield = 'some text here'.
ld_it_groups = 'some text here'.
ld_is_filt_layout = 'some text here'.
ld_it_events = 'some text here'.
ld_i_no_dialog = 'some text here'.
ld_it_except_qinfo = 'some text here'.
ld_i_ignoring_case = 'some text here'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name LVC_FILTER or its description.