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: 

Insert Data into Z_Table

Former Member
0 Kudos

Hi Friends,

I created a Z_table using SE11.

Now, I want to insert data into this table from my Z_Program.

I don't want to use the Insert Statement as it is not recommented.

Kindly, let me know the steps in detail, how to populate the Z_Table.

Thanks in advance,

Ishaq Ali Khan.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I have done the Table Maintainance Generator Part. But when I go to SM30 and run, it is throwing Error:

Z_TABLE can only be maintained with Restrictions.

And it is not going in. Let me know what to do.

Ishaq.

8 REPLIES 8

Former Member
0 Kudos

Create a table maintenance generator (I mean a maintenance

view) for your table ..

goto SM30 .. and append data from there ...

Former Member
0 Kudos

Hi ishaq,

1. this is one way.

2. declare an internal table (same as z table)

and populate it with data.

3. then

4. Loop at itab.

modify ZDBTAB from Itab.

endloop.

(Modify will take care of inserts/updates based upon

the primary key)

regards,

amit m.

Former Member
0 Kudos

Hi,

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/how%20to%20im...

steps for table Maintenance

1) go to se11 check table maintanance check box under

attributes tab

2) utilities-table maintanance Generator->

create function group and assign it under

function group input box.

also assign authorization group default &NC& .

3)

select standard recording routine radio in table

table mainitainence generator to move table

contents to quality and production by assigning

it to request.

4) select maintaience type as single step.

5) maintainence screen as system generated numbers

this dialog box appears when you click on create

button

6) save and activate table

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed2d446011d189700000e8322d00/content.htm

http://help.sap.com/saphelp_46c/helpdata/en/a7/5133ac407a11d1893b0000e8323c4f/frameset.htm

/message/2831202#2831202 [original link is broken]

One step, two step in Table Maintenance Generator

Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one screen where you can add, delete or edit records.

Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and can further go on to edit further details.

You need to create a "Parameter Transaction".

What this means is that you will have a transaction (let's call it "ZMAINT") which calls "SM30" and passes in your table name.

Go to transaction SE93 and enter your new transaction code. Enter in the Tcode description and choose "Transaction with Parameters" (it shouldbe the last radio button).

Enter in the default transaction "SM30" and tick the "Skip Initial Screen" check box. Hit Enter.

Now scroll to the bottom of the screen and you will see a Table Control where you will need to enter in the values to the SM30 selection screen.

Because you hit ENTER, the program will have loaded in the Selection Screen parameters into it's memory. Hit the drop down for "Name of Screen Field" and select "VIEWNAME" and then enter in your Z Table in the "Value" column.

Now go to the next line and hit the drop down and select "UPDATE" in the "Name of Screen Field". Enter in a "X" in the value column.

Now save the transaction and there you have it.

OR

You need to create a Parameter transaction - In SE93 while creating the tcode, specify the last option (Transaction with Parameters or Parameter Transaction).

In the subsequent screen, under the Defaults block, specify the transaction as SM31 and select the check-box 'Skip initial screen'.

At the bottom of this screen, in the list you would specify the following-

Name of screen field

-


Values

UPDATE

-


X

VIEWNAME

-


Name of your table

Save all these.

http://www.sap-img.com/abap/create-a-table-maintance-program-for-a-z-table.htm

Regards,

shiva.

Former Member
0 Kudos

hi,

use UPDATE <DB tab> from <Work area>.

COMMIT WORK.

Update command works like both insert & modify.

Chandra

Former Member
0 Kudos

I have done the Table Maintainance Generator Part. But when I go to SM30 and run, it is throwing Error:

Z_TABLE can only be maintained with Restrictions.

And it is not going in. Let me know what to do.

Ishaq.

0 Kudos

I think UR not having proper authorization

0 Kudos

Hi,

As it is a Z-table created by you, do the following to have complete authorization for Maintenance.

1. Go to Delivery and Maintenance Tab in SE 11 and select Display maintenance allowed.

2. Save.

This will allow you to maintain the table.

with regards,

Ramalakshmi

Former Member
0 Kudos

Hi,

You have various methods for updating database with data.

You can use BDC if you have data in either internal table or flat file.

If data is there in the internal table. then follow the steps:

1) Using SHDB record SE11 transaction by creating one entry and save it.

2) Using this recording generate a program and use BDCDATA structure and fill it from the data in the internal table.

3) Use either call transaction or session method for uploading data.

sample programs can be found at:

[http://www.sap-img.com/bdc.htm]

<REMOVED BY MODERATOR>

Thanks and Regards.

Edited by: Alvaro Tejada Galindo on Apr 22, 2008 3:49 PM