Filter in table control

Hello Experts,
I had added Filter in table control. For this I am using FM 'LVC_FILTER'.
But I am getting error as "Filter Internal Error. 15"
Below is my code:
data layo type LVC_S_LAYO.
data GT_FILTER_INDEX type LVC_T_FIDX.
data itab type TABLE OF cxtab_column with HEADER LINE.
         loop at tc_item-cols into itab where selected = 'X'.
         append itab.
         name1-fieldname = itab-screen-name+12.
         append name1.
         endloop.
loop at itab.
  cnt = cnt + 1.
  wa_fieldcat-col_pos    = cnt.
  wa_fieldcat-fieldname  = itab-screen-name+12.
  wa_fieldcat-tabname    = 'GT_FABALOTI'.
   APPEND wa_fieldcat TO it_fieldcat1.
  CLEAR wa_fieldcat.
endloop.
layo-zebra = 'X'.
CALL FUNCTION 'LVC_FILTER'
  EXPORTING
   I_CALLBACK_PROGRAMM          = sy-repid
    it_fieldcat                  = it_fieldcat1
   IT_SELECTED_COLS             = name1[]
*   IT_VALUE_UNIT                =
*   IT_GROUPLEVELS               =
    is_layout                    = layo
*   IS_SELFIELD                  =
*   IT_GROUPS                    =
*   IS_FILT_LAYOUT               =
*   IT_EVENTS                    =
*   I_NO_DIALOG                  =
*   IT_EXCEPT_QINFO              =
*   I_IGNORING_CASE              =
IMPORTING
   ET_FILTER_INDEX              = gt_filter_index
*   ET_GROUPLEVELS_FILTER        =
*   ET_FILTER_INDEX_INSIDE       =
*   E_FILTER_FLAGNAME            =
  tables
    it_data                      = gt_fabaloti[]
  changing
    ct_filter                    = filter_ranges[]
* EXCEPTIONS
*   NO_CHANGE                    = 1
*   OTHERS                       = 2
How should I correct the error.
Please help.

Hi Shubham ,
  I too have the same requirement . Can you please send me the code because I am not getting these points.
IMPORTING
   ET_FILTER_INDEX              = gt_filter_index
*   ET_GROUPLEVELS_FILTER        =
*   ET_FILTER_INDEX_INSIDE       =
*   E_FILTER_FLAGNAME            =
  tables
    it_data                      = gt_fabaloti[]
  changing
    ct_filter                    = filter_ranges[]
Regards
Shek

