HIDING SOME COLUMS IN TABLE CONTROL

Hi
i have a module pool program i want to hide the some colums in table control dynamically

typing error, use LOOP AT CTRL-COLS into COLS, then you can use COLS-INVISIBLE or COLS-SCREEN-<attribute of screen>.
TYPE-POOL CXTAB .                                                                               
TYPES:                                                                               
BEGIN OF CXTAB_COLUMN,                                                             
         SCREEN      LIKE SCREEN,     "Attributes struktur SCREEN                         
         INDEX       TYPE I,         "Position of a column on the screen                  
         SELECTED(1) TYPE C,          "Indicator 'column selected'                        
         VISLENGTH   LIKE ICON-OLENG, "Visualised length of a column                      
         INVISIBLE(1) TYPE C,         "Indicator 'column invisible'                       
       END   OF CXTAB_COLUMN,                                                                               
BEGIN OF CXTAB_CONTROL,                                                            
         FIXED_COLS    TYPE I, "Number of fixed columns                                   
         LINES         TYPE I, "Number of lines to display                                
         TOP_LINE      TYPE I, "Top line during next PBO                                  
         CURRENT_LINE  TYPE I, "Current line during LOOP/ENDLOOP                          
         LEFT_COL       TYPE I, "Fist scrollable column after fixed area                  
         LINE_SEL_MODE    TYPE I, "Line-selection  : none(0), single(1),                  
         COL_SEL_MODE     TYPE I, "Column-selection:        multiple(2)                   
         LINE_SELECTOR(1) TYPE C, "Indicator: 'With line-selection col'                   
         V_SCROLL(1) TYPE C,            "not used                                         
         H_GRID(1) TYPE C,        "Indicator: 'Horizontal  grid-lines'                    
         V_GRID(1) TYPE C,     "Indicator: 'Vertikal    grid-lines'                       
         COLS      TYPE STANDARD TABLE OF CXTAB_COLUMN                                    
                        WITH NON-UNIQUE DEFAULT KEY,                                      
         INVISIBLE(1) TYPE C,                                                             
       END   OF CXTAB_CONTROL,      
Regards

