cancel
Showing results for 
Search instead for 
Did you mean: 

table of input fields.

Former Member
0 Kudos

Hi ,

Some one know how to do a table of input fields.

I do it in the binding process of the table but it doesn't work.

I discovred too checkox in in the node properties in the context of the component controller :

- interface node

- input element

I don't know if it's the solution.

I tried to select them both but when i excute i have error.

Any suggestion.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I read it several time to see if i understand what you have written unfortunately I am having difficulties to understand what the problem is.

What are you trying to do ?

Former Member
0 Kudos

Hi,

I'm sorry if my English isn't perfect.

Well, I try to add in my view a table of input fields.

So the user must fill-in this table.

In the binding process of the table to my context node i choose "input field" instead of "text view".

But i haven't any positive result.

Thanks

Former Member
0 Kudos

Hi,

Please walk through the steps.

1.in a view , you have a table UI.

2.Right click table UI and choose create binding.

3.In the new popup, you select a context node - select a node from your view

4.Standard cell editor - You choose input field.

5.Select the context attributes you want to be displayed in the table columns.

can you confirm which step is not working ?

BTW: Row repeater UI can also be used here instead of Table UI

Edited by: Baskaran Senthivel on Mar 31, 2011 5:55 PM

former_member199125
Active Contributor
0 Kudos

If you are confused with the baskaran steps,

then follow the below steps.

Click on code wizard, select table-> select required context node--> change the text field to input field.

and continue

now you will get a table of input fields.

Former Member
0 Kudos

Hi ,

I do exactly what you have said.

I used both methods.

But no positive result.

The table is still locked and i can't fill-in any field.

the table's fields have "input" type.

But when i try to show the view in my IE browser , they are locked.

Edited by: dyngry on Mar 31, 2011 6:11 PM

Former Member
0 Kudos

Hi..

I think already u bind table source property with some context.. after that

In right side.. ROOTUIELEMENTCONTAINER->Right click on table which you are using->click on create binding,

If opens one window, check IN STANDARD CELL EDITOR - IF it is text view change it to input field. and continue,

Now you get your table fields as input fields. hope it helps..

Cheers,

Kris.

Edited by: kissnas on Apr 1, 2011 6:54 AM

Former Member
0 Kudos

Hi,

I checked as you said.

But they are already in "input fields" type.

And when i test the program i can't fill-in any field in the table.

They seem locked.

Thanks

Former Member
0 Kudos

Hi,

I think that the problem come from the cardinality which is equal to "0..n"

Because when i change it to "1..n" , the 1st row is unlocked, and i can fill-in it.

Have you any idea ?

Thanks in advance.

Former Member
0 Kudos

Hi,

Cardinality should be 0-n..

can u explain what u done exactly, and any code post here..

Cheers,

Kris.

Former Member
0 Kudos

Hi,

Cardinality should be 0-n..

can u explain what u done exactly, and any code post here..

Cheers,

Kris.

Former Member
0 Kudos

Hi ,

There is no code to post.

And yes, i let the cardinality as it was by default '0..n'.

What i want to develop is simple.

I have a product X and the user must fill-in all components of this product.

I want to do it in a table.

In this table each row corresponds to a substance (a component) that compose the product.

Tell me if i'm not clear enough.

Thanks

Former Member
0 Kudos

Hi..

It is simple to create table with input enable.

Create context first. select ROOTUIELEMENTCONTAINER

go to code wizard - you have options form and table - select table.

change standard cell editor to input field. or you can change this after binding.

click on CONTEXT - and BInd with your node.

Now you get created table with input enabled.

Hope it solves.

Cheers,

Kris.

Abhinav_Sharma
Contributor
0 Kudos

Hi,

I guess the problem is that there is no element created. To allow the user to enter values in input field, you first need to create context element. The element should be of same type as the node which is bound to the table.

Suppose, TableNode is the node which is bound to the table. Then you can create element as follow:

DATA: lo_tablenode type ref to IF_WD_CONTEXT_NODE,

