on 05-27-2008 12:29 PM
HI All,
I want to insert the data into the table which is inthe same view.
My scenario is
Iam having two input fields (Firstname and lastname)
After entering the inputs and click on the submit button
the data should insert in the table which is in the same view.
if possible please provide some code.
Thanks
Mahalakshmi.K
Hi Mahalakshmi kothuri ,
On the submit event of the submit button read the values of both the input fields using code wizard. then using the values read ..
using the Function module or coding get the value you need to be populated on the table based on the input fields.
now populate the iternal table containing values to the node thats mapped to the table in the screen using bind table method.
Regards
Sarath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mahalakshmi
Use the following code snippet
method ONACTIONSUBMIT .
TYPES : BEGIN OF t_table,
firstname TYPE string,
lastname TYPE string,
END OF t_table.
data : lt_table TYPE TABLE OF t_table,
wa_table TYPE t_table.
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->element_context.
DATA lv_firstname LIKE ls_context-firstname.
DATA lv_lastname LIKE ls_context-lastname.
* get element via lead selection
lo_el_context = wd_context->get_element( ).
* get single attribute
lo_el_context->get_attribute(
EXPORTING
name = `FIRSTNAME`
IMPORTING
value = lv_firstname ).
lo_el_context->get_attribute(
EXPORTING
name = `LASTNAME`
IMPORTING
value = lv_lastname ).
wa_table-firstname = lv_firstname.
wa_table-lastname = lv_lastname.
APPEND wa_table to lt_table.
DATA lo_nd_table TYPE REF TO if_wd_context_node.
DATA lo_el_table TYPE REF TO if_wd_context_element.
DATA ls_table TYPE wd_this->element_table.
* navigate from <CONTEXT> to <TABLE> via lead selection
lo_nd_table = wd_context->get_child_node( name = wd_this->wdctx_table ).
lo_nd_table->bind_table( lt_table ).
endmethod.
Hope this helps U
Regards
Tamilselvan.K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
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.