Adding a key to a table
Keys are used to make sure that every record in the table is unique. They are often also referred to as indexes and are used to sort your data in ways that are most beneficial to the user. If you do not specify a key manually, the field you have placed in Field No.
with the value 1
will act as the primary key for your table.
How to do it...
Follow the steps from the Creating a table recipe to create a table.
Navigate to Design in Object Designer to open the Table Designer page for that table.
Navigate to Key in View (Alt + V + K).
On the empty line, add a new key for Document No., Posting date.
Our key should look like the window shown in the following screenshot:
How it works...
Keys allow you to sort data in a way that will increase your application's performance. There is a trade-off, though; increased application performance later, costs you some effort earlier.
When we insert data into a table, it is automatically sorted based on the primary key of that table, but what...