on 10-26-2009 6:35 AM
Hi all,
I want to set the visibilty of the table row ( its not an alv table ) depending on a field of that row. ie if the field value is 'X' the row should be visible else invisible...
how to acheive this.. Table is designed by code wizard, not an alv table...
Kindly help me through this...
Thanks & Regards,
Senthil
Hi Essare,
Try like this way,
Bind the attribute (Field which you want to set the visibility) to the visible property of each column value in the table(not in the column header).
Regards
S.Balasubramanian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
amit, can u explain in details with sample code...
saurav, my scenario is i have a table with edit,delete option...
if i delete the record means i'm just updating a flag in the DB table.. the record will there only..
so i need visibilty option..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1 use the method GET_STATIC_ATTRIBUTES_METHOD
DATA lo_nd_cn_popin TYPE REF TO if_wd_context_node.
DATA wa TYPE wd_this->element_cn_popin.
DATA itab TYPE wd_this->elements_cn_popin.
DATA last_row type I.
lo_nd_cn_popin = wd_context->get_child_node( name = wd_this->wdctx_cn_popin ).
lo_nd_cn_popin->get_static_attributes_table( IMPORTING table = itab1 ).
2 now itab1 contains value , u can set itab2 according to ur flag
3 move contents of itab1 to itab2
itab2[] = itab1[].
4 now u can delete values from itab1 according to ur flag
DELETE itab1 where FLAG EQ 'X'
5 bind it again with the node cn_popin ie the node , which is binded to the table
6 itab2 contians the values , which were there earlier in ur table , and nw itab1 contains modified value
u r binding ur context node to modified internal table
I hope it is clear
Thks...
but I dont want to delete it.... i need data for later process...
I want to make it only invisible.....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok. dont delete it.
Create a separte internal table -> Put all the values in that table which satify your criteria.
i.e PUt all the rows which you want to show in a separte table and bind that table.
loop at itab into wa.
if wa->F1 NE 'X'.
append wa to itab2.
endif.
endloop.
NOw bind itab2 with table : lo_nd->bind_table( itab2 ).
You can have itab one separate for further processing.
I hope this would help.
Edited by: Saurav Mago on Oct 26, 2009 12:20 PM
bind a context node , use GET_STATIC_ATTRIBUTES METHOD to get values in to the internal table itab1, copy values into another internal table itab2
now depending on ur requirement or selection criteria , filter the internal table itab1
and using bind_table bind it wid the context node , which is binded to ur table UI
hi,
Before populating your table with data i.e
before executing this statement lo_nd->bind_table( itab ) :
Have a check on the internal table values before binding .
loop at itab into wa.
if wa-F1 = 'X'.
delete itab from wa.
endif.
endloop.
Now bind your table : lo_nd->bind_table( itab ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
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.