cancel
Showing results for 
Search instead for 
Did you mean: 

ALV Colmns freeze

vijay_ramarao
Explorer
0 Kudos

Dear Friends,

Is it possible to freez (when scrolled) first few columns in ABAP Webdynpro ALV?

Regards,

Vijay.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Use this method SET_FIXED_POSITION of class cl_salv_wd_column to fix the postion of your column.

Refer this help document

http://help.sap.com/saphelp_nw70/helpdata/EN/43/98b9423d17c511e10000000a1550b0/frameset.htm

First you have to fetch all alv columns and then loop at each columns and get reference of it, then you can call above mentioned method.

You can also make a where used list of mentioned method to find sample usages.

Regards

Manas Dua

Answers (1)

Answers (1)

Former Member
0 Kudos

Vijay - Manas has answered your question but I will provide you the code so you can follow the steps:



data: lr_column Type Ref To cl_salv_wd_column,
lv_value Type Ref To cl_salv_wd_config_table,
lr_cmp_usage Type Ref To if_wd_component_usage,
lo_interfacecontroller Type Ref To iwci_salv_wd_table.
 
lr_cmp_usage = wd_this->wd_cpuse_alv( ).  *ALV is the name you enter for your component usage when declaring component SALV_WD_TABLE at the beginning.
if lr_cmp_usage->has_active_component( ) IS INITIAL.
lr_cmp_usage->create_component( ).
endif.
 
lo_interfacecontroller = wd_this->wd_cpifc_alv( ). *once again your ALV name
lv_value = lo_interfacecontroller->get_model( ).
lr_column = lv_value->if_salv_wd_column_settings~get_column( 'Your Attribute name of the column' ).
lr_column->set_fixed_position( cl_wd_abstr_table_column=>e_fixed_position-left ).  * here it locked your column at the left side of the screen

Good Luck!

Thanks!

Jason PV

vijay_ramarao
Explorer
0 Kudos

Thanks to both of you. Still I couldnt resolve this issue.

When I execute to see my ALV output, I have scroll bar to my browser, but not to my ALV table.

A basic question here, do u have scroll bar to ur ALV? if yes, please let me know how to achive that?

as long as we have scrollbar to our browser I dont think so its possible.

Regards,

Vijay.

Former Member
0 Kudos

Vijay - you are correct, webdynpro code don't control the web browser scroll bar (if someone know, please post)

But you can add a scroll bar to your ALV with the following code, let's say that you have 15 columns in your ALV so you will set it to less than 15 so you have the scroll bar available in your screen you can implemented with the other code in my last post:



 DATA:   lo_cmp_usage            TYPE REF TO if_wd_component_usage,
          lo_interfacecontroller  TYPE REF TO iwci_salv_wd_table,
          lo_value                TYPE REF TO cl_salv_wd_config_table,
          lo_table_settings       TYPE REF TO if_salv_wd_table_settings.

  lo_cmp_usage = wd_this->wd_cpuse_alv( ).  "your ALV name in the component usage
  IF lo_cmp_usage->has_active_component( ) IS INITIAL.
    lo_cmp_usage->create_component( ).
  ENDIF.

  lo_interfacecontroller = wd_this->wd_cpifc_alv( ).
  lo_value = lo_interfacecontroller->get_model( ).

  IF lo_value IS NOT INITIAL.
    lo_table_settings ?= lo_value. 
    lo_table_settings->set_scrollable_col_count( 10 ). "here you can play with the number, remember that it needs to be less than your total columns.
  ENDIF.

Hope this help.

Please provide points if is helpful!

Jason PV

murali_ram
Participant
0 Kudos

is it possible to freeze first row of the alv webdynpro table?? if so please provide me the code jason.