cancel
Showing results for 
Search instead for 
Did you mean: 

Browser Width

nmadgavkar
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello,

Is there any way I can get the browser width using which I can adjust the width

property in the overflow container ?

Thanks & Regards,

Namita.

Accepted Solutions (0)

Answers (1)

Answers (1)

GrahamRobbo
Active Contributor
0 Kudos

Hi Nam,

this is very browser specific, but in principle you can get this out of the HTTP request header.

This is implemented using the interface IF_CLIENT_INFO. So you can do something like this.

DATA: client_info TYPE REF TO IF_CLIENT_INFO
DATA: l_pixel_width TYPE float.
client_info = runtime->client_info.
l_pixel_width = client_info->get_pixel_width( ).

Just whether or not this method returns anything useful depends upon how well the browser client has filled the HTTP request headers.

Cheers

Graham

nmadgavkar
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Graham,

That was very helpful and I believe this is what I am looking for. However, as you rightly said, whether or not this method returns anything useful depends upon how the browser client has filled the HTTP request headers. The method does not return any value. Can you give me any tips as to what I should do such that the HTTP request headers are appropriately filled to return pixel width.

Thanks & Regards,

Namita.

GrahamRobbo
Active Contributor
0 Kudos

Hi Nam,

there is nothing you can do about this. These header attributes are filled entirely at the whim of the browser. Many of these attributes that describe the screen geometry are only used by Pocket browsers and WAP browsers.

You should probably look at using percentage values for width attributes. If you want a UI element to fill all available space try a width of 100%.

Remember you can use the same technique to determine your browser type and therefore render the screen slightly differently for each type of client.

Cheers

Graham