Filter Option in Table Control

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

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

Similar Messages

  • Filter selection in table control

    hi
    does anybody implemented filter option using table control..?
    currently i am displaying bunch of records in my tbc and if user clicks on Filter button other screen will be popup and where he can give his selection.if once he done then i have to filter my internal table and display only those records.
    is it possible..?
    Thanks,

    Hi,
    In built functionality is available in ALV you can use ALV instead of table control.
    or
    check for function module STC1_POPUP_WITH_TABLE_CONTROL
    aRs

  • Insert,  Delete and Update options in Table control

    Experts,
    I have writen code for Insert,  Delete and Update options in Table control. They are not working properly...
    can any one send the code for the above please...
    Thanks in advance..

    Hi,
    Following steps will help you.
    1.TOP-INCLUDE
    DATA: ITAB1 LIKE KNA1 OCCURS 0 WITH HEADER LINE.
    DATA: ITAB2 LIKE KNA1 OCCURS 0 WITH HEADER LINE.
    DATA: WA LIKE KNA1.
    DATA: ANT TYPE I,CUR TYPE I.
    DATA: OK_CODE TYPE SY-UCOMM.
    CONTROLS: TABCTRL TYPE TABLEVIEW USING SCREEN 100.
    IN FLOWLOGIC
    PROCESS BEFORE OUTPUT.
    LOOP AT ITAB1 CURSOR CUR WITH CONTROL TABCTRL.
    ENDLOOP.
    PROCESS AFTER INPUT.
    MODULE CLEAR_DATA.
    LOOP AT ITAB1.
    MODULE MOVE_DATA.
    ENDLOOP.
    ADD “OK_CODE” IN ELEMENT LIST. CLICK ON LAYOUT AND  ADD TABLE CONTROL(name it as TABCTRL) AND PUSHBUTTONS AS FOLLOWS.
    SELECT THE FIELDS FROM PROGRAM. SAVE CHECK AND ACTIVATE.
    CLICK ON FLOWLOGIC EDITOR FROM APPLICATION TOOL BAR.
    DOUBLE CLICK ON MODULE “CLEAR_DATA”.
    write the in this module as below.
    CLEAR ITAB2. REFRESH ITAB2.
    DOUBLE CLICK ON MODULE “MOVE_DATA”.
    write the code in this module as below.
    APPEND ITAB1 TO ITAB2.
    ACTIVATE PAI AND WRITE THE CODE AS BELOW.
    CASE OK_CODE.
    WHEN 'FETCH'.
    SELECT * FROM KNA1 INTO TABLE ITAB1 UP TO 20 ROWS.
    TABCTRL-LINES = SY-DBCNT.
    WHEN 'ADD'.
    GET CURSOR LINE CNT.
    CNT = TABCTRL-TOP_LINE + CNT - 1.
    CLEAR WA.
    INSERT WA INTO ITAB1 INDEX CNT.
    WHEN 'MODIFY'.
    GET CURSOR LINE CNT.
    READ TABLE ITAB2 INDEX CNT.
    LOOP AT ITAB2.
    MODIFY KNA1 FROM ITAB2.
    ENDLOOP.
    SELECT * FROM KNA1 INTO TABLE ITAB1.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    ENDCASE.
    SAVE,CHECK AND ACTIVATE ALL.
    CREATE TCODE AND EXECUTE.
    contact if u hv any issues regarding this code.
    reward points,if it is useful.
    Thanks,
    Chandu.

  • IB51, IB52 : Page up & Page Down option for table control disabled

    Hi experts,
    IB51, IB52 Page up & Page Down option for table control is disabled.
    We want to use these options in the table control while recording .
    Can any one tell us?
    Regards,
    Lakshmi

    Hi,
    You can refer to Note 379208 .
    The same is applicable in CRM too.
    Thanks ,
    Jomy

  • Filter option for tables in 2004S

    Hi,
    I am trying to implement the filter option which is now available for tables. Is there any tutorial which I can follow to achieve it ?
    I want to have the filter at the top of every column in the table.
    Any help will be appreciated.
    Warm regards,
    Ashish

    found a couple tutorials on SDN which were helpful

  • Regarding Searh option in table control

    Hello,
    I have one table control in which i have taken only one field of 132 length so that user enter the line wise comments in that table control.
    Now i want a search button for that table control so that user can enter any string to search in the table control.
    How to do that as i haven't seen any thing like this even in standard transaction also.
    Please give me some ideas fro doing that.
    with regards,
    nitin

    Hello,
    Thanx for your reply,
    I code like this.
    I_TXTTAB is my table control internal table.
    MODULE SEARCH. is my module for search
    Codes as follow
      CASE OK_CODE.
        WHEN 'FIND'.
          PERFORM SEARCH.
    TAB_SEARCH-TABNAME = 'TLINE'.
      TAB_SEARCH-VALUE = ROLE_TEXT.
      TAB_SEARCH-FIELDNAME = 'TDLINE'.
      APPEND TAB_SEARCH.
      CALL FUNCTION 'POPUP_GET_VALUES'
        EXPORTING
          POPUP_TITLE     = 'Find Text : Comment'(010)
        IMPORTING
          RETURNCODE      = RETURNCODE
        TABLES
          FIELDS          = TAB_SEARCH
        EXCEPTIONS
          ERROR_IN_FIELDS = 1
          OTHERS          = 2.
      IF RETURNCODE = 'A'. EXIT. ENDIF.
      READ TABLE TAB_SEARCH WITH KEY FIELDNAME = 'TDLINE'.
      ROLE_TEXT = TAB_SEARCH-VALUE.
      CLEAR L_TEXT_INPUT.
      L_TEXT_INPUT = TAB_SEARCH-VALUE.
      IF ROLE_TEXT IS INITIAL .
        EXIT.
      ENDIF.
      IF FILE IS NOT INITIAL AND
         I_TXTTAB IS NOT INITIAL.
        DESCRIBE TABLE I_TXTTAB LINES TXT_LINES.
        L_IND = COMMENT-CURRENT_LINE.
        READ TABLE I_TXTTAB INTO W_TXTTAB INDEX L_IND.
        FIND ALL OCCURRENCES OF L_TEXT_INPUT  IN W_TXTTAB IGNORING CASE RESULTS RESULTS.
        IF SY-SUBRC = 0.
          SET CURSOR FIELD 'W_TXTTAB' LINE L_IND.
          FLAG = 'X'.
        ENDIF.
    This code finds the text string but it is not taking my cursor to that particular line item.
    i write this code like this also, but still not getting to the line item
    PROCESS AFTER INPUT.
      LOOP AT I_TXTTAB.
        CHAIN.
          FIELD W_TXTTAB-TDLINE.
          MODULE G_TEXT_MODIFY ON CHAIN-REQUEST.
        ENDCHAIN.
        MODULE SEARCH.
      ENDLOOP.
    With Regards,
    Nitin Malhotra

  • Not able to table control option in edit in layout

    HI,
    I am designing a screen with table control wizard ,but i am not able to see the option of table control wizard in edit.
    Message was edited by:
            nandulamatam Bharath
    Message was edited by:
            nandulamatam Bharath

    Hi
    Install the correct and latest patch of SAP GUI for this problem
    take the help of a BASIS person in this regard , he will install the same
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Layout Management in Table Control

    Hi Dialog Programming Experts,
    I have a new requirement - adding Layout Management options in Table Control. This is dialog/module programming, not ALV Report. Is there a function module for this?
    Thanks so much in advance for your help.
    Regards,
    Joyreen

    Hi
    For filter use the following function modules,
    l_rightx-id = l_index.
      l_rightx-fieldname = 'DESCR'.
      l_rightx-text = text-054.
      APPEND l_rightx TO i_rightx.
      l_index = l_index + 1.
      CLEAR l_rightx.
      l_rightx-id = l_index.
      l_rightx-fieldname = 'DEL_CM'.
      l_rightx-text = text-055.
      APPEND l_rightx TO i_rightx.
    CALL FUNCTION 'CEP_DOUBLE_ALV'
           EXPORTING
                i_title_left  = text-034
                i_title_right = text-035
                i_popup_title = text-036
           IMPORTING
                e_cancelled   = l_cancelled
           TABLES
                t_leftx       = i_leftx[]
                t_rightx      = i_rightx[].
    Firstly populate the right table with all fields which you want in the filtering condition. The left table will be populated once the use selects some fields and transfer it to the left portion of the dialog.
    Then use the following FM like this.
    DATA: i_group TYPE lvc_t_sgrp.
          CALL FUNCTION 'LVC_FILTER_DIALOG'
               EXPORTING
                    it_fieldcat   = i_fldcat1
                    it_groups     = i_group
               TABLES
                    it_data       = i_ziteminvoice[]
               CHANGING
                    ct_filter_lvc = i_filter
               EXCEPTIONS
                    no_change     = 1
                    OTHERS        = 2.
    here filter table should have fields from left table above.
    Once you get the filter data, populate range table for each fields and then delete your internal table using these range.
    CASE l_filter-fieldname.
                  WHEN 'ITMNO'.
                    l_itmno-sign = l_filter-sign.
                    l_itmno-option = l_filter-option.
                    l_itmno-low = l_filter-low.
                    l_itmno-high = l_filter-high.
                    APPEND l_itmno TO li_itmno.
                    CLEAR l_itmno.
    DELETE i_ziteminvoice WHERE NOT  itmno IN li_itmno OR
                                          NOT  aedat IN li_aedat OR...
    First check this if it works, else let me know.
    Thanks
    Sourav.

  • Reg : Find the records  in Table control

    Dear all
    Im having one requirement in table control .  In my table control totally 100 records contains sales documents
    for Example
    100010
    100020
    100030
    In that Records how to find particluar sale document in table control. How to build find option in table control.
    If possible or not
    Thanks & regards
    Sri

    Hi Sridhar,
    You need to implement amodal screen for this and a Find button above the table control.
    or you can use POPUP_GET_VALUES FM
    after you enter a value in the POP up screen.
    " You need to put some effort to implement this, wish you to implement it successfully as this is possible
    READ TABLE ITAB WITH KEY VBELN = FIND_VBELN. " FIND_VBELN is the field on your find screen.
    if sy-subrc = 0.
    tc-top_line = sy-tabix. " this makes the record visible in the First position
    endif.
    PROCESS AFTER INPUT.
      LOOP AT itab.
        MODULE find.
      ENDLOOP.
    In Program
    MODULE find INPUT.
      DATA : tab TYPE STANDARD TABLE OF sval WITH HEADER LINE.
      REFRESH tab.
      CASE ok_code.
        WHEN 'FIND'.
          clear ok_code.
          tab-tabname = 'VBAK'.
          tab-fieldname = 'VBELN'.
          APPEND tab.
          CALL FUNCTION 'POPUP_GET_VALUES'
            EXPORTING
    *   NO_VALUE_CHECK        = ' '
              popup_title           = 'Find Sales Order'
       start_column          = '5'
       start_row             = '5'
    * IMPORTING
    *   RETURNCODE            =
            TABLES
              fields                = tab
    EXCEPTIONS
       error_in_fields       = 1
       OTHERS                = 2
          IF sy-subrc = 0.
            READ TABLE itab WITH KEY vbeln = tab-value.
            IF sy-subrc = 0.
              tc-top_line = sy-tabix.
            ENDIF.
          ENDIF.
      ENDCASE.
    ENDMODULE.                 " find  INPUT
    Cheerz
    Ram

  • Module pool prorgam in table control designing

    Hi ,
    I have created the table control in module pool program.(Screen added in VA01 header level under addition data2)
    I have given the option for table control for Single line selection and W/Sel colum .
    My requirement is if i enter the data in table cotrol( SO creation)  or if data alreday Coming in table cotrol  (for So Change mode).Should allow to select the row.if table control doesn't have data for line wise.shouldn't t allow to select the Row selection.
    I tried to set the table control line selection mode option with  TABLE1-LINE_SEL_MODE = 0 through program.Its not allowing to select any row like with data also not allowing  to select and without data also its not allowing to select the data.
    How to set the functinality for same.
    Its very urgent Requirement.
    Regards
    DIvakar Reddy K.

    Hi Divakar,
    In the PBO of the screen, you need to write below code:
      PROCESS BEFORE OUTPUT.
      MODULE STATUS_0100.
        LOOP AT ITAB INTO DEMO_CONN WITH CONTROL FLIGHTS.
      ENDLOOP.
    Please refer to program DEMO_DYNPRO_TABCONT_LOOP_AT.

  • Making 10 table control rows to be displayed always

    Dear All,
    How to make a table control display 10 lines always..?

    Hi,
    Thanks for the response
    I have 3 table controls in a single screen. Each will have minimum 7-10 rows ( filled data ). I need to display all the table with all the rows visible to the user without scrolling.
    At present though I define the lines as 10 for each table they are getting adjusted to 4 lines per table and getting fit to the screen.
    But what I need is irrespective of the size of the monitor it should display all the tables with all the data. The screenmay have the scroll but not the tablecontrol.
    for e.g
    Table 1 Actual data is
    1 flight
    2 Train
    3 Car
    4 Flight
    5 Hotel
    6 Other
    7 Car
    But it is displayed as with scroll option for table control
    1 flight
    2 Train
    3 Car
    4 Flight
    I need it to be displayed as irrespective of the size of monitor
    1 flight
    2 Train
    3 Car
    4 Flight
    5 Hotel
    6 Other
    7 Car
    Please help.
    Regards
    Sai

  • An itab has been used as source for table control

    Hi,
    An itab has been used as source for table control without delete option of table control.
    Now I need to delete the row which the mouse arrow is on.
    Can I do this?
    Thanks.

    Hi Deniz,
    MODULE user_command_0100 INPUT.
      CASE sy-ucomm.
        WHEN 'DEL'.
        remove marked lines
          LOOP AT it_tabctrl
                  INTO wa_tabctrl
                  WHERE marked EQ kc_sel.
            IF sy-subrc EQ 0.
              DELETE it_tabctrl INDEX sy-tabix.
            ENDIF.
          ENDLOOP.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT

  • How can i decleare select-options in module pool table control?

    Hi everybody!!
    Can anyone tell me how can I decleare select-options in module pool table control screen?. I have declared it in a screen with a table control but a dump is triggered due to an error when generating the selection screen.
    Regards...

    My suggestion will be try to use fm
        call function 'FREE_SELECTIONS_DIALOG'
    Please search this forum you can find lot of threads related to this.

  • Select option in dialog, in a table control

    Hi Friends,
    My need is creating dynamic select options in a table control in dialog screen. How can I do my desire?
    Thanks.

    Hi,
    You can make use of
    FREE_SELECTIONS_INIT
    and
    FREE_SELECTIONS_DIALOG
    Please see the  documentation
    a®s

  • Select-option in module pool  with table Control

    HI,
    How to use the select-option in Module Pool and how Can i use the Table control in it.
    Can any body give me some Clues.
    with rgds
    Ranjith

    Hi ..
    PBO.
    LOOP at <table contriol>
    module --- Inside the module
    DATA: g_uti TYPE REF TO cl_fobu_input_util.
      if rollname <> space.
         CREATE OBJECT g_uti
           EXPORTING typename =rollname.
    *....convert to external pattern
         CALL METHOD g_util->output_convert
           EXPORTING
             field_value_int = p_value                 " This is Tablecontrol-low
           IMPORTING
             field_value_ext = p_value.              " Retrun value for Low
    ENDLOOP.
    lly you have code in PAI
    DATA: g_util_1 TYPE REF TO cl_fobu_input_util.
      if rollname <> space.
         CREATE OBJECT g_util_1
           EXPORTING typename = rollname.
    *....convert to internal pattern
         CALL METHOD g_util_1->input_convert
           EXPORTING
             field_value_ext   = p_value
           IMPORTING
             field_value_int_c = p_value.
    The above code should be written for tablecontrol-high aswell..
    you can also refer: Inlcude LSE16NF10 line no 341 & 434 (SE16n)
    Nag

