cancel
Showing results for 
Search instead for 
Did you mean: 

how can a user input data into input field in a table cell in webdynpro

Former Member
0 Kudos

I had created a table with input fields in webdynpro.I am not able to enter data into it while testing.Can anyone help me out?

thanks n regards

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Create table columns with input filelds.Then add the following code in doinit method,

IPrivateAView.ITableNode tnode =wdContext.nodeTable();

IPrivateAView.ITableElement tele=tnode.createTableElement();

tele.setT1("");

tele.setT2("");

tnode.addElement(tele);

(It just to set the inputfield editable).

Or u can set the bapi values through JCO or JCA.

Regards

Nandha

Former Member
0 Kudos

Hi,

can u explain abt coding . if u mention any variable in this coding. pls urgent, i need ur help. i waiting for ur reply now.

Former Member
0 Kudos

THis coding ,

IPrivateAView.ITableNode tnode =wdContext.nodeTable();

IPrivateAView.ITableElement tele=tnode.createTableElement();

tele.setT1("");

tele.setT2("");

tnode.addElement(tele);

Former Member
0 Kudos

Hi,

<b>Create the Table Node:</b>

IPrivateAView.ITableNode tnode =wdContext.nodeTable();

<b>And create the Element For table Node(Which is bind with ur Table):</b>

IPrivateAView.ITableElement tele=tnode.createTableElement();

<b>Add the Values for The Table Element(Bapi values or empty values):</b>

tele.setT1("");

tele.setT2("");

<b>Add the Elements to the Table Node:</b>

tnode.addElement(tele);

Regards

Nandha

Former Member
0 Kudos

Isn't this WD Java?

Former Member
0 Kudos

hi Suju,

create a button named 'Insert Row' and attach an event handler to it.

suppose your table UI element is binded to the node SFLIGHT.

then do the following code within your event handler:-

DATA:

node_sflight TYPE REF TO if_wd_context_node,

itab TYPE STANDARD TABLE OF sflight.

  • navigate from <CONTEXT> to <SFLIGHT> via lead selection

node_sflight = wd_context->get_child_node( name = wd_this->wdctx_sflight ).

node_sflight->get_static_attributes_table( IMPORTING table = itab ).

INSERT INITIAL LINE INTO TABLE itab.

node_table->bind_table( itab ).

Now whenever u click on the button 'Insert Row', one blank row will be inserted into the table and u can put value there if the cell editor is input field.

hope this will solve your problem.

Regards,

Subhasis.

<b>Reward points if helpful</b>.

Former Member
0 Kudos

I am not cocerned of inserting row but to input data into the table cell created while testing the webdynpro application.

kindly help me out for this.

thanks

Former Member
0 Kudos

hi suju..........

first of all you have to insert an empty row into the table ( ie without now values ) . you can also do it in wddoinit method. once you insert that empty row....... the user will be able to enter records into that row....... incase if you nedd more such rows...... insert as much empty records..... it will work.

---regards,

alex b justin

Former Member
0 Kudos

Hello ,

To input the data in the table you haeto enter the initail values in the node.For this purpose.In the node of the component controller define a supply function. Fill tree.

And add the following code.the table will come in editable mode.


data:
    stru_node2            type if_componentcontroller=>element_<name of node>,
    table_struct type table of if_componentcontroller=>element_<name of node>.
** @TODO compute values
** e.g. call a data providing FuBa
  stru_node2-ematn = ''.   " sample only !
  stru_node2-menge = ''.   " sample only !
  stru_node2-netpr = ''.   " sample only !
  stru_node2-werks = ''.   " sample only !
  stru_node2-ebelp = ''.   " sample only !
  stru_node2-tx_cd = ''.   " sample only !
  stru_node2-it_cat = ''.   " sample only !

  append stru_node2 to table_struct.
  append stru_node2 to table_struct.
  append stru_node2 to table_struct.
  append stru_node2 to table_struct.
  append stru_node2 to table_struct.
  append stru_node2 to table_struct.

** bind a single element
  node->bind_elements(
      new_items            = table_struct
*      set_initial_elements = abap_true
*      index                = index
         ).

Hope this solve your problem.
Assign points for helpful answers.

Regards
Aashish Garg

Former Member
0 Kudos

Hello,

You can create (say) 5 elements in a loop and append them to your context node.

This can be achieved by two methods of if_wd_context_node, namely, create_element and bind_element.

Regards,

Neha

Former Member
0 Kudos

hi suju.........

unless there are any values in the node to which this table is bound.... the table will be in display mode.... so create an empty record.... then you will be able yo enter values in the table......

-


regards,

alex b justin

Former Member
0 Kudos

I am new to this webdynpro, so kindly help me out by telling me the steps from the begining.

also do tell me the code used so that a user can enter data into the input field in the table cell while testing the webdynpro application