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

Similar Messages

  • 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

  • How to perform 'block selection' in table control?

    Hi,
    I'm looking for an easy way to implement block selection in a table control (i.e. select one line, hit 'block select' button, select a second line, hit 'block select' button again, and all lines between first and last are selected).
    I'm currently with a customer who is on 4.0b, so I can't use the wizard, it didn't exist back then.
    I hope someone knows
    regards,
    rs

    Rob,
    I generated a quick screen with wizard doing the multiple select.  This is the code chucks it generated
    in _TOP  first part is my definition of the table to be displayed and the one column on it.
    TABLES:   zsd_act_salespr.
    DATA:
      BEGIN OF wk_rec.
            INCLUDE STRUCTURE zsd_act_salespr.
    DATA:
        sel    TYPE c,
      END OF wk_rec,
      it_wk   LIKE STANDARD TABLE OF wk_rec.
       controls: TBLCLT_MAIN type tableview using screen 0100.   " Table Control on screen
    in I01
    *&spwizard: input modul for tc 'TBLCLT_MAIN'. do not change this line!
    *&spwizard: mark table
    module TBLCLT_MAIN_mark input.
      data: g_TBLCLT_MAIN_wa2 like line of IT_WK.
      if TBLCLT_MAIN-line_sel_mode = 1.
         loop at IT_WK into g_TBLCLT_MAIN_wa2
           where SEL = 'X'.
           g_TBLCLT_MAIN_wa2-SEL = ''.
           modify IT_WK
             from g_TBLCLT_MAIN_wa2
             transporting SEL.
         endloop.
      endif.
      modify IT_WK
        from WK_REC
        index TBLCLT_MAIN-current_line
        transporting SEL.
    endmodule.
    in the screen workflow
    PROCESS BEFORE OUTPUT.
    *&spwizard: pbo flow logic for tablecontrol 'TBLCLT_MAIN'
      module TBLCLT_MAIN_change_tc_attr.
    *&spwizard: module TBLCLT_MAIN_change_col_attr.
      loop at   IT_WK
           into WK_REC
           with control TBLCLT_MAIN
           cursor TBLCLT_MAIN-current_line.
    *&spwizard:   module TBLCLT_MAIN_change_field_attr
      endloop.
    PROCESS AFTER INPUT.
    *&spwizard: pai flow logic for tablecontrol 'TBLCLT_MAIN'
      loop at IT_WK.
        chain.
          field WK_REC-SPNUM.
        endchain.
        field WK_REC-SEL
          module TBLCLT_MAIN_mark on request.
      endloop.
    *&spwizard: module TBLCLT_MAIN_change_tc_attr.
    *&spwizard: module TBLCLT_MAIN_change_col_attr.
    in the O01
    *&spwizard: output module for tc 'TBLCLT_MAIN'. do not change this line!
    *&spwizard: update lines for equivalent scrollbar
    module TBLCLT_MAIN_change_tc_attr output.
      describe table IT_WK lines TBLCLT_MAIN-lines.
    endmodule.
    in the F01 nothing
    Edited by: Paul Chapman on Apr 24, 2008 4:56 PM

  • Question on line selection in table control in dialog programming....

    Hello,
    I have a internal table displayed on a screen using Table control wizard. Now, when user selects a particular line and double clicks it, I want to write a query based on the line user selected. How can this be achieved ?
    Regards,
    Rajesh.

    Assign a function code to F2 in your status and do the coding:
    PROCESS PAI.
    LOOP AT ITAB.
    MODULE GET_CURSOR.
    ENDLOOP.
    MODULE USER_COMMAND.
    MODULE GET_CURSOR.
    GET CURSOR FIELD ws_field LINE ws_line.
    ENDMODULE.
    MODULE USER_COMMAND.
    CASE OK_CODE.
    WHEN 'PICK'.
    WS_LINE = <TABLE CONTROL>-TOP_LINE + WS_LINE - 1.
    READ TABLE ITAB INDEX WS_LINE.
    ---> Show details
    ENDMODULE.

  • ABAP WD, Multiple Row selection in table control without using Crtl key

    Hi all,
    I am displaying the records using the table control, i have to select the multiple records in the list <b>without using Crtl key</b>.
    How do i solve this?
    Thanks

    Hi,
    you should set the table parameter selectionMode to multi or multinolead
    than you can select multiple records,
    these you can retrieve: lt_selected_elements = node->get_selected_elements( ).
    also see this <a href="https://forums.sdn.sap.com/click.jspa?searchID=4209200&messageID=3544158">thread</a> for info
    grtz,
    Koen

  • ABAP WD, Multiple Row selection in table control

    Hi all,
            I am populating and displaying the records using the table control, i have to select the multiple records in the list and want do some deletion,selection,so i could not select the more than one record.
    How do i solve this?
    Please give me your valuable suggestions.
    Thanks

    Hi ulli,
    thanks for your quick reply,
    now its working for me but i have to press the 'CTRL' key and select the row, for selecting the multiple rows.
    one more thing i wanted some methods for "DELETION", "SELECTING ALL RECORDS","DESELECTING",in the displayed list.
    plz suggest me..,
    thanks and regards
    kamal

  • How to handle the single line selection in table control

    Hi All,
       I am facing a problem in the table control of modulepool program.
       I have line selection as "Single" in the table control attributes. But when i am selecting a line in the table control as long as it is in the same page,the line selection is single but when i am selecting the line in the next page,the previous selection is not deselected. So I am seeing two selection for "Single line selector" attribute.
       Could any one help me solve this problem?
    Thanks & Regards,
    S.Lakshmi

    Hi Lakshmi,
    Just Go to Table control , click on it , you can see the attributes screen , there you can see option for
    <b>Line selection</b>
    none
    multiple selection
    single selection
    check the radio button single selection.
    that will solve your problem..
    regards
    vijay

  • Multiple row selection in table control...

    hi...
    i can select one row from table control and display in a list..
    the same thing i want to do for multiple lines...
    thanks..

    use the table control wizard to create a table control on the screen...while going thru the steps, there will be a screen which asks you about the selection column (this is a single character field in your internal table). on this step there is a selection option for single/multiple selection of rows....
    to access the selected records, use...
    loop at itab where sel eq 'X'.
    endloop.
    where
    <b>itab</b> is the underlying internal table for table control and <b>sel</b> is the name of the selection column
    or if u already have a table control on screen...double click and open the properties window...there u can see radio buttons None, Single and Multiple for line selection. choose the multiple option.
    rgds,
    PJ
    Message was edited by: Priyank Jain

  • Single selection in table control

    hii all..
    I am stuck at a very unique problem. i have created a table control to display some data. from that control user can select only a single row. So for that i have set the table control attribute single row selection. Now the problem is suppose i have 50 rows in my internal table that is showing in table control. In the table control 25 rows are displayed at a time. When user presses Page down the next 25 rows are displayed.
    Now when table control is showing first set of 25 rows, a user is able to select only a single row according to the attribute that i have set. But when a user selects any row in the first 25 rows and presses Page down and then selects another row in the next set of 25 rows, both the previous selection and the current selection are retained which i didnt wanted.
    How can i solve this problem.... really got stuck
    points guranteed!!

    Hi,
    In every PAI count the no. of selected records and in every PBO if the count is greater than one, then give the information message and unselect all those selected rows.
    <u>Example</u>:
    CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
    DATA: count type i.
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
      if count > 1.
        count = 0.
        message 'You can select only a single Record' type 'I' .
        loop at itab into wa.
          wa-mark = ' '.
          modify itab from wa.
        endloop.
      endif.
    ENDMODULE.
    MODULE count_selected_rows INPUT.
        loop at itab into wa.
          if wa-mark = 'X'.
            count = count + 1.
          endif.
        endloop.
    ENDMODULE.                 " count_selected_rows  INPUT\
    <b>Screen FlowLogic</b>
    PROCESS BEFORE OUTPUT.
      MODULE STATUS_0100.
        LOOP AT ITAB INTO DEMO_CONN WITH CONTROL FLIGHTS.
      ENDLOOP.
    PROCESS AFTER INPUT.
      MODULE CANCEL AT EXIT-COMMAND.
      LOOP AT ITAB.
        module read_table_control.
      ENDLOOP.
        module count_selected_rows.
      module user_command_0100.
    <b>Reward if useful,</b>Regards,
    Sudheer

  • Need to get the row selected in table control without ay action

    Dear Team,
    I have a requirement in which I need to pass the row selected of a table control to a variable.
    Here I need to get the row selected with out any other action
    then the action of selection of a row.
    Is it possible to read table control values using FM DYNP_VALUES_READ.
    thanks in advance,
    regards,
    Sai

    HI,
    Sai Kumar Potluri
    I tried in IDES it working.
    Here is the code.
    REPORT  ZPRA_TC_D.
    TABLES : SCARR.
    CONTROLS TC TYPE TABLEVIEW USING SCREEN 1.
    DATA : SELLINE TYPE I,
           SELINDEX TYPE I.
    DATA : ACT LIKE SCARR-CARRID,
           ANT LIKE SCARR-CARRNAME.
    DATA : ITAB LIKE SCARR OCCURS 0 WITH HEADER LINE.
    CALL SCREEN 1.
    *&      Module  STATUS_0001  OUTPUT
    *       text
    MODULE STATUS_0001 OUTPUT.
      SET PF-STATUS 'ME'.
    *  SET TITLEBAR 'xxx'.
    SELECT * FROM SCARR INTO TABLE ITAB.
    ENDMODULE.                 " STATUS_0001  OUTPUT
    *&      Module  MOV  OUTPUT
    *       text
    MODULE MOV OUTPUT.
      MOVE-CORRESPONDING ITAB TO SCARR.
    ENDMODULE.                 " MOV  OUTPUT
    *&      Module  USER_COMMAND_0001  INPUT
    *       text
    MODULE USER_COMMAND_0001 INPUT.
    CASE SY-UCOMM.
    WHEN 'BACK' OR 'UP' OR 'EXIT'.
      LEAVE PROGRAM.
    WHEN 'SEL'.
      GET CURSOR FIELD SCARR-CARRID LINE SELLINE.
      SELINDEX = TC-TOP_LINE + SELLINE - 1.
      READ TABLE ITAB INDEX SELINDEX.
      ACT = ITAB-CARRID.
      ANT = ITAB-CARRNAME.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0001  INPUT
    In Flow Logic.
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0001.
    LOOP AT ITAB WITH CONTROL TC.
      MODULE MOV.
    ENDLOOP.
    PROCESS AFTER INPUT.
    LOOP AT ITAB.
    ENDLOOP.
    MODULE USER_COMMAND_0001.

  • How can we select multiple rows in table control for module pool program?

    hi guru's
                 i cannt able to select multiple table control rows for deletion of records please give any code to select rows?
    regrards,
    satheesh.

    On the Table Control attributes there is a "Selectability" option where you choose one of: None, Single, or Multiple.  In your code you then need to pick up which rows have the selection column set to 'X'.

  • How to add check box in table control?

    Dear frnds,
    In our requirement i am used tablec ontrol for dialog programming, but i am confused about addition of check box as fields in table control.
    Any help are welcome from your side.

    Hi,
    Chk this demo program: DEMO_DYNPRO_TABCONT_LOOP_AT
    & RSDEMO02.
    Another way:
    Go to the edit mode of the screen select the table control column you want to make it as check box and follow the menu EDIT->CONVERT->check box.
    (make sure that column definition in itab/ddtab is of size 1 char)
    Also chek out this link:
    Add Check box in Table control
    Hope these help you.
    Regards,
    Anjali

  • Table control index

    Hi,
    I have a table control. How to get the index of the row selected in the table control?
    Please help. Very urgent
    Thanks

    Hi Kushaal Choudri,
    Procedure for Table control line selection and modifying master table using
    those values.
    1).
    U should take one variable in your internal table or in structure which
    is used for table control fields
    ex :
    data :begin of itab occurs 0 ,
    mark type c ,
    matnr like mara-matnr ,
    matkl like mara-matkl,
    maktx like makt-maktx,
    end of itab .
    Controls: TABC types TABLEVIEW using screen 100.
    2).
    This mark variable should be given in Table control properties.
    follow the path
    double click on the table control-->attributes .->select
    w/SelColumn and in that itab-mark. Check in the figure.
    [http://bp2.blogger.com/_O5f8iAlgdNQ/R99gOUH8CXI/AAAAAAAAA9I/d3gOum1fJ6s/s1600-h/pic28145-796618.jpg|http://bp2.blogger.com/_O5f8iAlgdNQ/R99gOUH8CXI/AAAAAAAAA9I/d3gOum1fJ6s/s1600-h/pic28145-796618.jpg]
    3).
    After that. Take this example.
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    LOOP AT ITAB WITH CONTROL tabc
    ENDLOOP.
    PROCESS AFTER INPUT.
    MODULE CANCEL AT EXIT-COMMAND.
    LOOP AT ITAB.
    Module read_table_control.
    ENDLOOP.
    module user_command_0100.
    ==============================
    In this Module read_table_control, You should write the following code
    MODULE read_table_control INPUT.
    MODIFY itab INDEX tabc-current_line."( This will update the ITAB table MARK field with 'X ' whatever we have selected on table control.)
    ENDMODULE.
    4)
    If you want to Delete some of the records from Table control
    follow this code u2026Create one pushbutton and give Fucnction code to that
    and write below code
    WHEN 'DELETE'.
    LOOP AT itab WHERE mark = 'X'.
    DELETE itab.
    ENDLOOP.
    ENDCASE.
    I hope that it helps u .
    Regards,
    Venkat.O

  • The PAI Event Code to search for a record in Table Control

    Logic
    1. I have a position button and entry text field (search content) for a table control in my screen. Position button has the function code 'PBUT'.
    2. Content of table control will be in an internal table. The entry text field  is to be used for positioning.
    3. I enter the search (key) field in text field & Click the position button.
    4. The PAI event of button click (Module user_command) of that screen is as under.
    Case sy_ucomm.
    When 'PBUT'.
    What will be the code to bring the row as selected in table control, that I have to write here, for this case-value.
    Endcase.
    Regards,

    Hi Alok,
    Excuse me, couldn`t catch u yesterday. Ok i`ve the code which will set the cursor on the selected entry.
    Reward points if convinced.
    *& Report  Y131_TC_TEST                                                *
    REPORT  y131_tc_test NO STANDARD PAGE HEADING.
    TABLES: vbak.
    DATA : BEGIN OF str_tc,
           vbeln LIKE vbak-vbeln,
           erdat LIKE vbak-erdat,
           END OF str_tc,
           it_tc LIKE TABLE OF str_tc WITH HEADER LINE,
           loopc LIKE sy-loopc,
           flag,
           lin TYPE i.
    CONTROLS : my_tc TYPE TABLEVIEW USING SCREEN 9000.
    CALL SCREEN 9000.
    *&      Module  STATUS_9000  OUTPUT
    *       text
    MODULE status_9000 OUTPUT.
    *  SET PF-STATUS 'xxxxxxxx'.
    *  SET TITLEBAR 'xxx'.
      IF it_tc[] IS INITIAL.
        SELECT vbeln erdat INTO TABLE it_tc UP TO 10
        ROWS FROM vbak.
        DESCRIBE TABLE it_tc LINES lin.
        my_tc-top_line = loopc.
      ENDIF.
    ENDMODULE.                 " STATUS_9000  OUTPUT
    *&      Module  USER_COMMAND_9000  INPUT
    *       text
    MODULE user_command_9000 INPUT.
      CASE sy-ucomm.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
       <b> WHEN 'PBUT'.</b>
    **** Now this event is triggerred when the user uses the ****Position Push button to locate the field value.
          CALL SCREEN 9001 STARTING AT 10 15.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9000  INPUT
    *&      Module  USER_COMMAND_9001  INPUT
    *       text
    MODULE user_command_9001 INPUT.
      CASE sy-ucomm.
        WHEN 'OKAY' OR ' ' or 'EXIT'.
    <b>**** When the user selects values from the search help on **** position button, the itab is read and index is *****assigned</b>
          READ TABLE it_tc WITH KEY vbeln = vbak-vbeln.
          IF sy-subrc = 0.
            loopc = sy-tabix.
            flag = 'X'.
    **** the cursor is set here
           <b> my_tc-top_line = loopc.</b>
             SET SCREEN 0.
          LEAVE SCREEN.
          ENDIF.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9001  INPUT
    *&      Module  STATUS_9001  OUTPUT
    *       text
    MODULE status_9001 OUTPUT.
      SET PF-STATUS 'MODAL'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_9001  OUTPUT
    Regards

  • Hot to display checkbox in table control

    hi all,
    i am displaying table comtrol. in my table control i have one field,name of the field is Inactive. in this field i have to show chckboxes.
    anybody can send me the code please.
    thanks,
    maheedhar.t

    Hi,
    If you want to display a field of type c as checkbox in tablecontrol.
    After opening screen painter, click the option ChkB for that field while getting the fields from Dictionary/Program Fields -> Get From Program.
    Now drag the box on to your table control.
    <u><i><b>Chk this demo program: DEMO_DYNPRO_TABCONT_LOOP_AT
    & RSDEMO02.</b></i></u>
    <u><i><b>Another way:</b></i></u>
    Go to the edit mode of the screen select the table control column you want to make it as check box and follow the menu EDIT->CONVERT->check box.
    (make sure that column definition in itab/ddtab is of size 1 char)
    regards
    navjot
    Message was edited by:
            navjot sharma

Maybe you are looking for