on 04-22-2009 8:44 AM
Hi Experts,
I have a table where the visible row count is 5, and say when i make changes to the row in 25 th position and bind the table with updated values on action save the new values are binded but the now the table is taken back to its first five rows as display, i would like to be able to see the 25th row even after binding the new updated table, i.e would want to retain table position.
Many Thanks In Advance,
Chaitanya.
Hi Chaitanya,
Try the following steps:
1) Create an attribute 'L_CNT' type i
2) Bind this attribute to the "Visible Row Count" Property of the table.
3) Now in WDDOINIT set the default value to '5'
Use the following code
* set visible row count
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->element_context.
DATA lv_l_cnt LIKE ls_context-l_cnt.
* get element via lead selection
lo_el_context = wd_context->get_element( ).
* set single attribute
lo_el_context->set_attribute(
EXPORTING
name = `L_CNT`
value = '5' ).
4) Now once you bind the table, set your new row count .
node_vbap->bind_elements( lt_vbap ).
data: l_cnt type i.
DESCRIBE TABLE lt_vbap LINES l_cnt.
* get element via lead selection
lo_el_context = wd_context->get_element( ).
* set single attribute
lo_el_context->set_attribute(
EXPORTING
name = `L_CNT`
value = l_cnt ).
Regards,
Radhika.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Many Thanks for the reply , i have a table that could have more that 1000 records at runtime so ur approach would not look pleasant on the screen , would need to work with changing the scroll position or somethng ................ so the question is till open...
Appreciate Ur Response
Chaitanya.
Edited by: Chaitanya Raju on Apr 22, 2009 10:32 AM
Hi Chaintanya,
I agree that the layout would not look pleasent using this approach.
I would like to add here, that if its an ALV table we can set the row to be visible after binding using "SET_FIRST_VISIBLE_ROW" method of the interface "IF_SALV_WD_TABLE_SETTINGS"
DATA: l_table_settings TYPE REF TO if_salv_wd_table_settings .
l_table_settings ?= lo_value.
l_table_settings->l_table->SET_FIRST_VISIBLE_ROW( '20' ).
Here i have hardcoded the value '20' , but you can pass the row number that you are editing.
Incase of a standard table, i am not sure how to achieve this.
Regards,
Radhika.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.