Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Dynamically resizing table control

Former Member
0 Likes
1,998

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,123

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

3 REPLIES 3
Read only

Former Member
0 Likes
1,124

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

Read only

0 Likes
1,123

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

Read only

Former Member
0 Likes
1,123

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]