cancel
Showing results for 
Search instead for 
Did you mean: 

Editable table

Former Member
0 Kudos

How to make a table input enabled, that is user should be able to enter data in the table just like a input field.

Thanks,

Pritam.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Pritam,

While creating table UI in WDA toy can define the table as input enabled. Insert table UI element, right click on created table element and select "Create Binding". Define "Context Node". Below this under "Standard Cell Editor" , select "Input Field" instead of "Text View". Now your table will be input ready during runtime.

You can also add more editable rows during runtime. For this create a button with action defined, in table toolbar area, say "Addrows" and write the code as given.

method ONACTIONADDROWS .

data:

Node_Sumit type ref to If_Wd_Context_Node,

Elem_Sumit type ref to If_Wd_Context_Element.

Node_Sumit = wd_Context->get_Child_Node( Name = IF_V_MAIN=>wdctx_Sumit ).

Elem_Sumit = Node_Sumit->create_element( ).

Node_Sumit->bind_element( new_item = Elem_Sumit set_initial_elements = abap_false ).

endmethod.

Here Node_Sumit is the Node which contains some context attributes and have context binding defined with table UI element and V_MAIn is the view name.

I hope this will help your cause.

Regards,

Sumit

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi Pritam,

if you want to make your table editable all the time just append records in the Methode WDDOINIT

Here is an example of how to do that:

Data: wa_att type if_viewname=>element_viewname,

tab_att type if_viewname=>elements_viewname.

data: l_node typre ref to if_wd_context_node.

l_node = wd_context->get_child_node( 'Node Name' ).

append wa_att to tab_att.

l_node->bind_table( tab_att ).

Former Member
0 Kudos

For making a table editable, Use Input Field in the Table Column istead of TextView.

In the Wd doinit() method , write the following code to make table editable :

DATA lo_nd_cn_try TYPE REF TO if_wd_context_node.

DATA lo_el_cn_try TYPE REF TO if_wd_context_element.

DATA ls_cn_try TYPE wd_this->element_cn_try. <CN_TRY is my context Node>

DATA ls_cn_try1 TYPE wd_this->elements_cn_try.

<navigate from <CONTEXT> to <CN_TRY> via lead selection >

lo_nd_cn_try = wd_context->get_child_node( name = wd_this->wdctx_cn_try ).

do 5 times.

clear ls_cn_try.

append ls_cn_try to ls_cn_try1.

lo_nd_cn_try->bind_table( ls_cn_try1 ).

enddo.

Here , your 5 rows will be in editable mode. You can change it as per your requirement.

Refer this Thread :

Thanks.

Saurav.

Former Member
0 Kudos

Hi,

Create Node with required Attributes & cardinality set to 0..n.

Right Click on the ROOTUIELEMENT(simple scenario) & Click on "Create container form".

Click on "Context" Button on the upper right corner of the pop-up window & select the node for which table is to be created.

For your requirement, make sure Standard Cell Editor is set to "Inputfield".Press Enter.

You can see a table with input filed as column editors.

Hope this helps.

Regards

Shruti

Former Member
0 Kudos

Hi,

Could you please clarify, is your requirement static or dynamic i.e. the table property should change at runtime or it should be editable always ??

Regards,

Shweta

Former Member
0 Kudos

It should always be editable.

thanks,

pritam.

arjun_thakur
Active Contributor
0 Kudos

Hi Pritam,

Refer this thread: .

Regards

Arjun

Former Member
0 Kudos

Check this thread:-

[]

Regards,

Radhika.