Application Development 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: 

Get dynpro width / height

Former Member
0 Kudos

Hey guys,

whats that crap with specifing the width / height of a dynpro in lines and columns?

I try to find a value for the "extension" parameter of cl_gui_docking_container constructor.

What I want to achieve is that this parameter is filled with the current dynpro width (or height if I dock the container on top). But all I have is the current number of columns from sy-scols (or lines from sy-srows). The extension parameter can use millimeters or pixels but not columns or lines.

Can anyone tell me how to convert columns (rows) to millimeters?

Thanks in advance for all answers!

Best regards,

Torben

1 ACCEPTED SOLUTION

MarcinPciak
Active Contributor
0 Kudos

Hi Torben,

Though it sound a bit wird to me to set docking container to entire screen width/height, it is still feasible and if this is the requirement...

You can get ratio of docking container to its residing screen. Then multiply it accordingly and set new extension:


DATA: r_dock TYPE REF TO cl_gui_docking_container.

CALL SCREEN 100.

MODULE pbo OUTPUT.
  DATA: perc TYPE i,
        extension TYPE i VALUE 100.


  CREATE OBJECT r_dock
    EXPORTING
      side                        = cl_gui_docking_container=>dock_at_left
      extension                   = extension.

  r_dock->get_ratio( IMPORTING ratio = perc ).
  extension = 100 * extension / perc.
  r_dock->set_extension( extension ).  "entire width of the screen

ENDMODULE.                    "pbo OUTPUT

Regards

Marcin

1 REPLY 1

MarcinPciak
Active Contributor
0 Kudos

Hi Torben,

Though it sound a bit wird to me to set docking container to entire screen width/height, it is still feasible and if this is the requirement...

You can get ratio of docking container to its residing screen. Then multiply it accordingly and set new extension:


DATA: r_dock TYPE REF TO cl_gui_docking_container.

CALL SCREEN 100.

MODULE pbo OUTPUT.
  DATA: perc TYPE i,
        extension TYPE i VALUE 100.


  CREATE OBJECT r_dock
    EXPORTING
      side                        = cl_gui_docking_container=>dock_at_left
      extension                   = extension.

  r_dock->get_ratio( IMPORTING ratio = perc ).
  extension = 100 * extension / perc.
  r_dock->set_extension( extension ).  "entire width of the screen

ENDMODULE.                    "pbo OUTPUT

Regards

Marcin