cancel
Showing results for 
Search instead for 
Did you mean: 

visibility of a table row depending on a flag

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

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

Former Member
0 Kudos

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..

Former Member
0 Kudos

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

Former Member
0 Kudos

hi,

I think that wont be possible to make particular row invisible. Still you can search around for a solution otherwise you can go ahead with approach of having two tables and deleting rows from internal table before binding.

Former Member
0 Kudos

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

Former Member
0 Kudos

Thks...

but I dont want to delete it.... i need data for later process...

I want to make it only invisible.....

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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 ).