Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

problem in editing the table and again saving back to database through web

hi ,

i have created ztable and sucessfully able to display through webdynpro but my requirement is that the user should be able to select any of the record n that should be editable and after that the editable data should be saved again to data database .

i have also alv components in methods of a view

    • Create component usage for alv component

data: l_ref_cmp_usage type ref to if_wd_component_usage.

l_ref_cmp_usage = wd_this->wd_cpuse_alv( ). >>>>>>errror

if l_ref_cmp_usage->has_active_component( ) is initial.

l_ref_cmp_usage->create_component( ).

endif.

    • Get config model

*

data: l_ref_interfacecontroller type ref to iwci_salv_wd_table .

l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).>>>>>error

data: l_value type ref to cl_salv_wd_config_table.

l_value = l_ref_interfacecontroller->get_model( ).

  • set visible row count

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

  • Sort rows by seatsocc descending

*

  • data: lr_field type ref to cl_salv_wd_field.

*

*

*

  • lr_field =

*

  • l_value->if_salv_wd_field_settings~get_field( 'SEATSOCC' ).

*

  • lr_field->if_salv_wd_sort~create_sort_rule( sort_order =

*

  • if_salv_wd_c_sort=>sort_order_descending ).

*

  • Display icon in column seatsocc

data: lr_column type ref to cl_salv_wd_column,

lr_image type ref to cl_salv_wd_uie_image,

lv_icon type string. "#EC NEEDED

*

lr_column = l_value->if_salv_wd_column_settings~get_column(

'SEATSOCC'

).

create object lr_image.

lr_image->set_source_fieldname( 'STATUS' ).

lr_column->set_cell_editor( lr_image ). "Display traffic

*light images in column 'SEATSOCCC'

  • delete column STATUS

  • l_value->if_salv_wd_column_settings~delete_column( 'STATUS' ).

  • set cell editor for input fields (~make colum PRICE editable)

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_column_settings ?= l_value.

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

CREATE OBJECT lr_input_field EXPORTING value_fieldname = 'MATERIAL'.

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

here in the code >>>error i have marked it is saying that the method wd_cpuse_alv is unknown even with the method wd_cpifc_alv, firstly iam uable to edit the fields , ater that i can go futher , plz give me the step by step solution as iam new to it

Former Member
Former Member replied

Hi shaik,

I couldn't find any problem in the code.

Whether that is the first method you are initializing the alv model?

Try this, Comment the whole code in that method. Activate the whole component including views and then uncomment the code.

Regards...

Arun.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question