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: 

reuse_alv_grid_display AND filter

former_member194669
Active Contributor
0 Kudos
1,835

All,

I have report with i am using REUSE_ALV_GRID_DISPLAY and within the Application toolbar i have 2 pushbuttons. (1. Expand 2 Colapse ) When user click on the button "Expand" i need to display the ALV with filtered values . I am using IT_FILTER. But i don't know to change the values of IT_FILTER on the basis of user command ( Ie want to change the IT_FILTER values at runtime)

Any Info ?

4 REPLIES 4

Former Member
0 Kudos
347

Hi,

If you want your report to expand and collapse , u must go for , Hierarchial display.

This gives a nodes like structure, which is very to good to understand and explore in the display.

Thanks

Rohini.

0 Kudos
347

Here is my code still it not working


FORM f_user_command USING p_ucomm    LIKE sy-ucomm
                          p_selfield TYPE slis_selfield .

  DATA: lv_fieldname  TYPE slis_fieldname,
        lv_kaufn      TYPE kdauf,
        lv_gtitle     TYPE lvc_title.

  CASE p_ucomm.
    WHEN '&EXP'.
      perform f_expand.
      p_selfield-refresh = 'X'.
    WHEN '&COL'.
      perform f_colapse.
      p_selfield-refresh = 'X'.

then in form f_expand and f_colapse form i writing the filter


  CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'
       IMPORTING
         ET_FILTER           =  IT_FILTER[].
" Here i am filtering where field REGIO eq to blank
WA_FILTER-FIELDNAME = 'REGIO'.
WA_FILTER-SELTEXT = 'Region'.
WA_FILTER-SIGN0 = 'I'.
WA_FILTER-OPTIO = 'EQ'.
WA_FILTER-INTTYPE = 'C'.
APPEND WA_FILTER TO P_FILTER.

  CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_SET'
      EXPORTING
          IT_FILTER      = it_filter[].

But still its not working Any info ?

347

Solved.

Problem is in the layout. While filtering the IT_FILTER we need to pass IT_LAYOUT also

Solved Code


  DATA: ls_layout      TYPE slis_layout_alv,
        lt_filter      TYPE slis_t_filter_alv,
        ls_grid_scroll TYPE lvc_s_scrl,
        ls_print       TYPE slis_print_alv.

    CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'
      IMPORTING
        es_layout      = ls_layout
        et_filter      = lt_filter
        es_grid_scroll = ls_grid_scroll
        es_print       = ls_print
      EXCEPTIONS
        OTHERS         = 1.

    CHECK sy-subrc IS INITIAL.
    perform f_set_fltr_val_exp using lt_filter[].

    CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_SET'
      EXPORTING
        is_layout      = ls_layout
        it_fieldcat    = gt_sfieldcat
        it_sort        = gt_sort
        it_filter      = lt_filter
        is_grid_scroll = ls_grid_scroll
        is_print       = ls_print
      EXCEPTIONS
        OTHERS         = 0.

juanluis_ramos
Explorer
0 Kudos
347

Hi.

Try to set the value of LT_ILTER-TABNAME in lower case

Regards.