Dynamically resizing table control

Hi all,
I have designed a table control in the screen. in that, I have fixed the number of columns (7) using Fixed coulmns option in the screen painter. But, when the user selects an option (radio button) in the screen, I will hide two columns of the table control. So, now I want to resize the table control i.e. reduce the horizontal width of the table control.
How can I achieve this?
Please help me....
Thanks,
Rajan

Hi,
Suppose your screen is 9000
Now in PBO define a module set_attr_table and handle
handle it via your button -
PROCESS BEFORE OUTPUT.
  MODULE status_9000.
  MODULE set_attr_table.
  LOOP AT  t_lips3 INTO w_lips3_ds WITH CONTROL
           t_inbd CURSOR t_inbd-top_line.
  ENDLOOP.
Where if you have already defined
CONTROLS: t_inbd       TYPE TABLEVIEW USING SCREEN '9000'.
t_lips3 is the table you are using to display records from.      
In the module set_attr_table try to change the the table control dynamically -
DATA: w_ls_cer_inbd_ds  LIKE LINE OF t_inbd-cols.
Try to modify the column attributes dynamically by modifying the screen table contents
LOOP AT t_inbd-cols INTO w_ls_cer_inbd_ds.
      IF sy-tabix = 5 or sy-tabix = 6.
        w_ls_cer_inbd_ds-invisible = 1.
        MODIFY t_inbd-cols FROM w_ls_cer_inbd_ds TRANSPORTING invisible.
      ENDIF.
    ENDLOOP.
Say column 5 and 6 you want to change.
Thanks

