on 06-18-2008 1:08 PM
Hi i am created 4 fields named 'name' 'age' 'sex' 'district'
and a button named insert.
In the browser if i inserted the records and then click
the button means the records are updated into
the table.
Send me the coding...
Hi Kumar,
if the node for your table is input with four attributes name,age,sex,dist..
then write this code in the event handler of button;
data:
Node_Input type ref to If_Wd_Context_Node,
Elem_Input type ref to If_Wd_Context_Element,
Stru_Input type Wd_This->Element_Input ,
Item_name like Stru_Input-name,
Item_age like Stru_Input-age,
Item_sex like Stru_Input-sex,
Item_dist like Stru_Input-dist,
wa type ztable(name of ur table),
itab type table of ztable.
Node_Input = wd_Context->get_Child_Node( Name = wd_This->wdctx_Input ).
Elem_Input = Node_Input->get_Element( ).
Elem_Input->get_Attribute(
exporting
Name = `name`
importing
Value = Item_name ).
Elem_Input->get_Attribute(
exporting
Name = `age`
importing
Value = Item_age ).
Elem_Input->get_Attribute(
exporting
Name = `sex`
importing
Value = Item_sex ).
Elem_Input->get_Attribute(
exporting
Name = `dist`
importing
Value = Item_dist ).
wa-name = Item_name.
wa-age = Item_age.
wa-sex= Item_sex.
wa-dist= Item_dist.
insert into ztable(name of table) values wa.
or
u wil get the code from webdynpro code wizard.
Edited by: srilalitha yerramsetti on Jun 18, 2008 3:19 PM
Edited by: srilalitha yerramsetti on Jun 18, 2008 3:20 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Just add a new element to the context node binded with the table and it will be showed in the table.
DATA
lr_plot TYPE REF TO if_wd_context_node.
lr_plot = wd_context->get_child_node( name = wd_this->wdctx_plot ).
IF lr_plot IS INITIAL.
RETURN.
ENDIF.
wd_this->element = lr_plot->create_element( ).
lr_plot->bind_element( new_item = wd_this->elemento set_initial_elements = abap_false ).
lr_plot->move_last( ).
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.