03-15-2015 7:24 PM
Hello Guys
I have a requirement where I need to create a custom table without any primary keys and it can have only one entry in database at max.
It mean the user should not be able to insert new row but can modify only the existing row. The fields should be character type with a size of 1000 characters.
I created table with 4-5 fields of char predefined type with length 1000 characters but when I try to maintain in SM30 I do not get any fields for input.
Even I do not see the table fields in the table maintainence generator (modification screen).
Could you please help.. Is this requirement not possible? I also need help in creating event for table to have only one entry.
Thanks in advance.
03-15-2015 7:58 PM
All database tables must have a primary key. In this case, it can be the client (MANDT). Then add your four fields as non-primary.
But 1,000 characters is awfully long for a field.
Rob
Message was edited by: Rob Burbank
03-15-2015 7:58 PM
All database tables must have a primary key. In this case, it can be the client (MANDT). Then add your four fields as non-primary.
But 1,000 characters is awfully long for a field.
Rob
Message was edited by: Rob Burbank
03-16-2015 3:23 AM
Hi Rob
Yes, since the table must have primary key, I have used MANDT field to complete it.
The problem now with the character fields, I am able to activate table & create table maintainence but when I try to add entry in SM30, I do not get any fields for input. Even in SE11, screen modification also I do not see the table fields in the attributes/layout.
Is this because all the fields are character fields or non key fields? Is my requirement not possible to implement?
03-16-2015 6:53 AM
Hi Santosh,
Its possible to have non-key fields with mandt as key.
delete and re-generate the table maintenance view again with maintenance type = Two step.
Also make sure that, in the Delivery and Maintenance " Display/Maintenance allowed" is chosen.
Regards,
Rama
03-16-2015 8:12 AM
Hi Rama
Thank you. Its working after maintainence type changed to two step. I am able to add entries through SM30 now.
Can you help in how/where to add logic to restrict the number of entries in table to only 1?
Regards,
Santosh
03-16-2015 8:20 AM
Hi Santosh,
Here in your table as only client field MANDT is key, system allows only one entry per client.
So, you no need to do anything.
Always, only one record is maintained per client. You can only overwrite but cannot add more than 1 record.
Regards,
Rama
03-16-2015 9:02 AM
Hi Rama
yes, you are correct..I just realised it..
Thanks a lot for your help..
Regards,
Santosh