lo_element type ref to IF_WD_CONTEXT_ELEMENT.

lo_tablenode = wd_context->get_child_node( name = ''TABLENODE' ).

lo_element = lo_tablenode->create_element( ).

lo_tablenode->BIND_ELEMENT( new_items = lo_element set_intial_elements = abap_false ).

You can explore other methods of IF_WD_CONTEXT_NODE like bind_elements, bind_table etc..

Regards

Abhinav

Former Member
0 Kudos

Hi ,

Please read the conversation from the beginning.

I have already done this and i know how to create a table with the wizard with input fields.

What i don't understand is why when i execute the program, fields are locked like they are marked for "read only" which is not the case.

Thanks

Former Member
0 Kudos

Hi Abhinav Sharma,

Do you know where i have to write this code ? i gess, it is before showing the screen ?

Can you tell me if there is an hook method that i can use ?

Thanks.

Former Member
0 Kudos

Hi Abhinav Sharma,

I put the code that you gives to me after few syntax correction not very difficult to set up in WDDOINT in the view controller.

And it works.

The first row is unlocked and i solved also another problem.

Before these i can't retrieve also error messages.

Now i retreive them in a table.

The problem is that is only one row is unlocked.

Can you explain me what you do in these lines :

lo_element = lo_tablenode->create_element( ).
 lo_tablenode->BIND_ELEMENT( new_item = lo_element set_initial_elements = abap_false ).

i guess you create a new element but why we don't precise its type ?

thanks a lot for your response.

Abhinav_Sharma
Contributor
0 Kudos

Hi

Actually, in these lines i am creating an instance of node so that it can contain values. If there is not instance you can not set the values.

lo_element = lo_tablenode->create_element( ).

lo_tablenode->BIND_ELEMENT( new_item = lo_element set_initial_elements = abap_false ).

In order to create another element, use the same line of code. Also, what you can do is use BIND_TABLE method. For this you need to fill the internal table first and then u can pass the internal table to the method.

This way you can enable multiple elements at once based upon the no of rows in the internal table.

Refer this [Tutorial|http://www.sapdev.co.uk/sap-webapps/sap-webdynpro/wdp_poptable.htm]

and this [http://www.sapdev.co.uk/webapps/webdynpro/wdp_intotable.htm|http://www.sapdev.co.uk/webapps/webdynpro/wdp_intotable.htm]

Regards

Abhinav

Former Member
0 Kudos

HI,

here is the code. i use it in wddoint in the view.

When i use your code which is marked as a comment. it works for the first row.

I mean that only the first row is unlocked.

But when i use my code ("bind table") it doesn't work at all.


  DATA: lo_tablenode type ref to IF_WD_CONTEXT_NODE,  lo_element type ref to IF_WD_CONTEXT_ELEMENT.
  DATA: lo_node_1 TYPE REF TO if_wd_context_node.
  DATA: PROP_COMPONENT_TAB type standard table of bapi1077VP.

 lo_tablenode = wd_context->get_child_node( name = 'PROP_COMPONENT' ).
 lo_tablenode->BIND_TABLE( PROP_COMPONENT_TAB ).

* lo_element = lo_tablenode->create_element( ).
* lo_tablenode->BIND_ELEMENT( new_item = lo_element set_initial_elements = abap_false ).

Experts can you explain me this please.

Thanks

Abhinav_Sharma
Contributor
0 Kudos

Hi

If you want to create N rows in a table then you have to create N elements. If you want to allow the users to add the row, then create one button say Add Rows. onAction of that button, write below mentioned code:

DATA: node_emp type ref to IF_WD_CONTEXT_NODE,

ele_emp type ref to IF_WD_CONTEXT_ELEMENT.

node_emp = wd_context->get_child_node( name = 'EMPLOYEE').

ele_emp = node_emp->create_element( ).

node_emp->bind_element( new_item = ele_emp set_initial_elements = abap_false ).

In this example, I have a node called Employee. and this node is bound to a table. When user clicks on Add button, a new row is created and user can enter the values.

Regards

Abhinav

Answers (0)