2016 Jan 12 11:02 PM
Hello Experts,
I've build a custom table with three primary/composite keys, including Customer (KUNNR), Billing Type (FKART) and Output Media (ZZ_MEDIA) (as shown below).
However, the issue is I can insert records without Billing Type and Output Media via SM30 as shown below.
Question is, is there anything I can do to prevent it?
Many thanks in Advance.
2016 Jan 13 7:20 AM
Hello,
Composite key is a combination of two or more primary keys in a table.
When you maintain the table, it will take a unique combination of all mentioned keys. even if you enter the value of one primary key and left the remaining primary keys blank, it is a possible combination, so the entry will be added to the table.
If you have requirement to add entry to table only when all the primary keys are entered, you can do the following:
1. Go to table maintenance generator. (Create one if you don't created it already)
2. Go to Menu Environment -> Modification -> Maintenance Screens
It will take you to the screen painter. Now go to Layout. There u can see the screen, the same screen u can see when u execute transaction SM30.
3. Go to the desired tab and make the field as mandatory.
Once you click on respective field tab, You can see the Screen painter: attributes screen , in that go to Attributes tab, Select Program Tab and make input as required from the drop-down.
so the respected Key field become mandatory. You can do the same procedure for other key fields. So entry will be added to table when you provide all primary key values.
Thanks,
Mayuresh
Hello Experts,
I've build a custom table with three primary/composite keys, including Customer (KUNNR), Billing Type (FKART) and Output Media (ZZ_MEDIA) (as shown below).
However, the issue is I can insert records without Billing Type and Output Media via SM30 as shown below.
Question is, is there anything I can do to prevent it?
Many thanks in Advance.
2016 Jan 13 3:08 AM
Try creating Table Maintenance Generator and from table maintenece generator screen goto
Environment -> Modification -> Maintenece Screen and make that field mandatory.
2016 Jan 13 7:20 AM
Hello,
Composite key is a combination of two or more primary keys in a table.
When you maintain the table, it will take a unique combination of all mentioned keys. even if you enter the value of one primary key and left the remaining primary keys blank, it is a possible combination, so the entry will be added to the table.
If you have requirement to add entry to table only when all the primary keys are entered, you can do the following:
1. Go to table maintenance generator. (Create one if you don't created it already)
2. Go to Menu Environment -> Modification -> Maintenance Screens
It will take you to the screen painter. Now go to Layout. There u can see the screen, the same screen u can see when u execute transaction SM30.
3. Go to the desired tab and make the field as mandatory.
Once you click on respective field tab, You can see the Screen painter: attributes screen , in that go to Attributes tab, Select Program Tab and make input as required from the drop-down.
so the respected Key field become mandatory. You can do the same procedure for other key fields. So entry will be added to table when you provide all primary key values.
Thanks,
Mayuresh
2016 Jan 13 2:37 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |