cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Programming

Former Member
0 Kudos

Hi,

I am trying to add UI element Table to the view dynamically. I am getting empty table, here is my code.

method WDDOMODIFYVIEW .

data:lr_container type ref to cl_wd_uielement_container,
     lr_table type ref to cl_wd_table,
     lr_layout type ref to cl_wd_flow_data,
     node_flights type ref to if_wd_context_node,
     it_flights type sflight_tab1.

     node_flights = wd_context->get_child_node( 'SFLIGHT' ).
     select * from sflight into table it_flights up to 100 rows.
      node_flights->bind_table(
          new_items            = it_flights
*          SET_INITIAL_ELEMENTS = ABAP_TRUE
*          INDEX                = INDEX
             ).
lr_table = cl_wd_table=>new_table(
*         ACCESSIBILITY_DESCR           = ACCESSIBILITY_DESCR
*         BIND_ACCESSIBILITY_DESCR      = BIND_ACCESSIBILITY_DESCR
           bind_data_source             = 'SFLIGHT'  "Node name
*         BIND_DESIGN                   = BIND_DESIGN
*         BIND_EMPTY_TABLE_TEXT         = BIND_EMPTY_TABLE_TEXT
*         BIND_ENABLED                  = BIND_ENABLED
*         BIND_FIRST_ACTUAL_ROW         = BIND_FIRST_ACTUAL_ROW
*         BIND_FIRST_VISIBLE_ROW        = BIND_FIRST_VISIBLE_ROW
*         BIND_FIRST_VISIBLE_SCROLL_COL = BIND_FIRST_VISIBLE_SCROLL_COL
*         BIND_FIXED_TABLE_LAYOUT       = BIND_FIXED_TABLE_LAYOUT
*         BIND_FOOTER_VISIBLE           = BIND_FOOTER_VISIBLE
*         BIND_GRID_MODE                = BIND_GRID_MODE
*         BIND_LEGEND_ID                = BIND_LEGEND_ID
*         BIND_READ_ONLY                = BIND_READ_ONLY
*         BIND_ROW_COUNT                = BIND_ROW_COUNT
*         BIND_ROW_SELECTABLE           = BIND_ROW_SELECTABLE
*         BIND_SCROLLABLE_COL_COUNT     = BIND_SCROLLABLE_COL_COUNT
*         BIND_SELECTED_POPIN           = BIND_SELECTED_POPIN
*         BIND_SELECTION_MODE           = BIND_SELECTION_MODE
*         BIND_TOOLTIP                  = BIND_TOOLTIP
*         BIND_VISIBLE                  = BIND_VISIBLE
*         BIND_VISIBLE_ROW_COUNT        = BIND_VISIBLE_ROW_COUNT
*         BIND_WIDTH                    = BIND_WIDTH
         DESIGN                        = cl_wd_table=>E_DESIGN-STANDARD
*         EMPTY_TABLE_TEXT              = EMPTY_TABLE_TEXT
         ENABLED                       = ABAP_TRUE
         FIRST_ACTUAL_ROW              = 0
         FIRST_VISIBLE_ROW             = 0
*         FIRST_VISIBLE_SCROLL_COL      = FIRST_VISIBLE_SCROLL_COL
*         FIXED_TABLE_LAYOUT            = FIXED_TABLE_LAYOUT
         FOOTER_VISIBLE                = ABAP_TRUE
         GRID_MODE                     = CL_WD_TABLE=>E_GRID_MODE-BOTH
*         ID                            = ID
*         LEGEND_ID                     = LEGEND_ID
*         ON_FILTER                     = ON_FILTER
*         ON_LEAD_SELECT                = ON_LEAD_SELECT
*         ON_SCROLL                     = ON_SCROLL
*         ON_SORT                       = ON_SORT
*         READ_ONLY                     = READ_ONLY
         ROW_COUNT                     = -1
         ROW_SELECTABLE                = ABAP_TRUE
*         SCROLLABLE_COL_COUNT          = -1
*         SELECTED_POPIN                = SELECTED_POPIN
         SELECTION_CHANGE_BEHAVIOUR    = cl_wd_table=>E_SELECTION_CHANGE_BEHAVIOUR-AUTO
         SELECTION_MODE                = cl_wd_table=>E_SELECTION_MODE-AUTO
*         TOOLTIP                       = TOOLTIP
*         VIEW                          = VIEW
         VISIBLE                       = cl_wd_table=>E_VISIBLE-VISIBLE
          VISIBLE_ROW_COUNT             = 50
*         WIDTH                         = WIDTH
            ).


     lr_layout = cl_wd_flow_data=>new_flow_data(
*                 CELL_DESIGN = E_CELL_DESIGN-PADLESS
                  element     = lr_table
*                  ID          = ID
*                  V_GUTTER    = E_V_GUTTER-NONE
                        ).

     lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
     lr_container->add_child( lr_table ).

endmethod.

Thanks,

Suman

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member300754
Participant
0 Kudos

hi kumar

could you show me the sources or links about POPIN. i'm wondering to know how to use/create popin in WebDynpro.

Thanks in advance,

Peerasit

abhimanyu_lagishetti7
Active Contributor
0 Kudos

use CL_WD_DYNAMIC_TOOL=>CREATE_TABLE_FROM_NODE

Abhi

Former Member
0 Kudos

Thanks Abhi,

why we are not able to use new_table( ).since it is giving all table prperties.

one more question is how to handle the table events for dynamic table.

thanks

Suman

abhimanyu_lagishetti7
Active Contributor
0 Kudos

You can use new_table also, however you have to create table columns and cell editors seperately for each column in that case.

in CREATE_TABLE_FROM_NODE method of CL_WD_DYNAMIC_TOOL

pass the parameter ON_LEAD_SELECT with the action name to map event dynamically

also you can call SET_ON_SCROLL and SET_ON_LEAD_SELECT methods of CL_WD_TABLE which is the return type of CREATE_TABLE_FROM_NODE

Abhi

Former Member
0 Kudos

Hi ,

There is a different method of creating the dynamic table in the screen . .Check the program 'DemoDynamic'.

With Regards,

Ranganathan.

Former Member
0 Kudos

Hi Suman,

Pass the parameter 'bind_data_source ' with '[View].[contextnodename]'. I think that should work.

with Regards,

Ranganathan.