Skip to Content
Former Member
Jun 09, 2011 at 07:44 AM

Displaying value in a coloumn in ALV when inserting a new row


Hai all,

Am displaying a value for a colounm Req number in my alv table.

It is displaying in the 1st row alone but wen am clicking on the Insert button again am not able to display the value in the newly inserted row//

Am using the following code in wddoint.

data: l_ref_cmp_usage type ref to if_wd_component_usage.

l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).

if l_ref_cmp_usage->has_active_component( ) is initial.

l_ref_cmp_usage->create_component( ).


  • Get config model

data: l_ref_interfacecontroller type ref to iwci_salv_wd_table .

l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).

data: l_value type ref to cl_salv_wd_config_table.

data: l_value1 type ref to cl_salv_wd_config_table.

data: l_value2 type ref to cl_salv_wd_config_table.

data: l_value3 type ref to cl_salv_wd_config_table.

data: l_value4 type ref to cl_salv_wd_config_table.

data: l_value5 type ref to cl_salv_wd_config_table.

l_value = l_ref_interfacecontroller->get_model( ).

l_value1 = l_ref_interfacecontroller->get_model( ).

l_value2 = l_ref_interfacecontroller->get_model( ).

l_value3 = l_ref_interfacecontroller->get_model( ).

l_value4 = l_ref_interfacecontroller->get_model( ).

l_value5 = l_ref_interfacecontroller->get_model( ).

  • set visible row count

l_value->if_salv_wd_table_settings~set_visible_row_count( '5' ).

"l_value->if_salv_wd_std_functions~set_edit_insert_row_allowed( ).

DATA:lr_column_settings type ref to if_salv_wd_column_settings,

lr_input_field TYPE REF TO cl_salv_wd_uie_input_field,

lr_input_field1 TYPE REF TO cl_salv_wd_uie_input_field,

lr_input_field2 TYPE REF TO cl_salv_wd_uie_input_field,

lr_input_field3 TYPE REF TO cl_salv_wd_uie_input_field,

lr_input_field4 TYPE REF TO cl_salv_wd_uie_input_field,

lr_input_field5 TYPE REF TO cl_salv_wd_uie_input_field.

" data: l_value type ref to cl_salv_wd_config_table.

data: lr_column type ref to cl_salv_wd_column.

lr_column_settings ?= l_value.

lr_column = lr_column_settings->get_column( 'AMOUNT' ).

CREATE OBJECT lr_input_field EXPORTING value_fieldname = 'AMOUNT'.

lr_column->set_cell_editor( lr_input_field ).

lr_column_settings ?= l_value1.

lr_column = lr_column_settings->get_column( 'BILL_NO' ).

CREATE OBJECT lr_input_field1 EXPORTING value_fieldname = 'BILL_NO'.

lr_column->set_cell_editor( lr_input_field1 ).

lr_column_settings ?= l_value2.

lr_column = lr_column_settings->get_column( 'BILL_DATE' ).

CREATE OBJECT lr_input_field2 EXPORTING value_fieldname = 'BILL_DATE'.

lr_column->set_cell_editor( lr_input_field2 ).

lr_column_settings ?= l_value3.

lr_column = lr_column_settings->get_column( 'PHARM_NAME' ).

CREATE OBJECT lr_input_field3 EXPORTING value_fieldname = 'PHARM_NAME'.

lr_column->set_cell_editor( lr_input_field3 ).

lr_column_settings ?= l_value4.

lr_column = lr_column_settings->get_column( 'CITY' ).

CREATE OBJECT lr_input_field4 EXPORTING value_fieldname = 'CITY'.

lr_column->set_cell_editor( lr_input_field4 ).

*lr_column_settings ?= l_value5.

*lr_column = lr_column_settings->get_column( 'REQ_NUMBER' ).

*CREATE OBJECT lr_input_field5 EXPORTING value_fieldname = 'REQ_NUMBER'.

*lr_column->set_cell_editor( lr_input_field5 ).

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

And am using one method called on_alv_insert

FIELD-SYMBOLS: <wa_row> LIKE LINE OF r_param->t_inserted_rows.

DATA bill_details TYPE REF TO zdom_bill_detail.

LOOP AT r_param->t_inserted_rows ASSIGNING <wa_row>.

bill_details ?= <wa_row>-r_value.


DATA lo_nd_bill_detail TYPE REF TO if_wd_context_node.

DATA lo_el_bill_detail TYPE REF TO if_wd_context_element.

DATA ls_bill_detail TYPE wd_this->Element_bill_detail.

  • navigate from <CONTEXT> to <BILL_DETAIL> via lead selection

lo_nd_bill_detail = wd_context->get_child_node( name = wd_this->wdctx_bill_detail ).

  • alternative access via index

lo_el_bill_detail = lo_nd_bill_detail->get_element( index = <wa_row>-index ).



name = 'REQ_NUMBER'

value = wd_comp_controller->request_number




Pls give some suggestions..

Thanks in Advance,