cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Cell contents, then trigger action to change column data in table

bruce_fackerell
Explorer
0 Kudos

Hi All,

The object is to take the contents of a cell on a non alv table and copy it to the enterable cells in a table column.

I dont want to have a button or link in the cell. Nor action on every field changed.

I have tried to get the cell focus and then click elsewhere to initiate the action - if I click a button elsewhere the focus is lost. Not that I had the focus in the first place!

I have tried putting a context menu on the cell and then right click but I get the id of the context action. So I have the row of the table but not the column.

The table has been generated dynamically.

I am hoping this is simple - I have had a read on the forum but not found the answer.

Thanks for help.

Bruce

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member199125
Active Contributor
0 Kudos

Quite confusing with your requirement.

Once you select the row in table,if you click on elsewhere for action, i think still table focus will be there.

In alv table, we can get retrieve the select row contents , using r_param->get_index( ). using this index value we can retrieve.

Thanks and Regards

Srinivas

bruce_fackerell
Explorer
0 Kudos

Thanks Sanasrinivas,

Yes we already have getting the index and context of the row. The difficulty is getting the column and therefore the cell. I thought that would be easy but currently it is not.

Regards

Bruce

bruce_fackerell
Explorer
0 Kudos

Anyone with any ideas how to get the actual cell. Either when clicking on another button or right click in the cell with our own context menu.

Thanks

Bruce

bruce_fackerell
Explorer
0 Kudos

Is this not possible? Should I close thread?

bruce_fackerell
Explorer
0 Kudos

Hi All,

I have had some further time and be able to come up with a solution. As we are using a context menu to trigger the action, I have written the following code in WDDOONCONTEXTMENU.

types: begin of type_s_context_menu,

menu type ref to cl_wd_menu,

context_element type ref to if_wd_context_element,

context_node_path_name type string,

originator type ref to cl_wdr_view_element,

representative type ref to cl_wdr_view_element,

is_dynamic type abap_bool,

end of type_s_context_menu .

data: ls_context type type_s_context_menu.

ls_context = wdr_task=>application->context_menu_info.

wd_this->column = ls_context-originator->id.

This gives me the column ID that we store. As I have named my column as the field as it is a dynamic table otherwise you could read the origator.

This column is then used in my action. Now we have the context row and the column all else is achievable.

Regards

Bruce

Former Member
0 Kudos

Hi Bruce,

As i am understood correctly..?

First get data of a perticular cell, if you want to focus perticular cell.

Check this below link, find sarbjeet answer.

http://forums.sdn.sap.com/click.jspa?searchID=72209873&messageID=9979841

Without events you can't do any actions in WD. and there is no on change event for inputs.

Cheers,

Kris.

bruce_fackerell
Explorer
0 Kudos

Hi Kris,

No we dont want to set focus on a particular field. We wish to know where the focus was when the action was triggered.

Regards

Bruce