2009 Oct 12 10:19 AM
Hi Folks ,
I am working on a table control , i need to add Filter functionality same as of ALV filter
i tried with suggestion given on SCN
Following is the code that i tried, but its not working, no popup with FM LVC_FILTER_DIALOG
please help me with sum more suggestion or sample code
DATA : cp_vbak LIKE it_vbak OCCURS 0.
DATA : it_fieldcat1 TYPE lvc_t_fcat,
wa_fieldcat LIKE line of it_fieldcat1,
it_group1 like lvc_s_sgrp occurs 0,
ls_group LIKE lvc_s_sgrp,
filter_ranges TYPE lvc_t_filt.
DATA: counter TYPE i.
counter = counter + 1.
wa_fieldcat-col_pos = counter.
wa_fieldcat-fieldname = 'VBELN'.
wa_fieldcat-tabname = 'IT_VBAK'.
APPEND wa_fieldcat TO it_fieldcat1.
CLEAR wa_fieldcat.
counter = counter + 1.
wa_fieldcat-col_pos = counter.
wa_fieldcat-fieldname = 'VKORG'.
wa_fieldcat-tabname = 'IT_VBAK'.
APPEND wa_fieldcat TO it_fieldcat1.
CLEAR wa_fieldcat.
counter = counter + 1.
wa_fieldcat-col_pos = counter.
wa_fieldcat-fieldname = 'VTWEG'.
wa_fieldcat-tabname = 'IT_VBAK'.
APPEND wa_fieldcat TO it_fieldcat1.
CLEAR wa_fieldcat.
counter = counter + 1.
wa_fieldcat-col_pos = counter.
wa_fieldcat-fieldname = 'SPART'.
wa_fieldcat-tabname = 'IT_VBAK'.
APPEND wa_fieldcat TO it_fieldcat1.
CLEAR wa_fieldcat.
ls_group-SP_GROUP = '0001'.
ls_group-TEXT = 'VBELN'.
append ls_group to it_group1.
clear ls_group.
ls_group-SP_GROUP = '0002'.
ls_group-TEXT = 'VKORG'.
append ls_group to it_group1.
cp_vbak[] = it_vbak[].
CALL FUNCTION 'LVC_FILTER_DIALOG'
EXPORTING
it_fieldcat = it_fieldcat1
it_groups = it_group1
* IS_FILT_LAYOUT =
* I_NO_DIALOG =
* IT_EXCEPT_QINFO =
tables
it_data = it_vbak
CHANGING
ct_filter_lvc = filter_ranges
* EXCEPTIONS
* NO_CHANGE = 1
* OTHERS = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*Need to code more for Filter the internal table
2009 Oct 12 11:27 AM
2010 Jun 17 6:21 PM
Hi Pihu,
I am also trying to implement the filter functionality in a Table Conntriol.
I have used following two function modules to handle the filter option.
1. CEP_DOUBLE_ALV: You will get the pop up to select you filtering fields.
2. LVC_FILTER_DIALOG: Second pop up to select the filtering data for the fields selected.
But the second FM is giving an error 'filter internal error : 15'
If u have already implemented this functionality, can u give me the sample code.
Thanks in advance,
Sai
2010 Jun 23 7:55 AM
Hi Phiu/Sai,
If you have solved the problem..please paste the code. I m also having similar requirement.
Regards
Venkatesh P
2011 Nov 14 12:47 AM
2011 Nov 14 2:00 AM
solved. FM used : K_KKB_OUTTAB_FILTER_CRITERIA_K
There are other function modules too, we just need to pass data properly, otherwise it may result in
FILTER INTERNAL ERROR 15.
Note that, the number 15 meant for one of the exceptions in FM FREE_SELECTIONS_INIT. so fill-out the FIELDCATALOG.
15 - no filed type ( solution: pass DATATYPE and INTYPE in field catalog structure)
Thanks
Ram
2012 Apr 05 8:25 AM
2012 Apr 05 8:26 AM