Similar Messages

  • Is it possible to change nunmber of columns dynamically in table control

    Is it possible to change number of columns dynamically in table control? if so how it could be done?
    Thnaks in advance.
    Sounder

    You can update the table control in your program, the table control is a structure of the type CXTAB_CONTROL of TYPE-POOLS cxtab.
    There you can hide or display column the same way you do for fields in LOOP AT SCREEN. there you will ahve to LOOP AT <control>-COLS.
    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

  • Add Fields dynamically to table control

    Hello Folks ,
    i'm trying to add some filed to standard table control and this require from me to take action of repair (modification ) .
    insted of make repair i consider the option of make an enhancement and dynamically (by code ) add the required fileds to table control .
    is there anyone that know if it's possible or not and how to do this .
    Regards,
    Herzel .

    Hi,
        You can use ALV for input purpose as well. Check out OO ALV programs. SE38 -> BCAlVEDIT* , tons of programs available.
    a) Input from user - In ALV, this is possible
    b) F4 help - Possible with ALV
    Not sure why would you need material number and description in the same column and that too one below another. It is possible with lot of tweaking but still requirement is strange and you need to have at least two rows for the same MATNR, one with the number and other with description.
    Refer the links:
    Re: Adding dynamic columns in Table Control
    Re: Adding dynamic columns in Table Control
    Could anyone tell me how can I add columns in a internal table dynamically?
    Re: Dynamic Table Control
    <b>Reward points</b>
    Regards

  • Is it possible to create Table Controls(in Dynpro) dynamically

    HI All
    I am not sure if we can create screen elements dynamically especially Table Controls. I need to create a Table control in a custom screen but the fields/columns in the table control are known at run time. Is it possible?? Appreciate any light on this subject.
    Thanks
    Van

    hi
    ccheck for the link
    Check following link for the same.
    https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=https%3A//forums.sdn.sap.com/thread.jspa%3FforumID%3D52%26threadID%3D45079%26messageID%3D459011%23459011
    also take a look at the FM
    take a look at FM:
    FREE_SELECTIONS_INIT
    FREE_SELECTIONS_DIALOG
    hope will be helpfull to you.
    regards
    vijay
    <u><b>plz reward pts if helpful</b></u>

  • Dynamic coloumn creation in TABLE CONTROL

    Hi all,
    i am using table control in the user interface.
    here, how to create columns dynamically in table control?
    thanks in advance.
    Vinod.S

    Hi Vinond,
    Have you got the solution for this. If so please share with me.
    I too have the same requirement.
    Regards
    Prasath

  • Dynamic Fields in Table control......

    hi friends,
    i wan to knw , is it possible to add fields dynamically in table control? actually the requirement is like, it is not fixed how many fields will be their in table control, it may change depending upon date. so if u knw, please help me out....
    good points will be awarded to helpful answer.....
    Thanks,
    Brij

    Hi Harsha,
    I generated a table control (ERP 6.2) and somewhere I found the coding like this (the name of the table control is TABLE_CONTROL):
    *&spwizard: output module for tc 'TABLE_CONTROL'. do not change this lin
    *&spwizard: get lines of tablecontrol
    module TABLE_CONTROL_get_lines output.
      g_TABLE_CONTROL_lines = sy-loopc.
    If I do a loop at the screen at this place, I can control the individual input/output for the screen fields (the table fields). In my work area (WA_CONTROL) I can see the actual value of fields. Depending on this, I choose to enable/disable input via:
    loop at screen.
    if wa_control-material <> ' '.
    screen-input = '0'.
    modify screen.
    endif.
    endloop.

  • Is it possible to creat Table Controls(Dynpro) dynamically

    HI All
    I am not sure if we can create screen elements dynamically especially Table Controls. I need to create a Table control in a custom screen but the fields/columns in the table control are known at run time. Is it possible?? Appreciate any light on this subject.
    Thanks
    Van

    hi
    ccheck for the link
    Check following link for the same.
    https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=https%3A//forums.sdn.sap.com/thread.jspa%3FforumID%3D52%26threadID%3D45079%26messageID%3D459011%23459011
    also take a look at the FM
    take a look at FM:
    FREE_SELECTIONS_INIT
    FREE_SELECTIONS_DIALOG
    hope will be helpfull to you.
    regards
    vijay
    <u><b>plz reward pts if helpful</b></u>

  • Regarding page down in the table control veritcally

    Hi all,
              I have an issue regarding page down in the Table control in module pool , i.e when i m click the vertical scroll bar and going for page down then , the control is flowing to the next sceen which is not needed , and it shuld just scroll down and up vetically.
    Can anyone help me how to handle the page down event ?
    Thanks & regards,
    satya

    Table Controls: Examples with Scrolling
    The following example processes a table control with LOOP without parallel loop using an internal table. In addition to the scroll bar, the user can also carry out program-controlled scrolling with function codes.
    REPORT demo_dynpro_tabcont_loop.
    CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
    DATA: ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm.
    DATA: itab TYPE TABLE OF demo_conn,
          fill TYPE i.
          TABLES demo_conn.
    DATA: lines TYPE i,
          limit TYPE i.
    SELECT * FROM spfli INTO CORRESPONDING FIELDS OF TABLE itab.
    CALL SCREEN 100.
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
      DESCRIBE TABLE itab LINES fill.
      flights-lines = fill.
    ENDMODULE.
    MODULE fill_table_control OUTPUT.
      READ TABLE itab INTO demo_conn INDEX flights-current_line.
    ENDMODULE.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE read_table_control INPUT.
      lines = sy-loopc.
      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 'NEXT_LINE'.
          flights-top_line = flights-top_line + 1.
          limit = fill - lines + 1.
          IF flights-top_line > limit.
            flights-top_line = limit.
          ENDIF.
        WHEN 'PREV_LINE'.
          flights-top_line = flights-top_line - 1.
          IF flights-top_line < 0.
            flights-top_line = 0.
          ENDIF.
        WHEN 'NEXT_PAGE'.
          flights-top_line = flights-top_line + lines.
          limit = fill - lines + 1.
          IF flights-top_line > limit.
            flights-top_line = limit.
          ENDIF.
        WHEN 'PREV_PAGE'.
          flights-top_line = flights-top_line - lines.
          IF flights-top_line < 0.
            flights-top_line = 0.
          ENDIF.
        WHEN 'LAST_PAGE'.
          flights-top_line =  fill - lines + 1.
        WHEN 'FIRST_PAGE'.
          flights-top_line = 0.
      ENDCASE.
    ENDMODULE.
    The layout of screen 100 is:
    A resizable table control called FLIGHTS is defined. The fields of the table control are transferred from the structure DEMO_CONN in the ABAP Dictionary. The first two columns are lead columns. The corresponding fields are output fields. A title bar, column headers, and a selection column are created. The component MARK of type character with length 1 from structure DEMO_CONN is assigned to the selection column. You can select one column and several lines.
    It has the following flow logic:
    PROCESS BEFORE OUTPUT.
      MODULE status_0100.
      LOOP WITH CONTROL flights.
        MODULE fill_table_control.
    ENDLOOP.
    PROCESS AFTER INPUT.
      MODULE cancel AT EXIT-COMMAND.
      LOOP WITH CONTROL flights.
        MODULE read_table_control.
    ENDLOOP.
      MODULE user_command_0100.
    The system executes a loop at PBO and PAI using the table control FLIGHTS. During the PBO loop, a module is called to fill the table control from table ITAB of the ABAP program. During the PAI loop, a module is called to modify table ITAB.
    Before the PBO loop, in the module STATUS_0100 the current number of lines of the internal table ITAB is placed in component LINES of control structure FLIGHTS. This helps the system to correctly install the scroll bar of the table control.
    During the PBO loop, in the module FILL_TABLE_CONTROL the work area DEMO_CONN is filled with values from the internal table, where the row index corresponds to the current row of the table control.
    During the PAI loop, in the module READ_TABLE_CONTROL the current number of the loop SY-LOOPC in the table control is placed an auxiliary variable. The number is dependent on the size of the screen. The rows of the internal table, whose row index corresponds to the current row of the table control, are overwritten with the contents of the work area DEMO_CONN. User input is transferred from the input fields of the control to the internal table. In particular, the internal table also contains a flag in the column MARK to indicate whether the row of the table control is selected or not.
    After the PAI loop, user input is processed in the module USER_COMMAND. The GUI status SCREEN_100 provides the appropriate function codes. You can scroll line by line or page by page, or Goto the first or last page. You can implement scrolling by setting the component TOP_LINE of control structure FLIGHTS. For page-by-page scrolling the auxiliary variable that is filled in the PAI loop by SY-LOOPC is used as the step size.

  • Adding dinamic fields into table control..

    hi friends,
    i wan to knw , is it possible to add fields dynamically in table control? actually the requirement is like, it is not fixed how many fields will be their in table control, it may change depending upon date. so if u knw, please help me out....
    good points will be awarded to helpful answer.....
    Thanks,
    Brij

    HI,
    at the design time of the screen make all possible columns or fields in the table control,make sure you are having all the fileds in the itab.
    now go to the pbo of the screen.
    inside the loop endloop of table control write loop at screen .
    inside this loop for all the fields base dupon condition you dont want to appear make screen-invisible = '1'.
    modify screen.
    hope this solves your query...
    thanks
    vivekanand

  • Older Business HTML and Dynamic Page Table question

    I am not sure if anyone will know here (or if this is the best place to post), but I have a question concerning using the Business HTML template library controls/API for use with ITS. I am attempting to use the "Dynamic Page Table" control, and have hit some problems. Does anyone have any example code they can share on getting this to work correctly (ie, paging through records, selecting from rows, etc)? I have "torn apart" the underlying Javascript and even modified my code to adjust for some formatting issues that the API's do not handle, however, my "pages" all display at once in the beginning and only hide when I use one of the paging icons (forward,back,all back, etc). THe "isVisible" parameter seems to do nothing for the "page" DIVs. Currently running the latest version of ITS and R/3 4.6b on the backend if that helps. Also, the example from the SAP Design Guild cookbook is very basic and does not "page" as I need. Thanks in advance!
    CSolomon

    Check the following Tables
    FND_FORM_CUSTOM_RULES
    FND_FORM_CUSTOM_SCOPES
    FND_FORM_CUSTOM_ACTIONS
    FND_FORM_CUSTOM_PARAMS

  • How to make table control rows dynamic/unlimited using TC with Wizard

    Hi Friends ,
    I have designed a table control layout using table control with wizard.
    Now the problem is when we design a TC layout ,then we have to design it on the page . The page has upper & lower limits. so the maximum size & maximum rows in layout is limited. I have tried to create a TC layout with maximum size & maximum rows . Maximum rows created in Layout is 25.
    Now suppose if enduser wants 100 entries to enter by coping a file of 100 records in my TC present on entry screen , then ONLY 25 entries are displayed on entry scren before doing any user action or saving and after saving only these 25 entries are sved in DB. Means enrtries from 26 to 100 are not displayed on entry screen or saved in DB.
    So my requirement is to display all 100 entries at a time in entry screen before saving with scrolling up & down facility and these 100 entries should also get saved in DB after clicking save button. In short I want dynamic entry screen table control which can show/dieplay Any Number . of entries whatever the number may be entered by enduser .
    Plz note that I have used all 3 facilliteis i.e.
    1. Scrolling
    2. INSERT/DELETE
    3. SELECT/DESELECT
    while designing TC with wizard .
    Scrolling buttons like FIRST PAGE, PREV. PAGE, NEXT PAGE, LAST PAGE are displayed.
    BUT they are not functioning though there is system generated code present in both MPP and in PBO & PAI. After clicking any of them , data which is dislaying on entry screen ( Here it is 25 entries ) is getting cleared/disappeared from enry entry screen.
    Waiting for ur response & solutions.
    Thanks & Regards,
    Sudhir

    Hi Ashish ,
    Do one thing .
    At PAI of screen holding TC , there is module name tc_mark on request .
    in this module , there is work area declared g_tc_wa .
    Now go to tc_init module of pbo , where u have given your select command .
    select * from ........................................
    use this code .
    if g_tc_wa is initial .
       SELECT * FROm
       g_tc_wa = 'X'.
       REFRESH CONTROL 'TC' FROM SCREEN dynnr.
       ENDIF.
    Just do this , m sure all buttons, insert, delete , scroll bar.. everything will work .

  • Dynamic header text in table control - Dialog programming

    Hi All,
    I have a table control on one of my dialog screens.  I need to dynamically change the column header texts on this control in my PBO.  Does anyone know how to do this?  I have found all kinds of ways to modify the other characteristics of the fields at run time in the PBO (active, input/output, invisible, etc.) - but not to change the header text!  Any help is appreciated.
    thanks,
    Matt

    Hi Hymavathi,
    I appreciate your help!  This didn't solve the issue, however,...I have used the method you'd mentioned before (many times) for setting it inside the loop at screen:
    %_<screenname>_%_APP_%-TEXT = <text something>.
    - but only in ABAP reports.  It doesn't seem to recogize it (the table control column header text) within a dialog program.  I keep getting a compile error. (saying that the %_<screenname>_%_APP_%-TEXT doesn't exist.
    I tried the suggestion that you stated below (from lateesh) - yet it only let me place i/o field in title text area (not the column header text).  Am still searching...

  • Dynamic rows in Table Control

    Hi Experts,
    My Requirement is create a table control with 5 coloumns. The rows have to be displayed dynamically...
    I created a screen , and placed a table control.
    For eg :
       if my internal table having 2 entries , then the table control should only have two rows....(no disable/greyout)
       if internal table having say 40 entries , then the table control should have 40 rows...
    Thanks,
    Lakshmiraj.A

    Hi,
    Refer
    table control dynamic rows
    Dynamic rows increment according to user input in Table Control Module Pool
    Hope this helps
    Sumana

  • Dynamic display in table control

    hi all,
    i hav an issue regarding Module Pool programming. i wnt 2 disply table control with dynamic enteries both at header level and the content level, ie. the values of the heading shud com 4m an internal table and the values a user enters shud go 2 another internal tab. i cannot take the values of one column of d tab contrl in a diff internal tab n so on for all headers.

    See dis ‘ll b design format,
    Screen 1  delivrry no._________
    In PAI it’ll find total no. of material no. n other details.
    Screen 2. (header) <b>matnr1</b>    <b>matnr2</b>  <b>matnr3</b>……(cmng from int tab 1 on which d loop is defined in PBO of screen 2)
                                <b>Ser1         Ser2      Ser3          </b> (entered by the user)
                                <b>Ser11       Ser22</b>     
                                <b>Ser12</b>       ……
                               <b>button</b>( to tk this combination in one int table in the  followng format for running it in BDC)
    matnr1    Ser1 
    matnr1    Ser11
    matnr1    Ser12
    matnr2    Ser2
    matnr2    Ser22
    matnr3    Ser3
    revert if nt clear

  • Dynamic text in module pool table control

    Hi ,
    Can we have dynamic header text in module pool table control. Like dynamic header text in ALV report.
    Thanks,
    Prem.

    Hi,
    Populate an internal table with the header text that you want.
    Replace the headers with I/O fields.
    Populate the Headers in the PBO.

