on 10-02-2014 10:06 AM
Hi Experts,
I need to get the position of a field in a table part in webdynpro abap ...
Can anyone guide me in solving it .
Tasks :
1. Once i am placing the same value in a field (eg : new value = 6 & old value = 6 ) the position
is not captured .
2.
I need to get the position of the field that i have attached...
Request to guide me for the same ...
Regards,
Karthik S
Hi Karthik,
There is no provision in webdynpro ALV to get the position of alv cell of an unchanged data.
However, if there is a change of data, there are ALV events which can help you capture the field value.
How to trigger the event ON_CELL_ACTION in ALV - Web Dynpro ABAP - SCN Wiki
you will need to create an event handler for on_cell_action event (exposed from standard alv component), the parameter r_param(i think , Please check), you can get the field of the event being triggered.
Note: Event is triggered after a round trip( ex: ENTER key pressed )
Regards,
Tashi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The method is the event handler which will give you both the old data and the new data which you have inserted into the cell.
I have found one document which uses on_data_check alv event which should also solve your problem.
The event handler method will have parameter r_param which has all the information (old data and new data of the selected cell).
You need to write your own logic what you want to do with the changed data.
example code from the document:
data : wa_param like line of r_param->t_modified_cells.
data : lo_nd_projects type ref to if_wd_context_node,
lo_el_projects type ref to if_wd_context_element.
field-symbols : <fs_context> type standard table,
<fs_context2> type any,
<fs_variable2> type any,
<fs_variable> type any.
lo_nd_projects = wd_context->get_child_node( name =
'NEW_NODE' ).
lo_el_projects = lo_nd_projects->get_element( ).
call method lo_nd_projects->get_static_attributes_table
importing
table = <fs_context>.
loop at r_param->t_modified_cells into wa_param.
*Loop at changed entries and modify them in the dynamic internal table
read table <fs_context> index wa_param-index into <fs_context2>.
assign component wa_param-attribute of structure <fs_context2> to <fs_variable>.
assign wa_param-r_value->* to <fs_variable2>.
move <fs_variable2> to <fs_variable>
Emdloop
Hi Karthik,
i dont have access to SAP system currently, So please forgive my inability to give you a code snippet.
I am aware of another approach which may be little complex at first (neither the best way), but you can give it a try . The concept is called "context change log".
A brief on context change log: Context Change Log (Recording User Entries) - Developing Web Dynpro ABAP Applications - SAP Library
for a code snippet, you can google keyword "context change log" as i saw a non sap site which has an example on table control using context change log.
Please do check yourself if there is any other approach as i dont have access to system.
Regards,
Tashi
Hi Tashi,
Thanks for yr' reply...
Allready the above method is used for the applications that i am using currently ...
But the Problem is when a value is changed ,..then only the above method is captured in the applications
For ex : old value : 5 ...new value : 6
If , old value : 5 ...new value : 5 ...Changed value is not captured in the above method ...
So, If i get the position of the user changed one...will filter the same from the above metod ...
Is there any other option to achieve it ...
Regards,
Karthik S
Hi Karthik,
It definitely doesnt capture when the value is same, the primary purpose of this handler is to capture a change in value.
In your case, in the event of same value being entered, i didnt find any alv event handler ( m afraid we dont have any as far as i know). But please do share if you come across a different solution.
Regards,
Tashi
Hi Karthik,
You can use the method GET_SELECTED_ELEMENTS of interface IF_WD_CONTEXT_NODE.
BR,
RAM.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Karthik,
i dont have system access currently, But i can definitely guide you.
In the Method tab of your controller,
you need to create a new event handler for ALV event on_cell_action.By doing so, a standard parameter (r_param) will be generated,
In this event handler method, r_param will give you the position of the column and row (cosequently the Cell).
Hi,
You need to enable the event first. I had shared a wiki regarding this earlier.
call method lo_value->if_salv_wd_table_settings~set_cell_action_event_enabled
exporting
value = ABAP_TRUE
wiki link: How to trigger the event ON_CELL_ACTION in ALV - Web Dynpro ABAP - SCN Wiki
Regards,
Tashi
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.