cancel
Showing results for 
Search instead for 
Did you mean: 

Multi component ABAP WD application layout

Former Member
0 Kudos

Hi,

I am very new to the world of ABAP WD application development. My first task is to create a WD Application with three component views, in a two column format. In the old HTML days, the page would look something like this:

<html>

<body>

<table width='100%' border=1 colspan = 2>

<tr>

<td width='40%'>Component 1</td>

<td rowspan=2>Component 3</td>

</tr>

<tr>

<td>Component 2 Usage SALV_WD_ALV</td>

</tr>

</html>

I have tried all the different combinations of layouts and widths but the problem is with the component that implements the ALV grid. There does not seem to be an obvious way of fixing the size of this window. Tbus, depending on the number of columns, the view can take up the entire browser window and I have to scroll to get to Component 3. Not very nice. I would rather have the scroll across the ALV grid

Any assistance would be greatly appreciated.

In anticipation.

John

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi, To have horizontal scrollbar, you will have to follow the following 3 steps, 1. Goto the Application->Parameter tab and set the WDTABLENAVIGATION = SCROLLBAR 2. Now we will use the SET_SCROLLABLE_COL_COUNT method to set the displayed number of columns. Any fixed columns are not counted, so if we want 5 columns displayed total and one of them will always be fixed, we need to set the value to 4.

l_table->if_salv_wd_table_settings~set_scrollable_col_count( '4' ).
3.Now we need to get access to the column object for the colums that we want to fix(should be always displayed ). CL_SALV_WD_COLUMN, has the method SET_FIXED_POSITION that we need. It is possible to fix columns to either the right or left side of the ALV table display.
DATA o_carrid TYPE REF TO cl_salv_wd_column.
  o_carrid = l_table->if_salv_wd_column_settings~get_column( 'COL1' ). " Column 1 ( Attribute Name )
  o_carrid->set_fixed_position( cl_wd_abstr_table_column=>e_fixed_position-left ).
If you were going to fix more than one column, then you might want to consider calling GET_COLUMNS instead of GET_COLUMN. This will alternative method will return an internal table filled with object references for each column in the ALV table - allowing for easier processing of multiple columns. Regards, Radhika.

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

In addition to what Radhika has mentioned, you can even add the code to set the width of the table.

DATA lr_table_settings TYPE REF TO if_salv_wd_table_settings.

lr_table_settings ?= lo_value .

lr_table_settings->set_width( '990' ).

Regards,

Priya

Former Member
0 Kudos

The responses have been most helpful.

Unfortunately, the only parameters available in the application are:

WDCONFIGURATIONID Configuration Name

WDPROTECTEDAPPLICATION Save Application

WDSKIPSPLASHSCREEN Do Not Display Splash Screen

How can I get the WDTABLENAVIGATION to be available? Note the table is being embedded in a ViewContainer element into which the data table is bound.

Thanks,

John

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> The responses have been most helpful.

>

> Unfortunately, the only parameters available in the application are:

>

> WDCONFIGURATIONID Configuration Name

> WDPROTECTEDAPPLICATION Save Application

> WDSKIPSPLASHSCREEN Do Not Display Splash Screen

>

> How can I get the WDTABLENAVIGATION to be available? Note the table is being embedded in a ViewContainer element into which the data table is bound.

>

> Thanks,

> John

What is your support package level? If you don't have WDTABLENAVIGATION, then I would suspect that your support package level is very old. Scroll bars for the table was added around SP12, if I remember right.

Former Member
0 Kudos

You are correct, Thomas. The patch level in 9, which as you mentioned is a little out of date.

Thank you.

John