on 01-04-2007 9:31 AM
Hello colleagues,
We are using a table with a master column (tree). Additional we are using an input field where a user can enter a number so that the displayed lines can be change at runtime.
Problem:
I would like to know the displayed number of lines as it is displayed in the button line of the table in the view (where a user can jump direct to a line) - but I do not know how I get it.
Question:
How do I get the content of the max number of available lines in the button of the displayed table?
Thanks+greetings,
Achim
Hi Achim,
The RowCount propery of the WDA Table is Bindable. So...
1. Bind it to a Node Element.
2. During the User Action(onClick) set this NodeElement value to the User Input Value (text field value).
3. So that it will be reflect in the Table.
Hope it helps.
Regards,
Maheswaran.B
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Maheswaran.B,
thanks for the reply - the problem is not solved with the suggestion (because I do not get the maximum number of line displayed).
I did the following:
On the very first time if "modifyView" will be executed I do a loop over the table. If the maximum number is reached within the loop I set this number - if not I set the number of loops.
Here is a code example:
DO 10 TIMES.
ADD 1 TO l_counter.
CLEAR elem_tabletree.
elem_tabletree = node_tabletree->get_element( index = l_counter ).
IF elem_tabletree IS INITIAL.
SUBTRACT 1 FROM l_counter.
EXIT.
ENDIF.
ENDDO.
*--- set the value to the bound variable
elem_owner_node->set_attribute(
EXPORTING
name = `NUMBER_OF_LINES`
value = item_number_of_lines ).
Hi Achim,
You have the Input field in which the User is Entering the no of Lines to be Displayed. Bind it to the Context attribute. Read this into a local variable. Get all the data from the node ( to which the table is binded ) into an internal table till the value of the local variable which you have read.
Some code Example:
lt_table = node->get_elements( )
sy-tabix = 0.
if sy-tabix <> l_variable.
loop at lt_table into ls_data.
append ls_data into lt_data.
endloop.
in the end you would have all the displayed data in lt_data.
Hope this helps to a certain extent. please excuse coz this code has not been checked syntactically.
Cheers.
Ashish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Achim,
You can get the total no. of lines in the table using the following code...
data no_of_lines type i.
no_of_lines = node_tabletree->GET_ELEMENT_COUNT().
Hope it helps.
Forgot to say, Thanks for the points.
Regards,
Maheswaran.B
Message was edited by:
Maheswaran B
Message was edited by:
Maheswaran B
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.