cancel
Showing results for 
Search instead for 
Did you mean: 

Visibility of a Table element - WebDynpro ABAP

Former Member
0 Kudos

hi all,

I m trying to do the next ...

I have a select options with a button that trigger a method. In this method I want to set on the visibility of a table with the result of a SO .

I see that I can put 'visible' throgh properties of the table . but I dont know how i can do visible again the table.

any ideas?

regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

For the visibillity of any element, there are two ways.

1. Binding with Context Attribute

- Create an attribute of type WDUI_VISIBILITY

- Bind this attribute with the 'Visible' Property of table

- set the value of this attribute from methods based on your condition

- To make visible, set the value of context attribute as '02' and to make invisible '01'.

2. In WDDOMODIFYVIEW method of the view

- Check if the condition for making the table visible is met

Check the post by rvanamala in the following thread for sample.

Link: http://forums.sdn.sap.com/thread.jspa?threadID=1763462

Answers (4)

Answers (4)

Former Member
0 Kudos

thanks!!!

Former Member
0 Kudos

Hi,

Check the code which give you idea about visability of fields, but bind table and change according to your requirement.

DATA lo_nd_dctrl TYPE REF TO if_wd_context_node. " Node of DCTRL structure

DATA lo_el_dctrl TYPE REF TO if_wd_context_element. " Element of DCTRL structure

DATA ls_dctrl TYPE wd_this->element_dctrl. " Structure for DCTRL

DATA:lv_asn_ind TYPE wd_this->element_dctrl-asn_ind, " Variable of ASN fieldfor DCTRL

lv_bool TYPE wdy_boolean. " Variable of boolean field for DCTRL structure

DATA :wd_por_en TYPE REF TO cl_wd_checkbox. " Workarea to declare check box

  • navigate from <CONTEXT> to <DCTRL> via lead selection

lo_nd_dctrl = wd_context->get_child_node( name = wd_this->wdctx_dctrl ).

  • get element via lead selection

lo_el_dctrl = lo_nd_dctrl->get_element( ).

  • @TODO handle not set lead selection

IF lo_el_dctrl IS INITIAL.

ENDIF.

lv_bool = abap_true..

CALL METHOD lo_el_dctrl->set_attribute_property

EXPORTING

attribute_name = 'ASN_IND'

property = if_wd_context_element=>e_property-read_only"if_wd_context_element~e_property-read_only

value = lv_bool.

wd_por_en ?= view->get_element('SN_CHKBOX').

CALL METHOD wd_por_en->set_enabled

EXPORTING

value = abap_false.

Regards,

Goutam Kolluru.

anoop_gupta2
Participant
0 Kudos

HI,

You need to create an antribute in the context , with type WDY_VISIBILE.

now bind the attribute with the table visible property , and the control its visibilty through code.

on click of the button event , call method set attribute ( name = 'abc' value = '1') for visible , and value -= 0 for hiding table.

Best Regards,

Anoop Gupta

Former Member
0 Kudos

You can create attribute and assign attribute to control and pass your values to the attribute in your component logic for visible and invisible.