Skip to Content
author's profile photo Former Member
Former Member

how to display inserted records in a table

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...

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 01:16 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 12:41 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.