on 07-10-2008 11:35 AM
Hi All,
I had a table with with visible row count '3', i want to display dynamic row by a button click, mean a 4 th row need to be added to the table with same like row '3'.
please help me ..
Thanks,
Raj.
Hi Raju,
while click the Add Button,
Get the all the Rows from the Table and Put it in to one internal table . after that append the one empty record to that internal table. then again bind to that node.
Like following code.
DATA lo_nd_sales TYPE REF TO if_wd_context_node.
DATA lo_el_sales TYPE REF TO if_wd_context_element.
DATA ls_sales TYPE wd_this->element_sales.
DATA lt_sales TYPE wd_this->elements_sales.
navigate from <CONTEXT> to <SALES> via lead selection
lo_nd_sales = wd_context->get_child_node( name = wd_this->wdctx_sales ).
get element via lead selection
lo_el_sales = lo_nd_sales->get_element( ).
CALL METHOD lo_nd_sales->get_static_attributes_table
EXPORTING
from = 1
to = 2147483647
IMPORTING
table = lt_sales
.
IF lt_sales IS NOT INITIAL.
CLEAR ls_sales.
APPEND ls_sales TO lt_sales.
lo_nd_sales->bind_table( lt_sales ).
ENDIF.
Regards,
Vijay.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
question is not clear.
Are you want to add a record to the Table on button click ?
or
you want to change the Visible Row Count dynamically?
Abhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
1. Adding a record
data: lr_node type ref to if_wd_context_node.
data: lr_element type ref to if_wd_cotnext_element.
data: lr_stru type <context node structure>
lr_node = wd_context->get_child_node( '<child node name>' ).
lr_element =
lr_node->bind_element( new_item = lr_stru set_initial_elements = abap_false ).
2. I think your Visible row count property is 3 and you don't want to change it when more than 3 records are added at the same time you want the newly added record as the first record
Create a context attribute of type Integer and bind it to the firstVisibleRow property of the Table
and when user clicks AddMore button increment this by 1 and set it
Abhi
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.