‎2009 Apr 06 11:34 AM
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
‎2009 Apr 07 7:54 AM
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
‎2009 Apr 07 7:54 AM
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
‎2009 Apr 07 11:57 AM
Hi Amurta,
Thanks for the reply!
As I said above, I have already hidden two columns. But, my problem is after hiding those columns there is a blank space after the final column.
I want this blank space to be removed. so, I want to resize the table control after hiding those coulmns.
Thanks
Rajan
‎2009 Apr 10 9:28 AM
Hi
Check out the link
[https://www.sdn.sap.com/irj/scn/advancedsearch?query=resizingtablecontrolwidth&cat=sdn_all|https://www.sdn.sap.com/irj/scn/advancedsearch?query=resizingtablecontrolwidth&cat=sdn_all]