on 08-06-2008 5:10 AM
Hi All,
I have to make a button "ADD ROW", which adds a row in a table. But problem is that i have to fix the maximum size of the table that is maximum rows that can be added are 10. Please tell me if i can declare global variables and if i can how?? Or suggest a better way
Thank you in advance.
Regards,
Pranav Nagpal
In your ADD button event handler code
data: lr_node type ref to if_wd_context_node.
data: count type i.
lr_node = wd_context->get_child_node( '<node name binded to the table>' ).
count = lr_node->GET_ELEMENT_COUNT( ).
if count > 10.
show a message
exit.
endif.
rest of your code adding
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
count it a local variable, but you are filling it with the current table size using the method GET_ELEMENT_COUNT. it will always return the number of rows in your table node.
if you want another way.
go to the Attribute tab of the View
add a Variable of type Integer
you can access this variable using WD_THIS-><variable_name> in any of the methods of your View
Abhi
In the future, please do not use sayings like "Very urgently required" in your Subject or Message. Form the Forum Rules of Engagement:
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement
Do not use words in capital letters and any of the words: urgent1, quickly1, burning1, etc in your message. Especially not in the title! This just irritates and does not help you get to your goal. From our side, we definitely do not answer faster when we see these words.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.