Application Development 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: 

Inserting Lines to Z table

Former Member
0 Kudos

Hi All,

We have a custom screen (Z Transaction and Z Screen) through which End User will be entering the data.

The data should be inserted into a Z Table.

No Line of the Z Table should be overweritten or modified... Each time, the data should be inserted as new line.

Please guide me how to perform this operation..

Thanks and Regards

Pavan

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

use insert statement

data it_table type ztable.

Insert ztable from it_table .

NB: the structure of the Z table and internal table should same.

to store each record u ve to segregate the previous record with the current one and hence try to very clear about the primary keys of the Z table .

regds

sachhi

7 REPLIES 7

former_member181962
Active Contributor

Former Member
0 Kudos

Pavan,

simply use insert statement, to know more abt insert. press f1 on insert.

Regards,

Naresh.

former_member203501
Active Contributor
0 Kudos

please search in the forum...there are many answers..

see the below response from the search ..

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/insert_d.htm

Former Member
0 Kudos

Hi,

use insert statement

data it_table type ztable.

Insert ztable from it_table .

NB: the structure of the Z table and internal table should same.

to store each record u ve to segregate the previous record with the current one and hence try to very clear about the primary keys of the Z table .

regds

sachhi

Former Member
0 Kudos

Table Maintenance Generator

When creating table, you will find a check box 'Table maintenance allowed'. If we check that option, we can manually enter entries using SE16 or table maintenance generator screen.

SE16 is for data browser.

How to create table maintenance generator?

Go to Se11, give the table name and click on change. Then Go to utilities--> Table maintenance generator.

In the table maintenance generator screen, we should give Authorization Group, Function Group name (Function Group name can be same as table name), Maintenance type can be one step or two step, usually we will create with one step. we should give maintenance screen number.

After clicking on create button, a table maintenance generator will be created.

To check it go to SM30 . In SM30, we find display, Maintain options.

We can view the table contents by choosing Display and we can create table entries by choosing Maintain.

Thank you,

Gopi.S

Former Member
0 Kudos

Hi,

When user enter any data from scree then first check that entry exists in the database table by checking the primary key (By Select query) if entry exists then give an error message. otherwise use insert statement to insert data to Z table.

Former Member
0 Kudos

Hi,

First whatever the data that is entered in the selection screen , should be stored in an internal table .

The fields of the ineternal table and the z table should be existing and also in the same order .

use update statement to enter the data in the ztable .

Update will create a new record if the record does not exists , else will modify the existing record .

let me know if any thing is required .