on 12-06-2008 11:34 PM
Hi Friends,
I have a table defaulted to 4 rows. I have a add button to add a new row in the table.
When i have already 4 rows in table, and when i click add its adding that 5th row correctly( and i used set_lead_selection for this new row ).
But i want to automatically make a next page once i hit the ADD button here. Each time now i m hitting next page then only able to see hte 5th row. I need once ADD is clicked, i want to see the 5th row visible..
Can someone tell me how to code or do this
thanks friends,,,
Niraja
hii nirija,
if you want to see first row as fifth row on click of add button what you can do is set the global variable i have suggested in previous post to a table property firstvisiblerow. say if you have set the firstvisiblerow to 4 what it will do is it will make your 5th row the first row in the table page...
regards
pranav
Edited by: Pranav Nagpal on Dec 8, 2008 7:29 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi nirija,
make a global or local variable say icount.
now when you are reading the data from database to display it in the table use
DESCRIBE TABLE itab1_info LINES lv_lines.
it will fetch you number of lines in your internal table into variable lv_lines....
now set the icount = lv_lines.......
now set this icount dynamically once in the number of row visible property...
now when you click on add button increment the global variable icount and again set the default number of rows visible to that icount......
hope this will help
regards
pranav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
refer the WIKI
I hoope it would help you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
amit i dont want to edit the table.. i want the new record which i added to be visible .. when the visible page is filled ... i see only when i go to next page..
Arjun,
I did same as ur code, only diff is in bind_table i didnt used initial values.. will that work ?
will tbat go to the newly added row?
niraja
Hi Arjun,
I tried that.
elem_servprod = node_servprod->create_element( ).
elem_servprod->get_static_attributes(
IMPORTING
static_attributes = stru_servprod ).
node_servprod->bind_structure(
EXPORTING
new_item = stru_servprod
set_initial_elements = abap_false ).
v_lines = v_lines + 1.
node_servprod->set_lead_selection_index( EXPORTING
index = v_lines ).
But its not working for me... it says cannot set lead selection index 2.
can u tell me how it has to be done?
Niraja
Guys sorry if i am not making u to understand my issue..
I want my table to be defaulted to 4 visible row count. OK.
now suppose in my table i already have data of 4 records.
I want to add a new row.. i click ADD button(new record is getting created ).
But to see that record i m clicking the next page button of the table(footer). this i dont want to do.
whenever i click ADD.. the table's first visible row should become 5th row. To check previous 4 rows's i can go with previous page of table(footer).
-1 visiblerowcount doesnt work for me.. ..
so hope now its clear.
kindly help.
niraja
hi niraja,
Plz refer to the following code:
method onactiononadd .
node_material type ref to if_wd_context_node.
elem_material type ref to if_wd_context_element.
stru_material type sflight.
node_material = wd_context->get_child_node( name = 'ANNA' ).
elem_material = node_material->get_element( ).
if ( elem_material is initial ).
call method node_material->create_element
receiving
element = elem_material.
endif.
call method elem_material->get_static_attributes
importing
static_attributes = stru_material .
call method node_material->bind_structure
exporting
new_item = stru_material
set_initial_elements = abap_false.
endmethod.
i hope it helps
regards
arjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
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.