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 filter

Former Member
0 Kudos

hi experts,

I wanna use the filter of ALV.. why doesn't it work. what should i set when i output the alv.

i use the CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

i_bypassing_buffer = 'X'

  • I_BUFFER_ACTIVE = ' '

i_callback_program = sy-repid

  • 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 = <DYN_WA>

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

is_layout = gds_layout

it_fieldcat = gdt_field_cata

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • it_sort = gdt_sortinfo

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

i_save = 'X'

is_variant = gt_var

it_events = gdt_eventcat

  • 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 = <dyn_table>

EXCEPTIONS

program_error = 1

OTHERS = 2 .

who met this issue, please give me the solution

thanks and best regards,

Kevin

9 REPLIES 9

Former Member
0 Kudos

Hi Kelvin,

You have to define Field Symbols, Before using RESUSE_ALV_GRID_DISPLAY.

Steps for ALV

Step 1 : Data Declaration.

Step 2 : Selecting the Variant for initial list display (Default Variant).

Optional : Used only if report layout is maintained through variant management.

Step 3 : Defining output characteristics: preparing display Field-catalog.

Step 4 : Build a table for Events, which are used for firing both user commands and the system dependent events i.e. top of page, end of page etc.

Optional : Required if the report has custom buttons, interactive properties etc or you need to display something at the top of page or end of page sections.

Step 5 : Build the Layout for report display.

Step 6 : Get the Selection Screen information in the report output.

Optional : Required only if you need to display selection screen values in the report output.

Step 7 : Specify the Sorting and/or Subtotaling of the basic list.

Optional : Required when sorting and/or subtotaling is required for some columns in the report output.

Step 8 : Finally display report output, using the following ALV functions modules:

1. REUSE_ALV_FIELDCATALOG_MERGE

2. REUSE_ALV_LIST_DISPLAY

Or

REUSE_ALV_GRID_DISPLAY

Here is a Sample code.

DATA: i_fcat TYPE slis_t_fieldcat_alv,

wa_fcat TYPE slis_fieldcat_alv.

wa_fcat-tabname = 'I_SFLIGHT'.

wa_fcat-col_pos = '1'.

wa_fcat-fieldname = 'CARRID'.

append wa_fcat to i_fcat.

wa_fcat-col_pos = '2'.

wa_fcat-fieldname = 'FLDATE'.

append wa_fcat to i_fcat.

wa_fcat-col_pos = '3'.

wa_fcat-fieldname = 'CONNID'.

append wa_fcat to i_fcat.

wa_fcat-col_pos = '4'.

wa_fcat-fieldname = 'PRICE'.

APPEND wa_fcat TO i_fcat.

wa_fcat-fieldname = 'CURRENCY'.

wa_fcat-no_out = 'X'.

APPEND wa_fcat TO i_fcat.

wa_fcat-fieldname = 'PLANETYPE'.

wa_fcat-no_out = 'X'.

APPEND wa_fcat TO i_fcat.

In the function module pass :

IT_FIELDCAT = i_fcat

Hope this will help you.

Darshan Patel

<i><b>Please reward points to helpful answer. It Motivates us to Help Others.</b></i>

0 Kudos

yes.. but the filter function doesn't work

0 Kudos

Hello,

the it_sort function module parameter is used to sort the ALV list.

If the internal table gdt_sortinfo is correctly populated the ALV list should be sorted as expected.

I see in your program the line '* it_sort = gdt_sortinfo' . To make this code line active, delete the character '*'.

Cordialement,

Chaouki.

0 Kudos

Sorry, i wanna realize the filter function, So please tell me the detail setting.

thanks

Kevin

0 Kudos

Hello,

what do you want to filter : columns on the displayed list or lines on the displayed list ?

0 Kudos

hello,

i found the answer to your question in the forum (previous post).

what i found to filter records : you can use the code below

1/ fill the internal table filter_1

DATA: FILTER_1 TYPE SLIS_T_FILTER_ALV,
WA_FILTER TYPE slis_filter_alv.
* Filter für detail setzen
WA_FILTER-TABNAME = 'WT_EDIT_PLT'.
WA_FILTER-FIELDNAME = 'KUNNR'.
WA_FILTER-SIGN0 = 'I'.
WA_FILTER-OPTIO = 'BT'.
WA_FILTER-VALUF_INT = '0000300080'. 
WA_FILTER-VALUT_INT = '0000300090'.
APPEND WA_FILTER TO FILTER_1.

2/export the internal table filter_1 to the function module REUSE_ALV_LIST_DISPLAY.

  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING     i_callback_program             = wv_repid
                     i_callback_user_command        = 'USER_COMMAND'
                     is_layout                      = wps_layout
                     it_fieldcat                    = wpt_fieldcat
                     i_default                      = 'X'
                     i_save                         = 'A '
                     it_events                      = wpt_events[]
                     IT_FILTER                   = filter_1

       TABLES        t_outtab                       = wpt_itab
       EXCEPTIONS    program_error                  = 1
                     OTHERS                         = 2.

the displayed ALV list will concern kunnr between '0000300080' AND '0000300090'.

Cordialement,

chaouki.

0 Kudos

The field bank account in popup filter window is not displayed totally. like following

in the selection screen

AA-BB-CC-001

AAC-BB-CC-002

CC-BB-CC-002

but in the filter screen

AA-BB-CC-001

AAC-BB-CC-00

CC-BB-CC-002

Best Regards,

Kevin

0 Kudos

What is the description of :

1/the field "bank account" in the selection screen ?

2/the field "bank account" in the ALV table ?

How do you fill the filter table ?

Former Member
0 Kudos

Hi,

If I understood your question correctly, you want to add filter functionality to your ALV Report, right?

For adding filter option, just add button to your GUI Status with function code "&FLT". The standard functionality of filter will be added to your ALV report. No need to write any explicit code for it.

Reward if answer is useful...

Regards,

Hema