You are on page 1of 3

1

Customization or Features of Webdynpro ABAP ALV


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-conditionfor 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: display20 rowsin ALVTABLE: ================================== 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 ). Customization2: removespecificcolumnfromALVtable: ======================================= implement the standard code given by SAP for removing column from alv table lv_value->if_salv_wd_column_settings~delete_column( 'NAME' ). customization3: Disablingthe standardfunctionalitieson ALVtable: ============================================= 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 ). Customizatoin4: ClearingrecordsfromALVtable: ================================== lo_nd_itab->invalidate( ). Customization5: deletingselectedrecordfromALVtable: & databasetable: =================================================== get_static_attributes( importing static_attributes = ls_itab ). Delete from zemp5 where id = ls_itab-id. lo_nd_itab->remove_element( lo_el_itab ). Customization6: To changethe cursorpositionon ALVTable: ========================================== lo_nd_itab->move_next( ). lo_nd_itab->move_previous( ). lo_nd_itab->move_first( ). lo_nd_itab->move_last( ). Customization7: addingbuttonsto ALVtable column: =========================================== Implement the standard code given by SAP for adding buttons to alv table:

2
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.Classname------------screenelementname: =================================== 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 Customization9: addinghyperlinkson 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 ). Customization10: addingprogressindicatorson 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 ). Customization12: enablingtotals & subtotalson ALVtable 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'

3
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.

customization14: edit/NOnEDITfunctionalityon ALVTABLE: ================================================ 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 ).

You might also like