cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Creation of cells or change of cell behaviour of a table at runtime

mani_sreedharala
Active Participant
0 Kudos

Hello all,

Can anybody tell me how can we change the cell behaviour of a table at runtime or creating the table row with different cell properties dynamically at runtime in ABAP webdynpro.

for ex the table at runtime can be like...

The 1st row the 1st cell can be a check box.

The 2nd row the 1st cell can be a input field.

The 3rd row the 1st cell can be a radio selection field.

Business Ex : Dynamic Attributes in BID Invitation

Thanks in advance in clarifying the doubt.

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hi Mani,

Do you really need a table? Try to use some <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/d9/9a80415dc6050de10000000a1550b0/frameset.htm">containers</a> like Group, TransparentContainer or other with appropriate layout and layout settings.

Best regards, Maksim Rashchynski.

mani_sreedharala
Active Participant
0 Kudos

Hello,

Thanks for the reply.

I can create a table. but my main requirement is to control the cell property at runtime. i.e., in a single column the cells can be either radiobutton/checkbox or input field and the cell property is decided at runtime by the content of the cell value.

Just for ex...dynamic attributes of a quotation in SRM. Here the column cell will change automatically by the conten of the value to either a checkbox or radiobutton.

Please give me advice how to handle this situation.

Thanks,

Mani

Former Member
0 Kudos

In version NW04, the table rows are homogenous, i.e. there can only be one cell editor type per column.

In NW04s, there are table cell variants which allow to have different editors in a column.

Armin

Answers (1)

Answers (1)

srinivasa_raghavachar
Participant
0 Kudos

Hi Mani,

You could use code similar to the following code in your WDDOMODIFY method of the view in which the table is placed.

data wd_table_cell_editor type ref to cl_Wd_view_element.

data wd_table_column type ref to cl_wd_table_column.

wd_table_cell_editor ?= view->get_element( ID ). (Or any other way to get the refernce to the table cell editor)

wd_table_column ?= wd_table_cell_editor->get__parent( ).

(Get a refernce to table column throught table cell editor or directly)

Now use the set_cell_editor method of wd_table_column to set the column to check box or input or any other field of your requirement.

Also, I suggest you to use ALV as it is simpler change the cell editor and it provides many other improved functionalities.

Regards,

Srini.