Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

module pool regarding how to use insert statement

Former Member
0 Likes
1,561

hi all,

i have a requirement like i have to create a z table and need to insert the values into the z table from my program. i have created the table but i dont know how to insert the values into table. and also the syntax for insert statement can anyone please help me.

thanks in advance.

anupama.

1 ACCEPTED SOLUTION
Read only

valter_oliveira
Active Contributor
0 Likes
934

Hello.

Check this short program to insert lines into your table.

Declaration:


DATA: wa type ZTABLE.

Insertion:


wa-field1 = ...
INSERT ztable FROM wa.

Update:


UPDATE ztable
SET field1 = 'abc'
WHERE field2 = 'X'

Best regards

Valter Oliveira.

6 REPLIES 6
Read only

valter_oliveira
Active Contributor
0 Likes
935

Hello.

Check this short program to insert lines into your table.

Declaration:


DATA: wa type ZTABLE.

Insertion:


wa-field1 = ...
INSERT ztable FROM wa.

Update:


UPDATE ztable
SET field1 = 'abc'
WHERE field2 = 'X'

Best regards

Valter Oliveira.

Read only

Former Member
0 Likes
934

Anupama,

The following are the ways to insert the records to the table.

INSERT INTO dbtab [CLIENT SPECIFIED] VALUES wa.

INSERT INTO (dbtabname) [CLIENT SPECIFIED] VALUES wa.

- INSERT dbtab [CLIENT SPECIFIED].

INSERT *dbtab [CLIENT SPECIFIED].

INSERT (dbtabname) [CLIENT SPECIFIED] ... .

- INSERT dbtab [CLIENT SPECIFIED] FROM TABLE itab.

INSERT (dbtabname) [CLIENT SPECIFIED] FROM TABLE itab.

Kind regards,

Sujith

Read only

Former Member
0 Likes
934

Hi,

You can use these statements...

insert into DBTAB values WORKAREA.

modify DBTAB from WORKAREA .

update DBTAB set bedat = WORKAREA-bedat

bukrs = WORKAREA-bukrs

lifnr = WORKAREA-lifnr

netpr = WORKAREA-netpr

waers = WORKAREA-waers

WHERE ebeln = WORKAREA-ebeln.

*******************************

Reward if helpful.

Regards,

Syed

Read only

Former Member
0 Likes
934

Hi,

Inserts the content of a structure into an internal table.

In the case of a standard table, this content is appended, in a sorted table it is inserted in the right place according to the key, and in a hashed table it is inserted according to the hash algorithm.

Syntax: INSERT wa into table itab <condition>

Plz check this sample program.

data: it_ztable type ztable,

wa_ztable like line of it_ztable.

  • fill structure with values

wa_ztable-field1 = ..........

wa_ztable-field2 = ........

wa_ztable-field3 = ........

insert wa_ztable into table it_ztable.

Please reward points if helpful.

Read only

Former Member
0 Likes
934

solved

Read only

Former Member
0 Likes
934

the bellow statement is used to store the values in data base table,

insert table dbtable from WA