Maybe you are looking for

  • ITunes 10.6.3.25 not work

    last night i upgrade my Itunes to 10.6.3.25 but it won't work it appear this messege it can't recognize my own devices iphone & ipad itunes said restore ur device What can i DO? remeber I remove Itunes then install it again it not work

  • New key figures in multiCube not available in old query

    Hello every one, I created new key figures in a mult Cube but not I wish to put them in the query based on this multi Cube and the figures are not there. I already actived the multi Cube, also sign on and sign off the BEx, generate the query using rs

  • Which Forms Item properties are converted to APEX?

    Has it been documented which Forms item properties are converted to APEX with the Application Migrations tool? For instance the 'required' property will be converted, but item properties like 'format', 'initial value', 'hint', 'tooltip', 'auto hint',

  • Data Sources Technical Names Required

    Dear All, I want some Datasources like 0CRM_MKTELM : CRM Marketing Element (Campaign and Marketing Plan)Hierarchy Datasource Required. 0CRMFOCST : Forecast relevance flag for opportunity Text Required. 0MATERIAL :  Datasrcs for Attr, Text Hier and Tr

  • Question--Dreamweaver and FLASH Video

    I have looked at tons of forums now and still see no solution for the problem many of us are having. I've loaded a flash video using dreamweaver cs4 and it won't show up. I've gotten the white box syndrome too. I sure wish someone could figure it out