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

ztabe fields not able to edit.

Former Member
0 Likes
1,073

I have created ztable with 5 fields which are

plant, material type, material group, created by user and changed by user.

out of which I created plant, material type, material group as primary keys

So I went to sm30, and created a record.

Again when I try to edit that record like plant, material type, material group are in disable mode.

Is that because of I have maked as primary key fields ?

If so, what to do to make these fields editable ( also on more thing is how many primary key fields mimimum I can keep in this case) ?

Thanks in advance...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,006

Hi Sam ,

You can not create table with out primary key .

You need to specify the primary keys as per your requirement and you can notable

to edit the primary keys . So to change a primary key you need to delete the full records

and need to create it again with the final values.

Regards

Pinaki Mukherjee

I have created ztable with 5 fields which are

plant, material type, material group, created by user and changed by user.

out of which I created plant, material type, material group as primary keys

So I went to sm30, and created a record.

Again when I try to edit that record like plant, material type, material group are in disable mode.

Is that because of I have maked as primary key fields ?

If so, what to do to make these fields editable ( also on more thing is how many primary key fields mimimum I can keep in this case) ?

Thanks in advance...

8 REPLIES 8
Read only

former_member156446
Active Contributor
0 Likes
1,006

>

> ( also on more thing is how many primary key fields mimimum I can keep in this case) ?

>

table can be created even with out a primary key also... so it will be ur call on how many keys to use...

check the table maintenance generator events in SCN

Read only

MarcinPciak
Active Contributor
0 Likes
1,006

Hi Sam,

When you are editing a view with SM30 it is using maintenance view . For this kind of view it is mandatory that ALL primary key fields of all the tables which the view comprise of, must be provided. Here you have only one table, therefore all key fields must be included in the view. This is because system must be sure that you are populating a table only with unique entries.

Furhtermore it is not possible to change key fields of the view/table. How would that be stored in DB then? The entires must be unique and only unique key ensures that. Therefore you can't change any key fields, only function fields (non-key fields). If you want to change some entry, either change content of non-key fields or delete an entry and create a new one. There is no other way.

Regards

Marcin

Read only

Former Member
0 Likes
1,006

If I tried to create table with out primary keys .

MANDT MANDT

WERKS WERKS_D

MTART MTART

MATKL MATKL

CREATED_BY SYUNAME

CHANGED_BY SYUNAME

How ever I am getting error as

"ZTEST2 (specify a primary key)".

I did not get you - "check the table maintenance generator events in SCN" ?

main thing is how can I make the entried in the table ( all fields )editable ?

Read only

0 Likes
1,006

He meant reading [this document|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8129f164-0a01-0010-2a8e-8765287250fc] but this will not help you here.

Anyhow as I told you, it is not possible to make all the fields editable. You simply can't create an entry to a table without providing primary key fields. The same applies to changing an enty. You can't change key fields.

Regards

Marcin

Read only

Former Member
0 Likes
1,006

J@Y , can you comment on this as you said

I can create table with out primary keys.

However I tried to create one and I got error which I mentioned in my earlier response.

Read only

Former Member
0 Likes
1,007

Hi Sam ,

You can not create table with out primary key .

You need to specify the primary keys as per your requirement and you can notable

to edit the primary keys . So to change a primary key you need to delete the full records

and need to create it again with the final values.

Regards

Pinaki Mukherjee

Read only

RahulKeshav
Active Contributor
0 Likes
1,006

u cant create Ztable without primary key...

it should have atleast one primery key.....

for editing the fields ,u have to either make those fields as non-primary or delete the record.....

Edited by: Rohit Kumar on Apr 29, 2009 5:15 PM

Read only

RahulKeshav
Active Contributor
0 Likes
1,006

If solved...close the thread...