Application Development 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: 

Alv

Former Member
0 Kudos

Hi,

How to use i_filter in Function module Grid_display. What is its functionality?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

One scenario to use it_filter is with variant. Means user can choose the variant from the selection screen. And it can be possible that variant is set with some filter criteria. So to know the filter criteria..use FM REUSE_ALV_VARIANT_SELECT.

call function 'REUSE_ALV_VARIANT_SELECT'

exporting

i_dialog = 'N'

i_user_specific = 'X'

i_default = ' '

  • I_TABNAME_HEADER =

  • I_TABNAME_ITEM =

it_default_fieldcat = gt_fieldcat_s

i_layout = ls_layout

importing

  • E_EXIT =

es_layout = ls_layout

et_fieldcat = gt_fieldcat_s

et_sort = lt_sort

et_filter = lt_filter

changing

cs_variant = gs_variant_s

exceptions

wrong_input = 1

fc_not_complete = 2

not_found = 3

program_error = 4

others = 5.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

endif.

Then to show the report with this filter condition u can call ALV grid FM..

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

  • i_background_id = 'ALV_WP'

  • I_INTERFACE_CHECK = ' '

i_callback_program = l_repid

i_callback_pf_status_set = 'STATUS_SET'

i_callback_user_command = 'USER_COMMAND_S'

  • i_structure_name = ''

i_grid_settings = l_grid_settings

is_layout = ls_layout

it_fieldcat = gt_fieldcat_s

it_excluding = lt_excluding

it_special_groups = lt_sp_group[]

it_sort = lt_sort

it_filter = lt_filter

is_sel_hide = ls_sel_hide

i_default = 'X'

i_save = 'A'

is_variant = gs_variant_s

it_events = lt_events

it_event_exit = lt_event_exit

  • IS_PRINT =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

tables

t_outtab = <gt_outtab>

exceptions

program_error = 1

others = 2.

Regards,

Joy.

5 REPLIES 5

Former Member
0 Kudos

hi,

go to this link it will be very helpful.

[good link|http://sap-abapinfo.blogspot.com/2008/04/unified-access-to-all-sap-abap-hr.html]

Regards,

sandeep

Former Member
0 Kudos

Hi Sharmista,

http://saptechnical.com/Tutorials/ALV/ALVMainPage.htm

If Found Help Full Do Reward.

Regards.

Eshwar.

Former Member
0 Kudos

Hi

IT_FILTER:

filter criteria for first list ouput.Table with filter properties for columns for which a filter is to be set intitially.

Description:

Table with filter criteria

Using this parameter you can pass on filter criteria resulting from explicitly loading a display variant in adavance.

This table should never be set up manually.

Regards,

Sravanthi

Former Member
0 Kudos

Hi Dadapure sharmitha...

IT_FILTER in reuse_alv_grid_display is used to give the filter criteria ..

actuly this parameter is of type table where we have to pass table and it's filed name .....jst try it .

thanks and regards

Priyank Dixit

Former Member
0 Kudos

One scenario to use it_filter is with variant. Means user can choose the variant from the selection screen. And it can be possible that variant is set with some filter criteria. So to know the filter criteria..use FM REUSE_ALV_VARIANT_SELECT.

call function 'REUSE_ALV_VARIANT_SELECT'

exporting

i_dialog = 'N'

i_user_specific = 'X'

i_default = ' '

  • I_TABNAME_HEADER =

  • I_TABNAME_ITEM =

it_default_fieldcat = gt_fieldcat_s

i_layout = ls_layout

importing

  • E_EXIT =

es_layout = ls_layout

et_fieldcat = gt_fieldcat_s

et_sort = lt_sort

et_filter = lt_filter

changing

cs_variant = gs_variant_s

exceptions

wrong_input = 1

fc_not_complete = 2

not_found = 3

program_error = 4

others = 5.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

endif.

Then to show the report with this filter condition u can call ALV grid FM..

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

  • i_background_id = 'ALV_WP'

  • I_INTERFACE_CHECK = ' '

i_callback_program = l_repid

i_callback_pf_status_set = 'STATUS_SET'

i_callback_user_command = 'USER_COMMAND_S'

  • i_structure_name = ''

i_grid_settings = l_grid_settings

is_layout = ls_layout

it_fieldcat = gt_fieldcat_s

it_excluding = lt_excluding

it_special_groups = lt_sp_group[]

it_sort = lt_sort

it_filter = lt_filter

is_sel_hide = ls_sel_hide

i_default = 'X'

i_save = 'A'

is_variant = gs_variant_s

it_events = lt_events

it_event_exit = lt_event_exit

  • IS_PRINT =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

tables

t_outtab = <gt_outtab>

exceptions

program_error = 1

others = 2.

Regards,

Joy.