Skip to Content

This tutorial gives a details information about how to reuse or customize the features of webdynpro abap alv.

Customization of alv table with Additional features:

**************************************

Pre-condition for alv table customization:

===========================

Goto view properties & select create controller usage

select Interface controller of SALV_WD_TABLE

Goto WDDOINIT( ) method:

Step1: initialize the alv table component ( using code wizard ):

step2: get the reference of interface controller of SALV_WD_TABLE componenet

& call GET_MODEL( ) method Using COde Wizard :

Customization1 : display 20 rows in ALV TABLE :

==================================

implement the standard code given by SAP for changing the no of rows in ALV table

lv_value->if_salv_wd_table_settings~SET_VISIBLE_ROW_COUNT( value = 20 ).


Customization 2: remove specific column from ALV table:

=======================================

implement the standard code given by SAP for removing column from alv table

lv_value->if_salv_wd_column_settings~delete_column( ‘NAME’ ).


customization 3: Disabling the standard functionalities on ALV table:

=============================================

implement the standard code given by SAP for Disabling the standard functionalities

lv_value->IF_SALV_WD_STD_FUNCTIONS~SET_EXPORT_ALLOWED( abap_false ).

lv_value->IF_SALV_WD_STD_FUNCTIONS~SET_FILTER_FILTERLINE_ALLOWED( abap_false ).


Customizatoin 4: Clearing records from ALV table:

==================================

lo_nd_itab->invalidate( ).


Customization 5: deleting selected record from ALV table: & database table:

===================================================

get_static_attributes( importing static_attributes = ls_itab ).

Delete from zemp5 where id = ls_itab-id.

lo_nd_itab->remove_element( lo_el_itab ).


Customization 6: To change the cursor position on ALV Table:

==========================================

lo_nd_itab->move_next( ).

lo_nd_itab->move_previous( ).

lo_nd_itab->move_first( ).

lo_nd_itab->move_last( ).


Customization 7: adding buttons to ALV table column:

===========================================

Implement the standard code given by SAP for adding buttons to alv table:

DATA: lr_button TYPE REF TO cl_salv_wd_uie_button.

DATA: lr_column TYPE REF TO cl_salv_wd_column.

lr_column = lv_value->if_salv_wd_column_settings~get_column( ‘NAME’).

CREATE OBJECT lr_button.

lr_button->set_text_fieldname( ‘NAME’ ).

lr_column->set_cell_editor( lr_button ).


8.Class name ————screen element name:

===================================

cl_salv_wd_uie_button—————button

cl_salv_wd_uie_link_to_Action——-Link To action

cl_salv_wd_uie_progr_indicator——Progress indicator

cl_salv_wd_uie_Image—————-Image

cl_salv_wd_uie_input_field———-input field

cl_salv_wd_uie_Text_view————text view


Customization 9: adding hyper links on Alv table column:

=============================================

implement the standard code for adding hyper links

DATA: lr_button2 TYPE REF TO cl_salv_wd_uie_link_to_action.

DATA: lr_column2 TYPE REF TO cl_salv_wd_column.

lr_column2 = lv_value->if_salv_wd_column_settings~get_column( ‘ID’ ).

CREATE OBJECT lr_button2.

lr_button2->set_text_fieldname( ‘ID’ ).

lr_column2->set_cell_editor( lr_button2 ).


Customization 10: adding progress indicators on Alv table column:

====================================================

DATA: lr_button3 TYPE REF TO cl_salv_wd_uie_progr_indicator.

DATA: lr_column3 TYPE REF TO cl_salv_wd_column.

lr_column3 = lv_value->if_salv_wd_column_settings~get_column( ‘PERMARKS’ ).

CREATE OBJECT lr_button3.

lr_button3->set_percent_value_fieldname( ‘PERMARKS’ ).

lr_column3->set_cell_editor( lr_button3 ).


Customization 12: enabling totals & subtotals on ALV table column:

=================================================

implement the standard code for totals & subtotals on ALV table column:

data lr_comp_if_alv type ref to IWCI_SALV_WD_TABLE.

data : lr_column_settings type ref to if_salv_wd_column_settings,

lr_cloumn type ref to cl_salv_wd_column,

lt_column type salv_wd_t_column_ref,

ls_column type salv_wd_s_column_ref,

field_amount type ref to cl_salv_wd_field,

lv_aggr_rul type ref to cl_salv_wd_aggr_rule.

lr_column_settings ?= lv_value .

lt_column = lr_column_settings->get_columns( ).

loop at lt_column into ls_column.

case ls_column-id .

when ‘SALPM’.

call method lv_value->if_salv_wd_field_settings~get_field

exporting fieldname = ‘SALPM’

receiving value = field_amount.

call method field_amount->if_salv_wd_aggr~create_aggr_rule

exporting

aggregation_type = if_salv_wd_c_aggregation=>aggrtype_total

receiving value = lv_aggr_rul.

endcase.

endloop.


customization 14: edit/NOn-EDIT functionality on ALV TABLE:

================================================

DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.

DATA: lr_column TYPE REF TO cl_salv_wd_column.

DATA :lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.

lr_column_settings ?= l_value.

lr_column = lr_column_settings->get_column( ‘NAME’ ).

CREATE OBJECT lr_input_field EXPORTING value_fieldname = ‘NAME’.

lr_column->set_cell_editor( lr_input_field ).

data: lr_table_settings type ref to if_salv_wd_table_settings.

lr_table_settings ?= l_value.

lr_table_settings->set_read_only( abap_false ).

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

Leave a Reply