Similar Messages

  • Possible to code a Find/Find Next feature for use inside a Table Control

    Hello,
    I have a Table Control that displays many lines.  Is it possible to code a Find/Find Next feature that would allow the user to enter a 'keyword' then search each line of the Table Control for existing matches?
    I have provided the user with various Selection Criteria that will filter the table control results, but there are still too many lines to visually scan for the desired result.
    I am guessing that I would place an input box and a 'Find' button onto my layout screen. Then in user command, I have to scroll through each line of the table control and check every value to see if the string contains 'keyword' When found, stop  and display table control assigning current line as Top line?
    Am I on the right track or is there a better solution already?
    Kind Regards,
    MPersson

    I've done that. It works pretty well. You might want to allow the user to search only in selected column(s) as well.
    Rob

  • How can I filter a table from Data Control without enter query

    I have a table from a web service data control based on WSDL.
    I want to filter the table without input query at filter text box. Without filter text box, each would filter the table with a hardcoded query internally.
    For example, when user click A menu button then it filters the table where type = '1' and B menu button filters the table by type='2' and C menu button filters the table by type=' ' .
    How can I filter the table without enter query?
    Could anyone point me to a solution please.
    Thanks.
    jdev 11.1.5
    Edited by: 893364 on Oct 26, 2011 12:15 PM
    Edited by: 893364 on Oct 26, 2011 12:21 PM

    Hi,
    when you created the table, did you try selecting the "filter" option. Select the table and go to the Property Inspctor. In the tool bar of the Property Inspector there is an icon to change the configuration. Its adding filter filter fields for the user to search in.
    Option 2: The data of the Web Service actually is held in the iterators. If you wanted to filter the WebService query, I would not use the WS DC but a JAX-WS proxy in a POJO to fetch the WS Data. Then have the Data Control created from the POJO. You could have a method exposed on the POJO that allows you to filter the internally held data
    Frank

  • 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

  • FILTER FOR A FIELD  IN TABLE CONTROL?

    DEAR GURUS,
       I HAVE A REQUIREMENT WHERE IN I HAVE TO FILTER A FIELD IN TABLE CONTROL?
    PLEASE HELP?
    Moderator message - Please ask a specific question and do not use all caps - post locked
    Edited by: Rob Burbank on May 4, 2009 4:27 PM

    Didn't get you.........Explain please......

  • Need Help to provide Filter and Total Provisions for Table Control

    Hi ,
    I need to provide 'Set Filter' and 'Total(Summation)'  Buttons functionality in my application which is having a Table Control. I know these functionality provision with ALV Grid but not with Table control and would appreciate if any body can help me.
    Regards,
    Srinivas

    hi SRINI VASA
    can you provide me with the answer you found to your question, I'm having a spec with the similar requirement.
    Thanks

  • 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

  • How to delete record from table control in BDC?

    Hello friends,
    I am running a BDC program to delete records.
    I have file with following records and i got these records into t_itab.
    Material     Plant     Start date     End date     Cost
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100004     S002     09/01/2008     09/31/2008     56.00
    MQ100008     S003     09/01/2008     09/31/2008     57.00
    Now, I have BDC transaction in which table control screen which contains following structure.
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100002     S002     09/01/2008     09/31/2008     56.00
    MQ100004     S003     09/01/2008     09/31/2008     47.00     
    MQ100005     S004     09/01/2008     09/31/2008     25.00
    MQ100006     S012     09/01/2008     09/31/2008     76.00
    MQ100007     S033     09/01/2008     09/31/2008     17.00
    MQ100008     S011     09/01/2008     09/31/2008     95.00
    MQ100009     S002     09/01/2008     09/31/2008     46.00
    I have recorded from SHDB in which first record will be delete.
    So, when i loop through t_itab,instead of deleting MQ100001,MQ100004 and MQ100008 from BDC screen,
    it is deleting MQ100001,MQ100002 and MQ100004 (first record for each process ).
    Which i don't want to.
    Is there any facility in BDC to put records on top which i want to delete?
    Please guide me.
    Regards,
    RH

    Hi,
    While doing recording check for Filter button available for the table control, if it available then do the recording for the same.
    Once it is done while passing the data from internal table put the value into Filter field.
    Hope it resolves your issue.
    Thanks & Regards.
    Nagaraj Kalbavi

  • How to delete record from table control using BDC?

    Hello friends,
    I am running a BDC program to delete records.
    I have file with following records and i got these records into t_itab.
    Material     Plant     Start date     End date     Cost
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100004     S002     09/01/2008     09/31/2008     56.00
    MQ100008     S003     09/01/2008     09/31/2008     57.00
    Now, I have BDC transaction in which table control screen which contains following structure.
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100002     S002     09/01/2008     09/31/2008     56.00
    MQ100004     S003     09/01/2008     09/31/2008     47.00     
    MQ100005     S004     09/01/2008     09/31/2008     25.00
    MQ100006     S012     09/01/2008     09/31/2008     76.00
    MQ100007     S033     09/01/2008     09/31/2008     17.00
    MQ100008     S011     09/01/2008     09/31/2008     95.00
    MQ100009     S002     09/01/2008     09/31/2008     46.00
    I have recorded from SHDB in which first record will be delete.
    So, when i loop through t_itab,instead of deleting MQ100001,MQ100004 and MQ100008 from BDC screen,
    it is deleting MQ100001,MQ100002 and MQ100004 (first record for each process ).
    Which i don't want to.
    Is there any facility in BDC to put records on top which i want to delete?
    Please guide me.
    Regards,
    RH

    One option is to identify the table and find out the location as the number of row which should be deleted from the table and then in the bdc program instead of postioning the cursor on the row 1(using the statement perform bdc_cursor ....(01)), replace the 01 with the row number.
    Second option is that if a filter control is available for the table control, then filter the data each and every time with the material number to be deleted and then delete the first row.
    Regards
    Farzan

  • How to enhance table control in DMS. Need to display doknr more than 25 cha

    Hi there.
    In transaction IL03 - document tab - I need to display a doknr which is longer than 25 characters.
    I search for exit/enhancement for DMS - saplcv140/control SUB_DOC, but cant find anything.
    If it is not possible to enhance this field, i would like to add a new field (more than 25 char) and fill in the long doknr.
    The documents that are attached contains both an internal docnumber(from the external system) and an external docnumber (functional location type of number). It is very important to show external documentno in the table control.
    Actually in the table DRAW the external dok number is in the field MRK_FILEP. Can this field somehow get in the tablecontrol?
    Anybody has experience with docno longer than 25 characters? Or how to enhance tablecontrol sub_doc (screen 0204) in fuction group CV140.
    Br,
    Liselotte.

    The BAdI CRM_BADI_RF_Q1O_SEARCH is for enhancing OneOrder based searches. Not for business partners.
    The BAdI CRM_BUPA_IL_SEARCH is the way to go. I just checked in our system.
    In the method SEARCH_CRITERIA_INITIAL check if your field is supplied in IS_PARAMETERS. If yes return CV_IS_NOT_INITIAL = 'X'.
    Then in SEARCH_PARTNERS you delete the entries from table CT_PARTNER_KEYS according to your parameter.
    However this is not very performant. If you have a search with criteria only of your own for the BAdI SAP coding will first select everything and then you filter out.
    Anyway, it is much faster to implement than a new search...
    cheers Carsten
    Edited by: Carsten Kasper on Nov 18, 2008 7:44 PM

  • Table control : Need to change Single field as non editable

    Hi Experts,
                    Plz help me out. In a table control there r 7 fields and only one field is editable. When i change the status of a record as delete in tat table control, only the deleted record (all fields)should become non-editable. Is it possible? Pls suggest.
    Regards,
    J. Sriram.

    Hi,
    In PBO of your screen
    you should be using a step loop like this :
    CONTROLS control1 TYPE TABLEVIEW USING SCREEN 100.
    LOOP AT itab WITH CONTROL control1.
    ENDLOOP.
    Where the control1 is the tableview control defined in your program
    and placed on your screen.
    Put a second loop on screen inside this loop ant set the related attribute :
    LOOP AT itab WITH CONTROL control1.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'COLUMN1'.
    SCREEN-INPUT = 0.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ENDLOOP.
    So you can set cells editable or non-editable
    and you can filter it which record & which field..

  • 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.

  • UI5 Table control Cellclick event exception

    Hi,
    I have rendered "Table" control with the data. After populating the data when I clicked on Table Cell getting the below error in the Chrome browser console. (In the code I haven't hook CellClick event to the table control)
    Uncaught Error: Syntax error, unrecognized expression: unsupported pseudo: tabbable sap-ui-core.js:27
    i4.errorsap-ui-core.js:27
    i4.selectors.filter.PSEUDOsap-ui-core.js:27
    y4sap-ui-core.js:27
    i4.compilesap-ui-core.js:27
    B4sap-ui-core.js:27
    i4sap-ui-core.js:27
    $.findjquery-mobile-custom.js:15
    $.find.matchesSelectorjquery-mobile-custom.js:15
    Q.extend.filtersap-ui-core.js:27
    A1sap-ui-core.js:27
    Q.fn.extend.filtersap-ui-core.js:27
    sap.ui.table.Table._enterActionModeTable.js:107
    sap.ui.table.Table.onmouseupTable.js:70
    a._callEventHandlessap-ui-core.js:134
    a._handleEventsap-ui-core.js:134
    U._handleEventsap-ui-core.js:134
    psap-ui-core.js:16
    Q.event.dispatchsap-ui-core.js:27
    v3.handle
    When I tried to add the attachCellClick event to the table control getting the following error, and data also not populating.
    Uncaught TypeError: Object [object Object] has no method 'attachCellClick' First.view.js:66
    sap.ui.jsview.createContentFirst.view.js:66
    (anonymous function)JSView.js:6
    d.runWithPreprocessorssap-ui-core.js:134
    sap.ui.core.mvc.JSView.onControllerConnectedJSView.js:6
    sap.ui.core.mvc.View._initCompositeSupportView.js:6
    E.extend.constructorsap-ui-core.js:134
    M.extend.constructorsap-ui-core.js:134
    E.extend.constructorsap-ui-core.js:134
    fsap-ui-core.js:122
    fsap-ui-core.js:122
    osap-ui-core.js:116
    sap.ui.viewView.js:6
    o.(anonymous function)sap-ui-core.js:116
    (anonymous function)
    Can someone advice on this.
    Thanks,
    Rakesh

    Hi,
    There's no cellClick event in Table, because of which you are getting the error.
    Regards,
    Kiran

  • How to use selection column in a table control

    I have given the name of the selection column to be 'DEF_SEL',now i want to select rows in the table control using the 'selection column attribute' and maniupulate it programmatically so that i would transport the rows selected using selection coulmn to a different table control.How would i do this?

    Hi raja,
      Once you have the table cobtrol built using the extra field in the internal table, all the selected rows will have DEF_SEL = 'X'.
    Now you can loop your internal table and filter the records which were selected.
    in pai modules:
    loop at itab where DEF_SEL = 'X'.
    Move itab information inrto another internal table.
    append itab_new.
    endloop.
    have another table control which shows the data in the itab_new.
    regards,
    Ravi

  • Create Table Control using Dynamic Internal Table.

    Hi,
       I have requirement in which I will create a Dynamic Internal Table and then I need to create a Table Control Using that Internal Table. Now this can't be done using Screen Editor as it requires a pre-defined internal table or a DDIC Object.
      Please Help.

    This should be correct answer(I am not author of code below):
    REPORT ztablemaintace NO STANDARD PAGE HEADING.
    TYPE-POOLS: rsds.
    DATA: is_x030l TYPE x030l,
    it_dfies TYPE TABLE OF dfies,
    is_dfies TYPE dfies,
    it_fdiff TYPE TABLE OF field_dif,
    is_fdiff TYPE field_dif.
    DATA: w_selid TYPE rsdynsel-selid,
    it_tables TYPE TABLE OF rsdstabs,
    is_tables TYPE rsdstabs,
    it_fields TYPE TABLE OF rsdsfields,
    it_expr TYPE rsds_texpr,
    it_ranges TYPE rsds_trange,
    it_where TYPE rsds_twhere,
    is_where TYPE rsds_where,
    w_active TYPE i.
    DATA: it_content TYPE REF TO data,
    it_modif TYPE REF TO data,
    it_fcat TYPE lvc_t_fcat.
    DATA: w_okcode TYPE sy-ucomm.
    FIELD-SYMBOLS: <itab> TYPE STANDARD TABLE,
    <ntab> TYPE STANDARD TABLE.
    * Macros
    DEFINE table_error.
      message e398(00) with 'Table' p_table &1.
    END-OF-DEFINITION.
    DEFINE fixed_val.
      is_fdiff-fieldname = is_dfies-fieldname.
      is_fdiff-fixed_val = &1.
      is_fdiff-no_input = 'X'.
      append is_fdiff to it_fdiff.
    END-OF-DEFINITION.
    * Selection screen
    SELECTION-SCREEN: BEGIN OF BLOCK b01 WITH FRAME.
    PARAMETERS: p_table TYPE tabname OBLIGATORY "table
    MEMORY ID dtb
    MATCHCODE OBJECT dd_dbtb_16.
    SELECTION-SCREEN: BEGIN OF LINE,
    PUSHBUTTON 33(20) selopt USER-COMMAND sel,
    COMMENT 55(15) selcnt,
    END OF LINE.
    SELECTION-SCREEN: SKIP.
    PARAMETERS: p_rows TYPE i. "rows
    SELECTION-SCREEN: END OF BLOCK b01,
    SKIP,
    BEGIN OF BLOCK b02 WITH FRAME.
    PARAMETERS: p_displ TYPE c AS CHECKBOX. "display
    SELECTION-SCREEN: END OF BLOCK b02.
    * Initialization
    INITIALIZATION.
      MOVE '@4G@ Filter records' TO selopt.
    * PBO
    AT SELECTION-SCREEN OUTPUT.
      IF w_active IS INITIAL.
        CLEAR: selcnt.
      ELSE.
        WRITE w_active TO selcnt LEFT-JUSTIFIED.
      ENDIF.
    * PAI
    AT SELECTION-SCREEN.
      IF p_table NE is_x030l-tabname.
        CALL FUNCTION 'DDIF_NAMETAB_GET'
          EXPORTING
            tabname   = p_table
          IMPORTING
            x030l_wa  = is_x030l
          TABLES
            dfies_tab = it_dfies
          EXCEPTIONS
            OTHERS    = 1.
        IF is_x030l IS INITIAL.
          table_error 'does not exist or is not active'.
        ELSEIF is_x030l-tabtype NE 'T'.
          table_error 'is not selectable'.
    *    ELSEIF is_x030l-align NE 0.
    *      table_error 'has alignment - cannot continue'.
        ENDIF.
    * Default values for system fields
        REFRESH: it_fdiff.
        is_fdiff-tabname = p_table.
        LOOP AT it_dfies INTO is_dfies.
          IF is_dfies-datatype = 'CLNT'.
            fixed_val sy-mandt.
          ELSEIF is_dfies-rollname = 'ERDAT'
          OR is_dfies-rollname = 'ERSDA'
          OR is_dfies-rollname = 'AEDAT'
          OR is_dfies-rollname = 'LAEDA'.
            fixed_val sy-datum.
          ELSEIF is_dfies-rollname = 'ERTIM'
          OR is_dfies-rollname = 'AETIM'.
            fixed_val sy-uzeit.
          ELSEIF is_dfies-rollname = 'ERNAM'
          OR is_dfies-rollname = 'AENAM'.
            fixed_val sy-uname.
          ENDIF.
          CALL FUNCTION '/SAPDMC/DATAELEMENT_GET_TEXTS'
            EXPORTING
              name        = is_dfies-rollname
            IMPORTING
              text_middle = is_dfies-reptext
            EXCEPTIONS
              not_found   = 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.
          MODIFY it_dfies FROM is_dfies.
      ENDLOOP.
    * Prepare free selection on table
      REFRESH it_tables.
      is_tables-prim_tab = p_table.
      APPEND is_tables TO it_tables.
      CLEAR: w_selid.
    ENDIF.
    IF sy-ucomm = 'SEL'.
      IF w_selid IS INITIAL.
    * Init free selection dialog
        CALL FUNCTION 'FREE_SELECTIONS_INIT'
          EXPORTING
            expressions  = it_expr
          IMPORTING
            selection_id = w_selid
            expressions  = it_expr
          TABLES
            tables_tab   = it_tables
          EXCEPTIONS
            OTHERS       = 1.
      ENDIF.
    * Display free selection dialog
      CALL FUNCTION 'FREE_SELECTIONS_DIALOG'
        EXPORTING
          selection_id            = w_selid
          title                   = 'Selection'
          status                  = 1
          as_window               = 'X'
        IMPORTING
          expressions             = it_expr
          field_ranges            = it_ranges
          number_of_active_fields = w_active
        TABLES
          fields_tab              = it_fields
        EXCEPTIONS
          OTHERS                  = 1.
    ENDIF.
    * Start of processing
    START-OF-SELECTION.
      PERFORM f_create_table USING p_table.
      PERFORM f_select_table.
      PERFORM f_display_table.
    * FORM f_create_table *
    FORM f_create_table USING in_tabname.
      FIELD-SYMBOLS: <fcat> TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = in_tabname
        CHANGING
          ct_fieldcat      = it_fcat
        EXCEPTIONS
          OTHERS           = 1.
      IF sy-subrc = 0.
    *   Complete field catalog
        LOOP AT it_fcat ASSIGNING <fcat>.
          <fcat>-tabname = in_tabname.
        ENDLOOP.
        CALL FUNCTION 'LVC_FIELDCAT_COMPLETE'
          CHANGING
            ct_fieldcat = it_fcat
          EXCEPTIONS
            OTHERS      = 1.
      ELSE.
        WRITE: 'Error building field catalog'.
        STOP.
      ENDIF.
    * Create dynamic table for data
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fcat
        IMPORTING
          ep_table        = it_content.
      IF sy-subrc = 0.
        ASSIGN it_content->* TO <itab>.
      ELSE.
        WRITE: 'Error creating internal table'.
        STOP.
      ENDIF.
    * Create dynamic table for modif
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fcat
        IMPORTING
          ep_table        = it_modif.
      IF sy-subrc = 0.
        ASSIGN it_modif->* TO <ntab>.
      ELSE.
        WRITE: 'Error creating internal table'.
        STOP.
      ENDIF.
    ENDFORM.                    "f_create_table
    * FORM f_select_table *
    FORM f_select_table.
      IF w_active = 0.
        SELECT * FROM (p_table)
        INTO CORRESPONDING FIELDS OF TABLE <itab>
        UP TO p_rows ROWS.
      ELSE.
    * Selection with parameters
        CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_WHERE'
          EXPORTING
            field_ranges  = it_ranges
          IMPORTING
            where_clauses = it_where.
        READ TABLE it_where INTO is_where WITH KEY tablename = p_table.
        SELECT * FROM (p_table)
        INTO CORRESPONDING FIELDS OF TABLE <itab>
        UP TO p_rows ROWS
        WHERE (is_where-where_tab).
      ENDIF.
      IF sy-dbcnt = 0.
        WRITE: 'No record selected'.
        STOP.
      ENDIF.
    ENDFORM.                    "f_select_table
    * FORM f_display_table *
    FORM f_display_table.
      DATA: l_answer TYPE c,
      l_eflag TYPE c.
      CLEAR: w_okcode.
      REFRESH: <ntab>.
    * Display table contents
      CALL FUNCTION 'STC1_FULLSCREEN_TABLE_CONTROL'
        EXPORTING
          header       = p_table
          tabname      = p_table
          display_only = p_displ
          endless      = 'X'
          no_button    = space
        IMPORTING
          okcode       = w_okcode
        TABLES
    *      nametab      = it_dfies
          table        = <itab>
    *      fielddif     = it_fdiff
          modif_table  = <ntab>
        EXCEPTIONS
          OTHERS       = 1.
      IF sy-subrc = 0.
        IF p_displ IS INITIAL AND w_okcode = 'SAVE'.
    * Confirm update
          CALL FUNCTION 'POPUP_TO_CONFIRM'
            EXPORTING
              titlebar              = p_table
              text_question         = 'Do you want to update table ?'
              default_button        = '2'
              display_cancel_button = ' '
            IMPORTING
              answer                = l_answer
            EXCEPTIONS
              OTHERS                = 1.
          IF l_answer = '1'.
    * Apply modifications
            IF NOT <ntab>[] IS INITIAL.
              PERFORM f_add_system USING space.
              MODIFY (p_table) FROM TABLE <ntab>.
              IF sy-subrc NE 0.
                l_eflag = 'X'.
              ENDIF.
            ENDIF.
    * Apply deletions
            IF l_eflag IS INITIAL.
              REFRESH: <ntab>.
              CALL FUNCTION 'STC1_GET_DATA'
                TABLES
                  deleted_data = <ntab>
                EXCEPTIONS
                  OTHERS       = 1.
              IF NOT <ntab>[] IS INITIAL.
                DELETE (p_table) FROM TABLE <ntab>.
                IF sy-subrc NE 0.
                  ROLLBACK WORK.
                  l_eflag = 'X'.
                ENDIF.
              ENDIF.
            ENDIF.
    * Apply creations
            IF l_eflag IS INITIAL.
              REFRESH: <ntab>.
              CALL FUNCTION 'STC1_GET_DATA'
                TABLES
                  new_data = <ntab>
                EXCEPTIONS
                  OTHERS   = 1.
              IF NOT <ntab>[] IS INITIAL.
                PERFORM f_add_system USING 'X'.
                INSERT (p_table) FROM TABLE <ntab>.
                IF sy-subrc NE 0.
                  ROLLBACK WORK.
                  l_eflag = 'X'.
                ENDIF.
              ENDIF.
            ENDIF.
            IF l_eflag IS INITIAL.
              COMMIT WORK.
              MESSAGE s261(53).
            ELSE.
              MESSAGE s075(3i).
              PERFORM f_select_table.
            ENDIF.
          ENDIF.
    * Display table again
          PERFORM f_display_table.
        ENDIF.
      ENDIF.
    ENDFORM.                    "f_display_table
    * FORM f_add_system *
    FORM f_add_system USING new TYPE c.
      FIELD-SYMBOLS: <irec> TYPE ANY,
      <upd> TYPE ANY.
      LOOP AT it_fdiff INTO is_fdiff.
        READ TABLE it_dfies INTO is_dfies
        WITH KEY fieldname = is_fdiff-fieldname.
        LOOP AT <ntab> ASSIGNING <irec>.
          ASSIGN COMPONENT is_fdiff-fieldname OF STRUCTURE <irec> TO <upd>.
          IF is_dfies-datatype = 'CLNT'.
            <upd> = sy-mandt.
          ELSE.
            CASE is_dfies-rollname.
              WHEN 'AENAM'.
                <upd> = sy-uname.
              WHEN 'AEDAT' OR 'LAEDA'.
                <upd> = sy-datum.
              WHEN 'AETIM'.
                <upd> = sy-uzeit.
              WHEN OTHERS.
            ENDCASE.
          ENDIF.
        ENDLOOP.
      ENDLOOP.
    ENDFORM.                    "f_add_system

Maybe you are looking for

  • Issue in ESS Portal

    After upgrade to EHP 4, we have an issue with portal where initally the Personnel data screen was not modifiable ie Read Only....But now the users are able to edit their information without any error message. Kindly suggest..how we can make the field

  • Advise on Actions

    Most of  clients send us huge jpgs. We resize them to 3" x 2" @ 300 dpi. (no actions used to resize because they are all different sizes & orientations) The department have an action that does the following: Convert to CMYK Save as .eps (eps files ar

  • Ipod touch rejects correct password for home wifi/router

    My ipod touch can get unsecured wifi ok (sometimes, which is another discussion) but when I set up a Linksys wireless router at home, my laptop is able to use the wireless but the ipod touch sees the router's name, but rejects the correct password. (

  • TableSorter over more than one columns like Excel

    Hi Experts, do you have a example for TableSorter over more than one columns like Excel? Thank you very much. regards Steffen

  • My phone keeps crashing when I try to use the camera or apps. how can I fix this

    Most times when I try to use my camera, post a pic on instagram, or add lives on candy crush my phone just crashes. And by crashes I mean it goes to a black screen then to my home screen. Really frustrating! Any suggestions?