on 09-17-2010 3:16 AM
Hi All,
Does anybody have reference note or teach me how to create dynamic UI element table in web dynpro in abap ?
Regards,
Luke
Hi all,
I just want to testing something is possible or not.
I created the program let user input the table name like EKKO, after that i will generate the table and output table data to ALV automatically.
when i created the button and fire the action, how can i pass value that is dynamic context to WDDOMODIFYVIEW to let the table contain value and output?
Please kindly to help me to do
Regards,
Luke
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you really sure you need to create the Table UI element dynamically. Dynamic UI element creation should only be used as a last resort and is almost always unnecessary. You should seriously consider if there is a way to acomplish what you want without resorting to dynamic UI elements first. To that end, what exact is it that you are trying to do?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI LukeWong ,
for creating any UI dynamically you shoul use their runtime class that always start with cl_wd_* ui element name*
so for the Table UI element the runtime class is CL_WD_TABLE
now reffer the below code for creating the Table UI dynamically
METHOD wddomodifyview.
DATA lr_table TYPE REF TO cl_wd_table.
DATA lr_flow_data TYPE REF TO cl_wd_flow_data.
DATA lr_container TYPE REF TO cl_wd_uielement_container.
DATA lr_column_name TYPE REF TO cl_wd_table_column.
DATA lr_text_view TYPE REF TO cl_wd_text_view.
DATA lr_table_header TYPE REF TO cl_wd_caption.
DATA lr_column_name_header TYPE REF TO cl_wd_caption.
IF first_time EQ abap_true.
lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
lr_table = cl_wd_table=>new_table(
id = 'TBL_TABLE'
bind_data_source = 'TABLE'
design = cl_wd_table=>e_design-alternating
visible_row_count = 3
).
lr_flow_data = cl_wd_flow_data=>new_flow_data( element =
lr_table ).
lr_container->add_child( lr_table ).
lr_column_name = cl_wd_table_column=>new_table_column(
id = 'TBL_EXAMPLE_NAME'
).
lr_table_header ?= cl_wd_caption=>new_caption( text = 'Table UI elem
ent - example').
lr_table->add_column( the_column = lr_column_name ).
lr_table->set_header( lr_table_header ).
lr_text_view = cl_wd_text_view=>new_text_view(
id = 'TXV_NAME'
bind_text = 'TABLE.NAME'
).
lr_column_name_header ?= cl_wd_caption=>new_caption( text = 'Name').
lr_column_name->set_table_cell_editor( the_table_cell_editor = lr_text_view).
lr_column_name->set_header( lr_column_name_header ).
ENDIF.
ENDMETHOD.
Regards
Chinnaiya P
Edited by: chinnaiya pandiyan on Sep 17, 2010 12:01 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use CREATE_TABLE_FROM_NODE method of CL_WD_DYNAMIC_TOOL class.
All you need to do is pass bind the table data to the node and pass node refernce to the above method.
Regards,
Madhu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Did you have a look at the class CL_WD_TABLE . There are methods like NEW_TABLE , using which you can create a table . There are paramaters like BIND_DATA_SOURCE for this method using which you can specify a context node to be bound to table.
Thanks,
Aditya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.