The last final field that we're going to create is 'Date of Birth'.
Create data element 'ZDOB'.
Use forward navigation to create it, saving the table along the way and choosing 'Yes'
to create the data element.
Enter 'Date of Birth Data Element' for the short text.
For the Domain, once again enter ZDOB and use forward navigation to create the domain.
Choose Yes to save the data element.
Assign it to the local object.
Choose Yes to create the domain.
Enter Date of Birth in the short text field.
Now, for the Data type, date of birth is a date field so we want to choose the appropriate
date field from the dropdown box.
Press the F4 key to bring up the dropdown box and choose the entry that says DATS.
Now press the enter key and you can see an information box has popped up just to tell
us the attributes of the DATS field have been assigned to this domain.
Click the Continue box and it will fill in the number of characters for us and the Output
length.
Now the Output length is different from the number of characters because it will actually
insert the back slash to separate the days, months and years of this field.
Activate the object.
Assign it to the local object development class.
Ensure your domain is selected in the inactive objects window and choose Continue.
Then check the status bar to ensure everything is activated and saved successfully.
Press the F3 key to step back.
On your data elements field go to Field label and enter Date of Birth in every field.
The whole text Date of Birth will not fit in the Short description so replace it with
DOB.
Press enter to automatically fill in the field label length then activate your data element.
Once the object has been activated and saved successfully press the F3 key to step back
and there you can see all your fields have been entered into your table.
If all the short texts, and individual data element, and domain properties have come through
onto your screen that indicates everything is working just fine.
Now, the next thing we want to do is just click the Save button so we can just save
our progress.
Then we're going to move on to maintain the technical settings for our table.
Now SAP needs to know a little bit more information about the table that we are creating before
it can create the back end database tables itself.
So you can either now click on the Technical settings button on the tool bar or go to the
Go to menu and choose the Technical settings option, just Ctrl+Shift+F9.
We now need to tell our system what development class we want to use.
So if you click the dropdown button, you'll see that there are five options to choose
from.
And if you just read the descriptions you'll get a flavor of what this is all about.
We want to choose the first entry which is APPL0, which identifies this table is holding
master data and a transparent table.
Double click that entry.
For the Size category field click the dropdown again.
In this table we are just estimating to the system itself how many records we are going
to be holding in it and it will use these values to make an educated guess of how it
should actually create the tables in the underlying database.
We are not going to be holding a lot of data in our table so just choose the first option
which is Size category 0.
Once selected, now we'll move down to the buffering options and we want to ensure that
Buffering not allowed is selected.
And what this means is basically do not load the table content into memory for reading
and this prevents the table from being read in advance over selecting the records in our
programs.
You may be thinking it will be more advantageous to hold the data in memory for speed efficiency
and you will be quite correct.
But in our example we don't actually need them.
If speed was an issue for the development that you are working on, you would most definitely
want to be using Buffering switched on which would ensure the data is read into memory.
So if you have large tables that are being read very often but only being updated infrequently,
choose Buffering not allowed option.
That's all we need to fill out so click the Save button and then press the Back key.
Now, if all goes well we can activate our table and move on to entering records.
Click the little match stick icon to activate your table and check the status bar at the
bottom to ensure everything works successfully.
This concludes the lesson on creating database tables.
And in the next article we are going to look at how we can enter records directly into
our table.