2009 Apr 28 5:28 PM
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...
2009 Apr 29 4:00 AM
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...
2009 Apr 28 6:31 PM
>
> ( 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
2009 Apr 28 7:11 PM
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
2009 Apr 28 8:42 PM
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 ?
2009 Apr 28 8:49 PM
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
2009 Apr 28 9:03 PM
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.
2009 Apr 29 4:00 AM
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
2009 Apr 29 7:10 AM
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
2009 Apr 29 12:44 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |