cancel
Showing results for 
Search instead for 
Did you mean: 

Change Record from alv table in webdynpro abap

Former Member
0 Kudos

Hi Experts,

I have some 10 records in alv table,user will change two record in the alv table,And now i have to get that change required at run time.

Please Provided me Required Information.

Thanks & Regards.

Krishna.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Krishna,

Refer below code,

1.Create a method in the view name it like ON_CELL_ACTION,method type is Event handler that select from drop down and select event is ON_CELL_ACTION from Interface Controller Events.

2.Now to trigger this event write the below code in WDDOMODIFYVIEW method of view.

* Data Declaration
data lo_cmp_usage type ref to if_wd_component_usage.

data lo_interfacecontroller type ref to iwci_salv_wd_table .

data lo_value type ref to cl_salv_wd_config_table.

* Instantiate ALV

lo_cmp_usage = wd_this->wd_cpuse_alv( ).

if lo_cmp_usage->has_active_component( ) is initial.

lo_cmp_usage->create_component( ).

endif.

lo_interfacecontroller = wd_this->wd_cpifc_alv( ).

* Call get_model of Interface Controller to get reference of ALV

lo_value = lo_interfacecontroller->get_model(

).

* Enable the ON_CELL_ACTION Event

call method lo_value->if_salv_wd_table_settings~set_cell_action_event_enabled

exporting

value = ABAP_TRUE .

Former Member
0 Kudos

Hi Sudhir,

As suggested by you, I have the code in the WDDOMODIFY. Also after doing this, I have created an event handler method named ON_CELL_ACTION type ON_CELL_ACTION.

My debugger is now stopping here. But please guide me how to read the row for which action is triggerd?

Thanks,

Srihari.

Former Member
0 Kudos

Hi Krishna,

To get changed values in webdynpro ALV  you need to write code in ON_CELL_ACTION event.

In methods tab you create one event like method and select event ON_CELL_ACTION. Double click and go to source code and write code.

sample code is

lo_nd_nodename type ref to   if_wd_context_node,

lo_el_nodename  type ref to   if_wd_context_element,

lo_nd_nodename= wd_context->get_child_node( name = wd_this->wdctx_nodename).

lo_nd_nodename->get_static_attributes_table( importing table = lt_nodename).

This code will work on enter for each line item in ALV

Thanks & Regards,

Meenachi.R

Former Member
0 Kudos

Hi Krishna,

As you change the records, Those will be automatically updated in context node to which you have binded. To save this changes you have to create some user defined functions on alv toolbar such as 'save' button using standard events. Here is the useful link:

http://scn.sap.com/community/web-dynpro-abap/blog/2006/01/09/wda--user-defined-functions-in-alv

Hope it works.

Regards,

Sudhir Kothavale.

Former Member
0 Kudos

try using ON_CELL_ACTION or ON_DATA_CHECK event of ALV