Beginners Guide To ABAP – Module 2 – Data Dictionary – Create A Table Part 2

This is a continuation of the previous video here: Create A SAP Table Part 1. Watch that video first.

Value Ranges

Next we will take a quick peep at the Value range tab. Now this tab is all about setting valid value ranges for the domain that you are creating. If you set a value range and the user enters a value in a field outside the valid value range that you set up, they will be shown an error message and be requested to enter a valid entry.

Create A Sap Table - Part 2There are three options to choose from when creating value ranges.

  1. The first is ‘Single Values – This is where you actually enter a list of individual valid values that a user can enter.
  2. The next is ‘Intervals’ – If you have many values but they are all related or in a sequence you can enter the lower limit and the upper limit for each range. For example, a lower limit of 1, an upper limit of 9, and that saves you entering 9 individual single values. This ensures a user can only enter a value that falls within the ranges that you specify.
  3. The last option you have is ‘Value table’ – When you have a large number of possible entries it is quite common to use a Value Table instead of a value range or list of single values. With a value table, you specify a complete valid value table entry list. But please note that if you use this option you must also introduce Foreign Keys to your table to ensure the user’s entries are tested against the values stored in the value table that you create.

We don’t need to enter any value ranges for this Domain. So just click the Save button.

Once again you will be presented with the Object Directory Entry pop-up box and we want to assign this object to the Local Object development class.

Activate Your Domain

The next step is to activate your Domain object. Even though we have saved it, it doesn’t mean we can use it within our table yet. We need to set the object to active. Which means our Data Element can use this Domain going forward. On the tool bar you’ll see a little match stick icon. If you hover over it, it will display the Activate tool-tip. Alternatively, press the Ctrl+F3 key.  Click the Activate button and you will be presented with a pop-up box which lists three different objects that are currently inactive. You can if you wish try and activate all the objects together by I strongly advice you DO NOT do this.

When you are working in a typical development environment you will have a number of other people creating developments objects all the time and it is quite often you will see their objects appearing in this list. Or maybe you’ve got a number of development projects on the go yourself and you could see inactive objects that you have created in another project that you don’t want to activate just yet.

So, only activate the Domain itself. This is the top entry, Object type DOMA. It should be highlighted by default. If not, highlight it and click the continue button. The system checks all of the entries we have made for the domain for errors. If everything is okay, it will then activate the object. The status bar at the bottom of the screen should indicate everything is okay and we can proceed with creating the rest of the table.

Step Back

Remember, we used forward navigation for generating our Domain. So, what you need to do is step back. Click the F3 key and you will be taken back to your Data Element Maintenance screen. Now, because you have created and activated the new ZEENUM Domain, you can now see the short text for the domain has been placed beside the ZEENUM entry. It has also brought back the individual domain properties that we created.

Next, you need to define the Field Labels for your field. Click on the Field Labels tab.  This is where you need to define the Short, Medium, Long and Heading field labels for our Data Element. Here is a little short-cut: We have already entered the Short text, so if you highlight just the ‘EMPLOYEE’ text and use your Ctrl+C key to copy the entry to the clipboard then you can click on each individual field label and just paste it the text one at a time into each Field Label. On the left hand side of the screen there is a Length field which not filled in on purpose. Once you filled in the each Field Label press the Enter key. The system will then automatically enter the length of each field label for you. Once this is complete, save the data element and then activate it.

When the Inactive Objects window appears you will likely only see 2 objects listed. Remember, we only want to activate the object we are working on right now. So highlight the entry with Object Type DTEL, which is the data element and then click the Continue button.

Check the Status Bar at the bottom of your screen which will show Object(s) Activated.

Step Back, Again

As we used forward navigation when creating the Data Element press the F3 key or press the Back button and you be taken back to the initial Table Maintenance screen. You will see the Employee field that you were creating and the Data Element entry that we keyed in has got the appropriate data type, Length, Decimals and Short Text displayed in our table grid indicating everything is working okay.

You have just gone through the sequence of creating a Data Element and Domain that we then used to create a Field. In the next video of this Learning ABAP we will repeat this procedure to create the remaining field for our table. Watch and read the next article and video here
Categories

About the Author:

Pete has been working with SAP technologies for over 10 years. He started out as an ABAP consultant and then moved on to BW where he has worked many different clients covering a wide variety of industries. "I love introducing SAP technology (especially BI) to new clients and showing them how they can go from zero to hero within their business in super fast time". Contact me on twitter @PeterMoxon