Similar Messages

  • Disable some columns in table control?

    Hi
    How to disable some columns in table control.
    For Ex: Table contains 8 columns.
    In first row i want to disable first 4 columns.
    in second row i want to disable last 4 columns.
    In third row i want to disable first 2 and last 2 columns.  How can we achieve this?
    Cheers,
    Venkys.

    HI
    Create three attribute in the node which is bound to the table as data source.
    say pro1, pro2, and pro3 of type wdy_boolean.
    now bind the enabled property of first four column editors to pro1, last 4 to pro2, and pro3 to first 2 and last 2.
    then go to the eventhandler of the dropdown 's on select event and write the code to update the values of these attribute
    according to the selected value.
    here is the sample code.
    DATA lo_nd TYPE REF TO if_wd_context_node.
        DATA lo_el TYPE REF TO if_wd_context_element.
            DATA lv_VAL LIKE ls_dealer1-name.
        lo_nd = wd_context->get_child_node( name = 'DEALER1').
      lo_el = lo_nd->get_element(  ).
        lo_el->get_attribute(
          EXPORTING
            name =  `NAME`
          IMPORTING
            value = lv_VAL ).
         DATA PR1 TYPE WDY_BOOLEAN.
         DATA PR2 TYPE WDY_BOOLEAN.
         DATA PR3 TYPE WDY_BOOLEAN.
      PR1 = ABAP_TRUE.
    PR2 = ABAP_TRUE.
    PR3 = ABAP_TRUE.
    IF LV_VAL EQ 'A'.
    PR1 = ABAP_FALSE.
    PR2 = ABAP_TRUE.
    PR3 = ABAP_TRUE.
       ELSEIF LV_VAL EQ 'B'.
    PR1 = ABAP_TRUE.
    PR2 = ABAP_FALSE.
    PR3 = ABAP_TRUE.
    ELSEIF LV_VAL EQ 'C'.
      PR1 = ABAP_TRUE.
    PR2 = ABAP_TRUE.
    PR3 = ABAP_FALSE.
      ENDIF.
       LO_EL->SET_ATTRIBUTE(
       NAME = 'PRO1'
       VALUE = PR1
       LO_EL->SET_ATTRIBUTE(
       NAME = 'PRO2'
       VALUE = PR2
       LO_EL->SET_ATTRIBUTE(
       NAME = 'PRO3'
       VALUE = PR3
    thanks
    sarbjeet singh

  • How to make editable the colums of table control in the PBO

    Hello Experts!
    I`m using the table control in dynpro, and i want to make editable some colums depending of some values.
    How can i do that?
    Thanks!

    Hi
    U need to change the screen attributes of colunm by statament LOOP AT SCREEN/ENDLOOP into the loop of table control in PBO:
    PROCESS PBO.
       LOOP AT ITAB ......
            MODULE LOOP_SCREEN_TC.
      ENDLOOP.
    MODULE LOOP_SCREEN_TC.
      IF ITAB-FIELD1 = .........
         LOOP AT SCREEN.
            IF SCREEN-NAME = 'ITAB-FIELD2'.
               SCREEN-INPUT = 0.
               MODIFY SCREEN.
            ENDIF.
        ENDLOOP.
      ENDIF.
    ENDMODULE.
    Max

  • Hiding gap in a table control - Column is invisible

    Hi All,
    I'm hiding a column in a table control based on a condition. My requirement is I need to remove the gap occupied by the column that is invisible.
    <b><REMOVED BY MODERATOR></b>
    Thanks,
    Bhaskar.
    Message was edited by:
            Alvaro Tejada Galindo

    Hi Bhaskar,
    Based on the Condition, you can build the Field catalogue.
    So that, u can restrict them at the catolog bulding level.
    Regards,
    Sujatha

  • Dynamic Hide column in table control

    I want to hide colum of table control in program, and then it can invisible,but others is visible.
    how should i do?

    Hello All,
    I am trying to implement the above solution. I am facing some issues.
    I have used a table maintenance generator. So Depending on the Fields I have choosed, screen is automatically generated with table control : TCTRL_FSH_SOFN_V.
    Now, I have to declare a work area to store the values of the above type.
    How do i do it??
    The highlighted portion gives an syntax error as the table control is not defined.
    data: wa_FSH_SOFN_V_cols type LINE OF TCTRL_FSH_SOFN_V-COLS.
    loop at TCTRL_FSH_SOFN_V-COLS to wa_FSH_SOFN_V_cols."into .
       if sytabix = 4.
         wa_FSH_SOFN_V_cols-INVISIBLE = 1.
         MODify TCTRL_FSH_SOFN_V-COLS from wa_FSH_SOFN_V_cols.
        endif.
        endloop.

  • How to insert row in table control and save the data in tables

    Hi,
    I have one table control i am displaying data into table control ,
    my problem is : i want to display data into read mode in table control.
    but when i click on insert button on the same screen i want one blank line should inserted into table control , then i want to insert some data into table control on that row , when i click the save button . the new data inserted into the table control is insert that data into ztable ,
    please give me solution
    main problen is  how can know inserted line in table control and pass that data into ztable.

    Hi,
    Follow the below logic,
    PROCESS BEFORE OUTPUT.
      MODULE STATUS_0001.
      MODULE POPULATE_TABLE_CONTROL. --> Get the data from table store in 
                                                                          ITAB
      LOOP AT GT_CTRL_LP_D516 INTO GS_WA_CTRL_LP_D516
           WITH CONTROL CTRL_LP_D516
           CURSOR CTRL_LP_D516-CURRENT_LINE.
      The following module moves data to control
        MODULE MOVE_TO_CONTROL.--> Move data from ITAB to table control
      ENDLOOP.
    PROCESS AFTER INPUT.
      LOOP AT GT_CTRL_LP_D516.
      ENDLOOP.
      MODULE EXIT AT EXIT-COMMAND.
      MODULE USER_COMMAND_0001.  --> Here you have to take out the values from table control and update database table
    Reward points if helpful.
    Thanks and regards,
    Mallareddy Rayapureddy,
    Munich, Germany.

  • Strange issue with table control in dialog programming! Please help!

    Hello everyone:
                I have a table control on screen painter and I have atleast 10 rows on display when user calls the screen. If I have 15 columns then ofcourse user has to scroll down to see extra rows. I have line selection set to "single" for table control so that user can select only one row at a time. This works fine when user does not have to scroll to see extra rows. It is tough for me to explain i.e., if the table control displays 10 rows when the screen opens up then they can only select single row at a time (rows 1 -10). For example user selected row 7 and now they scroll down to see extra rows (for example 13) then it lets them select row 13 also even though I set line selection to "single" in the properties for table control! They should be able to select only one row at a time. Is this some limitation with table control in SAP? Please give me any information you have.
    Thanks.
    Mithun

    Hi,
    As you suspected, this is a limitation in the table control.  You need to take care of the single-selection functionality yourself except for the rows that are actually being displayed.  See [Note 588284|https://service.sap.com/sap/support/notes/588284] for the official SAP explanation.
    Regards,
    Jamie

  • Purchase Order Table Control

    Hi,
      I am trying to change the columns in the table control of the purchase order screen (ME21N) but cant seem to able to do it,
    To be more detailed I clicked on the "Configuration" button of the table control, clicked on "Administrator" and made the fields "plant/MEPO1211-WERKS" and "storage location/MEPO1211-RESLO" visible ( unchecked the fields ) but the table control does not change, I have activated the changes even created a new variant for the settings but no changes are seen, I have tried to make the other fields visible/invisible but no changes are seen.
    Help is greatly appreciated.
    Thanks

    Please check out the following note.....
    SAP Note No. 120901                          22.08.2005           Page 1         
    Number              120901                                                       
    Version             5 from 08.06.2001                                            
    Status              Released for Customer                                        
    Set on              07.06.2001                                                                               
    Language            EN                                                           
    Master language     DE                                                           
    Short text          Hiding of columns by table control is not possible                                                                               
    Responsible         SAP AG                                                       
    Component           MM-PUR                                                       
                        Purchasing                                                   
    Long text                                                                               
    Symptom                                                                          
    Using the table control configuration, you are unable to hide the                
    columns on the overview screens of the purchasing documents (purchase            
    requisition, purchase order, request for quotation, outline agreement).                                                                               
    Additional key words                                                             
    ME21, ME51, ME41, ME31, ME31K, ME31L, ME21N, ME22N, ME23N, OMF4                                                                               
    Cause and prerequisites                                                          
    The hiding of fields was and still is controlled by Customizing.Here,            
    you can - with the help of the field selection key - make fields                 
    invisible (for example, for a particular document type). This setting            
    overrides the individual table control setting.                                                                               
    Solution                                                                         
    It is currently not possible to hide columns selectively for each user.          
    Instead, SAP recommends that you shift the columns you do not require in         
    the table control to the far right and save this setting.                                                                               
    If this was helpful, please award points accordingly . Thanks.
    Regards,
    Rich Heilman

  • How to save the selected records from Table control in dialog programming

    Hiiiiiiii Every1
    Actually the problem is like this:-
    I have to select some records from table control and then want to save the selected records in DB table.
    Example
    I have some rows having inforamtion bout employees...
    Now what i want is that when i click on 'SAVE' button then these selected rows should be moved into DB table.
    Sachin Dhingra

    see below example, I have added INSERT option after DELETE option.
    REPORT demo_dynpro_tabcont_loop_at.
    CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
    DATA cols LIKE LINE OF flights-cols.
    DATA: ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm.
    DATA: itab TYPE TABLE OF demo_conn.
    TABLES demo_conn.
    SELECT * FROM spfli INTO TABLE itab.
    LOOP AT flights-cols INTO cols WHERE index GT 2.
      cols-screen-input = '0'.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
    CALL SCREEN 100.
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
    ENDMODULE.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE read_table_control INPUT.
      MODIFY itab FROM demo_conn INDEX flights-current_line.
    ENDMODULE.
    MODULE user_command_0100 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'TOGGLE'.
          LOOP AT flights-cols INTO cols WHERE index GT 2.
            IF  cols-screen-input = '0'.
              cols-screen-input = '1'.
            ELSEIF  cols-screen-input = '1'.
              cols-screen-input = '0'.
            ENDIF.
            MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDLOOP.
        WHEN 'SORT_UP'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
            cols-selected = ' '.
            MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'SORT_DOWN'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
            cols-selected = ' '.
            MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'DELETE'.
          READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
          IF sy-subrc = 0.
            LOOP AT itab INTO demo_conn WHERE mark = 'X'.
              DELETE itab.
            ENDLOOP.
          ENDIF.
        WHEN 'INSERT'.
          READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
          IF sy-subrc = 0.
            LOOP AT itab INTO demo_conn WHERE mark = 'X'.
              itab1 = itab.
              modify itab1.
            ENDLOOP.
          ENDIF.
          if not itab1 is initial.
            INSERT dbtab FROM TABLE itab1.
          endif.
      ENDCASE.
    ENDMODULE.

  • Dynamic columns in table control

    hi,
         I need to add some fields in table control in run time based on conditions given.I need to use CXTAB related ones.
    Can anyone help me with some related codes with CXTAB.
    Edited by: Ramya Ramya on Mar 8, 2011 11:21 AM

    PROCESS BEFORE OUTPUT.
    module operation.
    loop at i_vbap into wa_vbap with control tc.
    MODULE STATUS_0100.
    endloop.
    module clear.
    PROCESS AFTER INPUT.
    loop at i_vbap.
    module modify.
    endloop.
    field VBAK-VBELN MODULE USER_COMMAND_0100 on request.
    module sub.
    include mzsanpracticetop                        .    " global Data
    * INCLUDE MZSANPRACTICEO01                        .  " PBO-Modules
    * INCLUDE MZSANPRACTICEI01                        .  " PAI-Modules
    * INCLUDE MZSANPRACTICEF01                        .  " FORM-Routines
    *&      Module  STATUS_0100  OUTPUT
    *       text
    module status_0100 output.
    *  SET PF-STATUS 'xxxxxxxx'.
    *  SET TITLEBAR 'xxx'.
      move-corresponding wa_vbap to vbap.
    endmodule.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    module user_command_0100 input.
      case ok_code.
        when ''.
    *if tc-lines ne tc-current_line.
          if  lv_lines  is initial.
            select vbeln
                   erdat
                   posnr
                   matnr
                   matwa
                   matkl
                   arktx
            from vbap
            into corresponding fields of table i_vbap
            where vbeln = vbak-vbeln.
    *and  erdat = vbak-erdat.
            move : sy-dbcnt to tc-lines.
          endif.
        when 'SUB'.
          delete i_vbap where mark eq 'X'.
          tc-lines = tc-lines - tc-current_line.
      endcase.
    endmodule.                 " USER_COMMAND_0100  INPUT
    *&      Module  operation  OUTPUT
    *       text
    module operation output.
      describe table i_vbap lines lv_lines.
      if tc-lines eq 0.
        tc-lines = 1.
      endif.
    endmodule.                 " operation  OUTPUT
    *&      Module  modify  INPUT
    *       text
    module modify input.
      clear lv_lines.
      describe table i_vbap lines lv_lines.
      if lv_lines ge tc-current_line.
        if wa_vbap-mark eq 'X'.
          v_index = tc-current_line .
        endif.
        modify i_vbap from wa_vbap index tc-current_line.
      else.
        if wa_vbap-mark eq 'X'.
          v_index = tc-current_line .
        endif.
        append wa_vbap to i_vbap.
        clear wa_vbap.
      endif.
    endmodule.                 " modify  INPUT
    *&      Module  clear  OUTPUT
    *       text
    module clear output.
      clear : ok_code,
              v_index.
    endmodule.                 " clear  OUTPUT
    *&      Module  sub  INPUT
    *       text
    module sub input.
    case ok_code.
    when 'SUB'.
          delete i_vbap where mark eq 'X'.
          tc-lines = tc-lines - tc-current_line.
                when 'ADD'.
    *loop at i_vbap.
          if v_index is not initial.
            insert initial line into i_vbap index v_index.
          else.
            get cursor "  field v_fname
                       line  v_line
                       area  v_area.
            move : v_line to v_index.
            v_index = v_index + 1.
            insert initial line into i_vbap index v_index.
          endif.
    *      endloop.
          tc-lines = lv_lines + 1.
      endcase.
    endmodule.                 " sub  INPUT
    understand and use it

  • Hiding columns dynamically in a table control

    Hello all,
    Based on the selected value in a dropdown box, I want to hide some columns in a table control. The table control is generated using the wizard from a work area and itab in the program. I have tried things like
    loop at screen.
      if screen-name = <work area>-<field name>.
         screen-invisible = 1.
         modify screen.
      endif.
    endloop.
    I have also tried screen-active = 0, but it is not working. Is there any other way to achieve this?
    Thanks in advance.
    Regards,
    Nithya

    hi,
    u cant make it invisible but u can make it disable by making one module in PBO...
    MODULE init_screen OUTPUT.
      LOOP AT SCREEN.
        IF screen-name = 'ITAB_DET-BILL_NO' AND zform_track_mast-comp_code = '1000'.
          screen-input = 0.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    ENDMODULE.                 " init_screen  OUTPUT
    reward if usefull...

  • How do I execute some code when a line of a table control is selected?

    Hi,
    I would like to execute some code when a line of a table control is selected.  At the moment I have to select one or multiple rows and then press enter, this forces a screen refresh and my code is executed but I would like the code to be executed as soon as any line is selected.
    I've done something like this using ALV grids and object orientated code but is there a way of doing this in a normal non-OO table control?
    Thanks in advance.
    Gill

    Hi,
    U need to declare a char1 field for marking (mark field).  This will reflect with value 'X' in your tcontrol internal table for all the selected rows. 
    Now u need to handle the okcode for enter in your PAI.
    There u need to loop through the table for all marked fields.
    There after u can do what ever u want.
    Venkat.

  • How to change the colums of a table control scrollable?

    Hi Guys,
    I have one table control in my webdynpro component. Datais are filling to the table dynamically . Fields also may vary depending on the requirement.if some 20 or 30 fields are filling into my table in the run time, then i need to scroll the fields. Each field should be scrollable. Using which property of the table i can achieve this.??
    Can u people help me in this.
    Thanks
    Subin

    Hi
    Thanks for ur reply. Actually i am using this table control for search help. the same table control is using for the all search helps. if some 20 fields are there in th search result all the fields it is showing in my table control. eg. one costcentre field is there in my resultin table control. But it s showing only 'costcen' instead of 'costcentre.' It is not showin the resulting costcentre value also fully. for this i need to scroll the particular field alone for seeing the full value. This is my requirement.
    If i am  giving scrllable col count as 1 it is showing only one field. this is not wt i ws expecting.
    Please try to give me a solution.
    Thanks
    Subin

  • How to refresh the table control on some action

    Hi All,
         In a web Dynpro application, I am filling data to the Table control through Supply function. When  I do some action (like save new record )  i want to refresh the table control means add the newly added record.
       How to refresh the Table control.
    Thanks
    Hemalatha

    hi hema........
        if you are using a select query inside the supply function...
        then...
        you can just use node->invalidate(). method..
        it just invalidates the node that is bound to the table.
       so the supply function will be called again, which again uses the select query to fetch the values.. so that your table gets refreshed.
    ---regards,
       alex b justin

  • Give some hints that in a table control , first row will be editable and

    pls,
    give some hints that in a table control , first row will be editable and
    rest of the rows will be non-editable.

    Hi,
    Take the group1 for all the textboxes in table control as 'ABC'.
    Use this code, its working:-
    it_zekpo is my internal table w/o header line,
    wa_zekpo is work area.
    Name of input/output fields on screen are:-
    wa_zekpo-field1,
    wa_zekpo-field2, and so on...
    At screen flow-logic
    PROCESS BEFORE OUTPUT.
    *  MODULE status_8003.
      LOOP WITH CONTROL po_tb.
        MODULE read_data.
      ENDLOOP.
    PROCESS AFTER INPUT.
    *  MODULE user_command_8003.
      LOOP WITH CONTROL po_tb.
        MODULE modify_data.
      ENDLOOP.
    In PBO
    *&      Module  READ_DATA  OUTPUT
    MODULE read_data OUTPUT.
      READ TABLE it_zekpo INTO wa_zekpo INDEX po_tb-current_line. "po_tab is table control name
      "enable only first row and disable rest rows in table control.
      IF sy-subrc EQ 0.
        IF sy-tabix GE 2.
          IF screen-group1 = 'ABC'.
            LOOP AT SCREEN.
              SCREEN-INPUT = 0.
              SCREEN-ACTIVE = 0.
            ENDLOOP.
            MODIFY SCREEN.
          ENDIF.
        ENDIF.
      "disable empty rows
      ELSE.
        IF screen-group1 = 'ABC'.
          LOOP AT SCREEN.
            SCREEN-INPUT = 0.
            SCREEN-ACTIVE = 0.
          ENDLOOP.
          MODIFY SCREEN.
        ENDIF.
      ENDIF.
      data : line_count type i.
      describe it_zekpo
      lines line_count.
      po_tb-lines = line_count + 10.
      "to increase the number of lines in table control dynamically
    ENDMODULE.                 " READ_DATA  OUTPUT
    In PAI
    *&      Module  MODIFY_DATA  INPUT
    MODULE MODIFY_DATA INPUT.
      MODIFY IT_ZEKPO FROM WA_ZEKPO INDEX po_tb-currentline.
    ENDMODULE.                 " MODIFY_DATA  INPUT
    Hope this solves your problem.
    Thanks & Regards,
    Tarun Gambhir

Maybe you are looking for

  • VPN 720 error with win 8 with Cisco VPN client 5.0.07.0440

    Hello, I have Win 2008 configured as RRAS- VPN server, with win 7/8 VPN clients. half of these client machines are also running "Cisco VPN client 5.0.07.0440" all win 7 machines works fine however most of Win 8 will not connect to windows VPN, if the

  • Does it make sense to create a worker role for data access to DocumentDB?

    Hi, I'm building an ASP.NET MVC app that will run on Azure. I'm using DocumentDB as its back-end database. Sometimes, I return multiple data sets from different collections that need to be "reorganized". I handle this using LINQ in my application cod

  • How to transport source system dependent objects

    Hi everybody, I've read several questions about how to transport source dependent objects between systems and I still don't get whole picture say I have BWDEV attached to R3DEV and            BWQA attached to R3QA and I want to transport transfer rul

  • SCOM server monitoring

    Hi, Can we monitor a server through SCOM of which we cant take RDP directly but only  by logging in through another server. The server which we want to monitor is also in DMZ . Thanks 

  • How to install Compiz plugin "Toggle Decoration"?

    I havent found it anywhere. Its wiped clean from the earth? How do I get my hands on the plugin "Toggle Decoration"?