cancel
Showing results for 
Search instead for 
Did you mean: 

how to insert datas from internal table into databasetable through onclick

Former Member
0 Kudos

tell me how to insert datas from internal table into

database table through onclick event.....

send me the coding..........

Accepted Solutions (1)

Accepted Solutions (1)

baskaran00
Active Participant
0 Kudos

Hi,

U can try below code

insert into ztable values from table itab.

or

Loop at itab.

INSERT INTO ztable VALUES wa.

endloop.

Thankx,

Router

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Kumar,

First take the data from the input fields into work area then u can write the insert statement as insert into (table name) values wa.

or

If u want to insert the data from internal table into table then first take the the data from input fields to work area then append that work area to internal as append wa to internal table then write the select statement as INSERT dbtab FROM TABLE itab

Here itab is internal table and wa is work area.

Reward points if useful.........

Former Member
0 Kudos

Hello,

Create a context node with cardinality 0..n and the bind it with the table.

To populate a node you need to proceed like follows:


  DATA:
    lt_list TYPE        wd_this->elements_list.
    lr_list TYPE REF TO if_wd_context_node.

  SELECT * FROM zlist INTO lt_list.
  lr_list = wd_context->get_child_node( name = wd_this->wdctx_list ).
  IF lr_list IS NOT INITIAL.
    lr_list->bind_table( lt_list ).
  ENDIF.

This code must be in the action that is associated with button (property onAction ).

Regards.