Maybe you are looking for

  • Interface slow/buggy with two user accounts?

    I've recently created a second user account on my 2009 27" iMac and ever since I've been having weird things happening, such as flash videos in safari becoming unresponsive (literally frozen) untill I move the safari window, which gets the video to p

  • Changing user accounts on bb app world

    Help. I am using a blackberry bold that was my sisters. all her account info is on the phone. i can i change the blackberry app world to my account details without wiping the phone completely??

  • Critical abap hr req - How to find the previous org unit of the employee?

    Hi Experts , I need small inputs from your end... I need to find the employee org unit based on the latest one..... i just want to know if an employe is Transfered from the org unit .....we can check it from the ORG unit. My requirement is to now cap

  • Bookmark titles being truncated at 40 characters

    I have created heading styles (H1-H5) in my Word Document.  When I convert the file to a PDF and create Bookmarks, the long heading titles are truncated at 40 characters when I create the Bookmark structure.  Any advice for fixing the truncation issu

  • /bin/sh: bad interpreter: Operation not permitted error OS X Lion

    I am trying to install omnetpp-4.2.2 on OS X Lion. When I try to configure I get the following error msg: -bash: ./configure: /bin/sh: bad interpreter: Operation not permitted. Sudo ./configure didn't help. Highly appreciate your help.