cancel
Showing results for 
Search instead for 
Did you mean: 

Hide Table ???

former_member187452
Contributor
0 Kudos

Hi All,

I have a requirement to hide a table which containes data,

I have a button called GET_RECORDS in my application , when I press the button GET_RECORDS then only table should be displayed along with its data.

So Please tell me how to hide the table...

Regards,

Bharat.

Accepted Solutions (0)

Answers (6)

Answers (6)

former_member187452
Contributor
0 Kudos

Thanks All ...

Former Member
0 Kudos

bind ur table with this attribute 'CA'

n if wish to display it once again , set attribute value to "02"

Former Member
0 Kudos

hi

instead create a context attribute of type

WDUI_VISIBILITY , say "CA"

and do the following coding on the appropriate method:

 DATA lo_el_context TYPE REF TO if_wd_context_element.
  DATA ls_context TYPE wd_this->element_context.
  DATA lv_ca LIKE ls_context-ca.
* get element via lead selection
  lo_el_context = wd_context->get_element(  ).

* get single attribute
  lo_el_context->set_attribute(
    EXPORTING
      name =  `CA`
   
      value = '01' ).

Former Member
0 Kudos

HI,

[]

[]

uday_gubbala2
Active Contributor
0 Kudos

Hi Bharat,

This is possible by binding the "visible" property of the table with an context attribute of type WDY_BOOLEAN. Leave the, "Default Value" property of the attribute as blank this would mean that by default when you test your application the table would not get displayed. Now place a button & within the buttons action handler just set the value of this attribute to X, this would make the table visible to the user.

Regards,

Uday

Suppose I have a context node by name NODE & an attribute VISIBLE of type WDY_BOOLEAN under this node.

I have bound the "visible" property of my table to VISIBLE i.e, MAIN.NODE.VISIBLE.

Below is the coding within my buttons action handler method:

METHOD onactionshow_table .
  DATA: lr_node TYPE REF TO if_wd_context_node.

  lr_node = wd_context->get_child_node( name = 'NODE' ).
  lr_node->set_attribute( EXPORTING name  = 'VISIBLE'
                                    value = 'X' ).
ENDMETHOD.

Former Member
0 Kudos

Hi Bharat,

Create a context attribute of type WDY_BOOLEAN. Bind this context attribute to the visible property of the table. Set the value to the context attribute to true in the event handler of GET_RECORDS button.

Best Regards,

Pooja

former_member187452
Contributor
0 Kudos

Hi,

I have created a context attribute 'HIDE' type WDY_BOOLEAN ,

So Tell me wether I have to bind the ' ENABLED ' property of table to HIDE attribute ???

Regards,

Bharat

Former Member
0 Kudos

Hi,

Bind the Visible property of the table with your attribute.

Radhika.

former_member187452
Contributor
0 Kudos

Hi,

When I test my application its giving me error ' Could Not Find Attribute '.

Regards,

Bharat

Former Member
0 Kudos

Hi,

Check in ST22 for more on error.

Check wether the component is activated properly after including the 'HIDE' attribute.

While reading/setting the value to this attribute check the NAME of the attribute.

lr_node->set_attribute( EXPORTING name = 'HIDE' "'Your context attribute name

value = 'X' ).

Regards,

Lekha.

Former Member
0 Kudos

Hi,

If you have created an individual attribute( not under any node ), then use the following code to hide the table

data: l_element type ref to if_wd_context_element.

l_element = wd_context->get_element( ).
l_element->set_attribute( exporting name = 'HIDE' 
                                                        value = abap_false ).

OR,

if your attribute is under a node use the following code,

Data: l_node type ref to if_wd_context_node.

l_node = wd_context->get_child_node( 'NODENAME' ).
l_node->set_attribute( exporting name = 'HIDE' 
                                                        value = abap_false ).

Radhika.