cancel
Showing results for 
Search instead for 
Did you mean: 

How to invisible the dynamic table in webdynpro abap?

former_member210804
Active Participant
0 Kudos

Hi Friends,

1. I have created inputfield,button and table dynamically.

2. based on input CARRID ,table should appear.

3. If CARRID = 'AC' the table should be invisible else table should be visible.

First time i entered 'AA' as input, table got created with values.Next time i change the input as 'AC' .,i m not able to invisible the table.

Please guide me regarding this.

Best Regards,

Narasimha.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

try using below code

    DATA wd_table TYPE REF TO cl_wd_table.
    wd_table ?= view->get_element( '<created table>' ).

    wd_table->set_visible( abap_false).

or

you can bind dynamic_table's visibility with a attribute of type wdy_visibility and change this attribute as per your need.

former_member210804
Active Participant
0 Kudos

Hai Jitendra,

I wrote the logic as below. but it is showing error like

IF lv_carrid <> 'AC'.

        CALL METHOD cl_wd_dynamic_tool=>create_table_from_node

          EXPORTING

            ui_parent      = lr_container

            table_id       = 'TAB'

            node           = lo_nd_sflight

*           on_lead_select =

          RECEIVING

            table          = lr_table.

*    ENDIF.

      ELSE.

        DATA wd_table TYPE REF TO cl_wd_table.

        wd_table ?= view->get_element( lr_table ).

        wd_table->set_visible('01').

        lo_nd_sflight->invalidate( ).   

Former Member
0 Kudos

pass table_id :-

   DATA wd_table TYPE REF TO cl_wd_table. 

        wd_table ?= view->get_element( 'TAB' ).

        wd_table->set_visible('01').

Former Member
0 Kudos

Hi Narsimha Rao,

The syntax error  fix is wd_table ?= view->get_element( lr_table--->this should be ID in your case which is 'TAB' ).this should fix it

Thanks

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

While creating the table using the dynamic class, get the object reference for the table and store it in the attribute of the view controller or component controller.

    call method cl_wd_dynamic_tool=>create_table_from_node exporting

        ui_parent = lo_container

        table_id  = 'SELECTED'

        node      = wd_this->lo_selected

        receiving table = wd_this->lo_table.

In the method or event handler where you want to hide the table write the following code.

  call method wd_this->lo_table->set_visible

   exporting

     value  = 01.

Regards,

Arun Krishnamoorthy

former_member210804
Active Participant
0 Kudos

Thanks to everyone. I got the solution.

Best Regards,

Narasimha Rao Putturi

Former Member
0 Kudos

Hi,

Create a context attribute of type WDUI_VISIBILITY and bind this to the visible property of the table.

Based on your condition say 'AC' set this created context attribute to '01' - None...this should work.

Thanks

Former Member
0 Kudos

Hello Narasimha,

Refer following links.Hope it might help you.

http://webdynproabap.wordpress.com/2012/10/08/dynamic-ui-element/

http://scn.sap.com/thread/1656054

Thanks

Katrice