SAP ABAP Dictionary Demystified: Practical Implementation of Data Elements and Domains for Table Creation
Data Dictionary is also called ABAP dictionary or DDIC.
-
Since, in our previous blogs we have already discussed the header and item table, now we will start with the practical implementation part.
-
We will create the following below table.
-
In the above table we have 5 columns, Order Number, Order Date, Payment Mode, Total Amount and Current. So, we will create domain and data element for these fields. Do not confuse with the Client Number, we will discuss it about later.
-
Now, the question arises in mind, what is data element and domain.
Domain :-
- Domain tells us about the technical characteristics of a field or column.
- Technical characteristics :- Data type , length.
Data Element :-
- Data element tells us how the column/field will be visible to the end user.
-
So, just think about how many data element and domain we need to create for the table.
- The answer is, we need to create 5 domains and 5 data elements.
-
Creation of Domains :-
-
Go to transaction code SE11 → select radio button domain and naming convention starts with z or y → click on create
-
First Domain for Order Number.
-
In SAP when you create any object you always have to give short description, so we will give short description as Order Number.
-
Provide data type as NUMC { numeric } and since length is 10 → No. characters = 10.
Note :-
→ In SAP, whenever you create any object you have to do 3 steps.
- Step 1 :- Ctrl + S for save to save and then assign the package.
- Step 2 :- Ctrl + F2 for syntax check
- Step 3 :- Ctrl + f3 and press enter to activate the object
- →Follow the above three steps.
-
Similarly, we will create domain for Order Date with description Order Date
→ ZAR_ORDER_DATE with data type DATS of length 8.
- Note :- DATS data type is a built in data type with format DDMMYYYY.
-
We will create third domain, Payment Mode with short description Payment Mode
→ZAR_PAYMENT_MODE with CHAR data type and length 1.
→Focus on the above mentioned table description, where we have mentioned Possible values for payment mode as
C = Credit Card, D = Debit Card, N = Net Banking
→ In value range of Payment mode we will assign these values.
-
Create the fourth column, total amount with short description Total amount with 2 decimal places.
-
Now, last domain Currency of data type CUKY{ it is a inbuilt data type of length 5 }.
Creation of Data Elements :-
-
Go to transaction code SE11 → select radio button Data type and naming convention starts with z or y → click on create → data element → press enter.
-
First data element for Order Number → provide the already created domain.
- Provide the field label, It will basically visible to the end user in place of column name.
- Again follow the three rules
- Ctrl + S
- Ctrl + F2
- Ctrl + F3 and press enter
-
Similarly create,
- ZAR_ORDER_DATE for Order Date
- ZAR_PAYMENT_MODE for Payment Mode
- ZAR_TOTAL_AMOUNT for Total Amount
- ZAR_CURENCY for Currency.
Creation Of Tables :-
-
Select first radio button database tables in SE11 transaction code → ZAR_HEADER → click on create.
→We will choose delivery class as A and select Display/Maintenance allowed in Data Browser. Don’t worry we will discuss about them later.
→ Click on Fields.
→ Give first field as MANDT and data element as MANDT.
- Here MANDT shows the client number.
- It shows that this table is a client dependent table
- Note :- You van double click on any domain to check more of its details.
→Write the rest field and data element as created before and mark MANDT and Order Number as primary key.
Note:- MANDT will always be marked as the primary key.
-
Click on technical settings,
for now provide data class as APPL0 and size category as 0 and click on save.
-
Since we have CURR as data type, therefore we need to provide a reference table and field for that data type.
- Click on Currency/Quantity fields
-
Now, follow the three steps
- Ctrl + S to save and assign the package
- Ctrl + F2 to check syntax
- Ctrl + f3 to activate the table.
-
Our table has been created, we will continue in next blog.
Comments
Post a Comment