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

ALV Grid screen width?

Clemenss
Active Contributor
0 Likes
748

Hi,

I want to display some date in an ALV popup. The columns and the contents are determined dynamically at runtime.

I want to set the popup columns width (roughly) according to the displayed contents (col_width optimized).

Is there any method to calculate the display width in SAPGUI.

TIA,

Regards,

Clemens

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
609

Have you tried setting the parameter lvc_s_layo-cwidth_opt which can be used in method like this ?

CALL METHOD go_alvgrid->set_table_for_first_display

EXPORTING

is_layout = gs_layout

Or am i missing something ?

Cheers

Kareem

3 REPLIES 3
Read only

reedtzj
Active Participant
0 Likes
609

Hi,

You might try FM REUSE_ALV_LIST_WIDTH_GET.

I have not used it myself but when I inspect the code it looks rather promising.

If the FM does help - can you please indicate so for others to benefit from?

Best regards, Johan

Read only

Former Member
0 Likes
610

Have you tried setting the parameter lvc_s_layo-cwidth_opt which can be used in method like this ?

CALL METHOD go_alvgrid->set_table_for_first_display

EXPORTING

is_layout = gs_layout

Or am i missing something ?

Cheers

Kareem

Read only

Clemenss
Active Contributor
0 Likes
609

Thanks Johan for the FM REUSE_ALV_LIST_WIDTH_GET. Actually this is not what I hoped for - it does regard column width optimization and it does not know about font size and so on.

Anyway, customer is satified with fixed size.

Regards,

Clemens