cancel
Showing results for 
Search instead for 
Did you mean: 

Horizontal and vertical scroll to ALV

Former Member
0 Kudos

Hi Friends,

As I am new to Web dynpro. Please let me know how to set horizontal and vertical scrollbars to ALV.

Thanks for help in advance.

Madhu MV.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Also let me know if there are any documents specific to ALVs..

2. Also i wanted to know how to set Hotspot on perticular column (highlight a column)

Former Member
0 Kudos

Hi,

Kindly refer link http://help.sap.com/saphelp_nw04s/helpdata/en/7f/849e6d796d4fe49221609ffcbc357d/frameset.htm

This has all details about ALV

Once table settings for ALV is done. scroll bars will automatically come depending upon the data in ALV.

Refer for Column setting to this link

http://help.sap.com/saphelp_nw04s/helpdata/en/7f/849e6d796d4fe49221609ffcbc357d/frameset.htm

Regards,

Priya

arjun_thakur
Active Contributor
0 Kudos

Hi,

To get a hotspot on a perticular column, you have to use a UI element which should trigger some event like LinkToAction or LinkToUrl. Refer the column code in which one column is made a LinkToAction.


data: l_ref_cmp_usage type ref to if_wd_component_usage.
  l_ref_cmp_usage =   wd_this->wd_cpuse_alv_first( ). "alv_first is the name of the alv component I have used.
  if l_ref_cmp_usage->has_active_component( ) is initial.
    l_ref_cmp_usage->create_component( ).
  endif.

  data l_salv_wd_table type ref to iwci_salv_wd_table.
  l_salv_wd_table = wd_this->wd_cpifc_alv_first( ).
  data l_table type ref to cl_salv_wd_config_table.
  l_table = l_salv_wd_table->get_model( ).
  data l_column type ref to cl_salv_wd_column.

 data linkview type ref to cl_salv_wd_uie_link_to_action.
  l_column = l_table->if_salv_wd_column_settings~get_column( 'CONNID' ). " Connid is the name of column which will be linktoaction. 
  create object linkview.
  linkview->set_text_fieldname( 'CONNID' ).
  l_column->set_cell_editor( linkview ).
  l_table->if_salv_wd_table_settings~set_scrollable_col_count( 2 ). " This create horizontal scroll bar.

Also refer this [article|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/bd28494a-0801-0010-45a3-fc359d82d3e8].

I hope it helps.

Regards

Arjun

Edited by: Arjun Thakur on Apr 17, 2009 12:03 PM

Former Member
0 Kudos

If you want to set hotspot ,you need to complete two tasks.

First,you need to create column UI element LINK in ALV.

Second,you need to create event hander method. You need to assign 'ON_CLICK' event to this method. When you click one cell,this method will be called. You can edit this method and add your

logic code .

-


method ONACTIONSEARCH .

  • Sets Link for column

DATA: LR_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE,

LR_CONFIG_TABLE TYPE REF TO CL_SALV_WD_CONFIG_TABLE,

LR_SALV_SETTINGS TYPE REF TO IF_SALV_WD_TABLE_SETTINGS,

LR_COLUMN TYPE REF TO CL_SALV_WD_COLUMN,

LR_LINK TYPE REF TO CL_SALV_WD_UIE_LINK_TO_ACTION.

LR_INTERFACECONTROLLER = WD_THIS->WD_CPIFC_ALV_GRID( ).

LR_CONFIG_TABLE = LR_INTERFACECONTROLLER->GET_MODEL( ).

LR_SALV_SETTINGS ?= LR_CONFIG_TABLE.

LR_COLUMN = LR_CONFIG_TABLE->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'CUSTOMID' ).

CREATE OBJECT LR_LINK.

CALL METHOD LR_LINK->SET_TEXT_FIELDNAME

EXPORTING

VALUE = 'CUSTOMID'.

CALL METHOD LR_COLUMN->SET_CELL_EDITOR

EXPORTING

VALUE = LR_LINK.

endmethod.

-


method CLICK_CELL .

  • Define local variables

DATA: LV_CUSTOMID TYPE SBOOK-CUSTOMID,

LR_CMP_API TYPE REF TO IF_WD_COMPONENT,

LR_WINDOW_MANAGER TYPE REF TO IF_WD_WINDOW_MANAGER.

FIELD-SYMBOLS: <L_VALUE> TYPE ANY.

  • Read Customer ID

ASSIGN R_PARAM->VALUE->* TO <L_VALUE>.

LV_CUSTOMID = <L_VALUE>.

endmehod.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You just need to set the scrollable column property:

data l_salv_wd_table type ref to iwci_salv_wd_table.

l_salv_wd_table = wd_this->wd_cpifc_alv( ).

data l_table type ref to cl_salv_wd_config_table.

l_table = l_salv_wd_table->get_model( ).

l_table->if_salv_wd_table_settings~set_scrollable_col_count( 8 ).