Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
2
Create from transaction SE11 ...................................................................................... 2
Enter Attributes ............................................................................................................ 2
Specify Columns .......................................................................................................... 3
Creating new data element .......................................................................................... 3
Creating Domain .......................................................................................................... 7
Data class in technical settings .................................................................................... 9
VIEWS ..................................................................................................................... 11
DATABASE VIEW ..................................................................................................... 11
PROJECTION VIEWS ............................................................................................... 13
MAINTENANCE VIEW .............................................................................................. 14
Structures .............................................................................................................. 15
Table Type ............................................................................................................ 20
Instructions ................................................................................................................ 22
Row type ....................................................................................................................... 23
Append Structure .............................................................................................. 25
Index ...................................................................................................................... 26
Indicator whether or not the index on the database is created as a unique index. .. 27
Create the index in the database (selection) .......................................................... 28
Data Element Supplement Documentation ...................................... 30
Text table ............................................................................................................... 33
Conversion Routine ( Domain) ................................................................. 35
CREATING LOCK OBJECTS ................................................................... 39
Flag if lock parameter wanted in the function module ............................................. 40
Maintaining Data Element Supplement Documentation .......... 43
for Data Elements............................................................................................. 43
Example Program For F1 Help ................................................................ 46
INSTRUCTIONS FOR CREATING A TABLE
1. Go to transaction : SE11 . Click on the : Database Table radiobutton and write the
name of the table U want to create . Remember , your table must start with Y or Z as
starting alphabet .
Enter Attributes
3 . Enter a brief description about the table in Short description field .The end user will
not see this description anywhere , but the developer will see it when bringing a list of
tables .
4. The value in the Delivery class identifies the owner of the data in the table . The
owner is responsible for maintaining the table contents . In customer tables , U can enter
A here .
5. Tickmark the table maintenance allowed checkbox as it will cause the menu path :
Utilities->Create Entries to be enabled , which will allow U to enter records into the table
.
Specify Columns
Write the name of the field . Click on the Key checkbox if U want to declare it as primary
Key . Select the data element in the Field Type field .In the first field , I have selected a
data elemnt from existing list .
Note !!!!!
The system will prevent you from further processing . It is b’coz I
attempted to create a data element whose name does not start with Y
or Z . So, remember , the name of the data element and domain
should start with Y or Z . So, start creating the data element
yempname and proceed till this position and press Yes .
Enter the description of the Data element and select the domain . If U want to create a
new domain , enter the name of the domain in the domain field and press Enter .
If the domain does not exist , a message will inform U about that .
Double click on the name of the new domain when a prompt will appear :
Creating Domain
Character fields are usually converted to upper case before they are stored in the
database . U can turn this conversion off by tick marking the Lowercase Letters Check
box .
After filling the fields properly , click on the Activate pushbutton on Application Toolbar
and save the domain as Local Object .
After activating , Press the Return Button (or Press F3) and return to the data element
screen .
After activating the data element , click on the Documentation pushbutton from
Application Toolbar , when the following pad will open before U . Remember , whatever
U write over here will be displayed when any user will press F1 help for fields having this
data element .
Do not disturb the &DEFINITION& . Make the pad clear and write what U feel to be
documented . After writing , activate the script .
Click Return to come to the data element screen . Click on the Field Label tabstrip
control and enter the labels for the field(headings for the data element) .
Then activate the data element and come out of the data element maintenance screen
by pressing F3 . You will land at tables field maintenance screen .
After completing all the column creation , save the table and Press the Technical
Settings Pushbutton from Application Toolbar .
The data class defines the physical area of the database (for ORACLE the TABLESPACE) in which your
table is logically stored. If you choose a data class correctly, your table will automatically be assigned to the
correct area when it is created on the database.
The most important data classes are (other than the system data):
Master data is data which is frequently read, but rarely updated. Transaction data is data which is frequently
updated. Organizational und customizing data is data which is defined when the system is initialized and
then rarely changed.
There are two more data classes available, USR and USR1. These are reserved for user developments.
The tables assigned to these data classes are stored in a tablespace for user developments.
You can select the categories 0 to 4 for your table. Each category is assigned a specific fixed storage area
value in the database. When you create a table, initial space is saved for it in the database. If more space is
required later as a result of data that has been entered, the storage space is increased in accordance with
the category selected.
Press F4 on the field Size category to see the number of data records that can be maintained for the
individual categories of your table without complications ensuing. These complications could be for example
a reorganization becoming necessary because the maximum space to be reserved for the table was
exceeded due to the maintained size category.
Save the Technical Settings and come out by pressing Return key(or press F3) .
Check the tasks U have done by pressing the Check key(Ctrl-F2) at the application
toolbar . If no inconsistencies are found , then press the Activate (Ctrl-F3) button at
application toolbar .
DATABASE VIEW
1. Go to SE11 , choose View Radiobutton , enter the name of the view U want to
create and press the Create button .
3. Enter a short description for the view , mention the name of the tables on which
the view will be placed and mention the join conditions .
4.
Click on the View flds tabpage and mention the columns and their source tables which U
want to include in the view .
5.
Select the Selection Conditions Tab page and fill in the selection criteria .
6. Save the view , Check it , make proper corrections and then activate it .
(Data can only be read from database view)
PROJECTION VIEWS
1. Go to SE11 , click on the View Radiobutton , enter the name of the view to be
created and press Create key . Choose Projection View Radiobutton from the list
appearing and press Copy key .
2.
Enter the short text for description , then enter the name of the table on which U want to
create the projection view and mention the columns which U want to place in the view .
3. Save the view , check , make proper corrections , and further save , check and
ultimately activate the view .
[ For database view/projection view , it is advisable to include the mandt column into
the view for client dependent tables . Also base columns and reference columns
should also be included into the view , otherwise system will issue warning message
at the time of saving ]
MAINTENANCE VIEW
1. The first step is similar to the above one . Create as usual by choosing
Maintenance View Radio Button from the screen appearing after pressing the
Create button .
Structures
Go to SE11 .
Enter the structure name in the data type field and click on the Data type
radiobutton . Then press Create pushbutton .
A dialog box appears in which you must select the type category.
Enter the name of the type whose attributes should be used in the
component in field Component name. You can enter any type (data
element, structure or table type) here.
You can also add components by directly specifying the data type and
length. Choose Built-in type. You can now enter values for fields DTyp,
Length, Dec .places and Short description. With Component type you can
switch back to the screen for entering references to existing types.You can
combine components with direct type definition and components that are
defined by referencing an existing type as you like.
The reference field and reference table must be specified for components
of type CURR (currency) and QUAN (quantity).
Double click on any currency/quantity field . You will get a screen for
mentioning the reference table and field .
Save your entries once you have defined all the components of the
structure.
You are asked to assign the structure a development class. You can
change the development class later with Goto Change object directory
entry.
1. In the initial screen of the ABAP Dictionary, enter the table type name in field Data type
and choose Create.
A dialog box appears in which you must define the type category.
You can for example find the table type at a later time using this short text.
Now define the structure of a row of the table type (row type), the options for accessing
data in the defined internal table (access mode) and the key of the table type.
4. Enter the row type of the table type on the Row type and Access tab page. You can refer
to an existing type (data element, structure, table, view, table type) or directly enter the
row type.
If you want to refer to an existing type, you must set the Row type flag and enter the
name of the type in the field below it.
If you want to enter the data type, field length and possibly the number of decimal places
directly, you must set the Built-in type flag. Entries are now possible in the fields Data
type, Number of places and Decimal places.
This defines how to access the data in an internal table defined by the table type in ABAP
programs.
6. Define the key of the table type on the Key tab page.
The key of a table type is defined by the key definition and the key category.
If you select Key components, you can define the key of the table type directly in the
input area with the same name. This option is only possible if the row type of the table
type is a structure, table or view.
You can display all the components of the row type with Select components. Select the
You are asked to assign the table type a development class. You can change this
development class later with Goto Object directory entry.
8. Choose .
Result
The table type is now activated. The runtime object of the type is created. At activation, a log is
written; it can be displayed with Utilities Activation log. If errors occurred during activation, the
activation log is automatically displayed.
Other Options
You can enter an explanatory text for the table type with Goto Documentation. This is
purely technical documentation that is not displayed in the online help system.
You can display the runtime object of the table type with Utilities Runtime object
Display. With Utilities Runtime object Check you can check if the runtime object of
the table type is consistent with its definition in the maintenance screen of the ABAP
Dictionary.
Instructions
1. Go to SE11 . Click on Data type Radiobutton and enter the name of the object U
want to create .Click on Create pushbutton .
Data Element
Structure
Table type
Direct type entry, where the data type, number of places and possibly the decimal
places are directly specified.
Specifying an existing type (data element, structure, table type,table, view) whose
attributes are used as the attributes of the defined table row.
You can define the name of a type in the input field for the row type flag of the
maintenance screen. If the row type is a reference type, this input field may contain the
name of a class or an interface or DATA.
U can also specify the key type in tab page : Key .
Append Structure
Go to transaction SE11 and enter into a table in Display/Change mode .
Dummy Project : Let us assume that we want to create an index on yemployee based on
werks(plant code , assumed to be the brcode of the employee) . U san build indexes on
SAP standard tables also .
1. Go to SE11 . Write the name of the table and enter in Change/Display mode .
2. Now Press the Indexes pushbutton or choose from the menupath : Goto-
>Indexes … .
(Brief Documentation on Index Id: The three-place index ID uniquely identifies an index within a
table.
The index ID may only contain letters and digits. The ID '0 ' is reserved for the primary index. The name
ranges 'Y..' and 'Z..' are reserved for customer indexes.
Enter an index id , say Y01 and click on the tick marked button .
Enter a short description for the index . Click the radiobuttons for Unique/Non
Unique Index .
It is of no importance for the accessing speed whether or not an index is defined as a unique index.
Note: A UNIQUE index for a client-specific table must contain the client field.
Index in all database systems: The index is always created in the database.
In selected database systems: The index is created depending on the database system used. In
this option, you must specify the databases in which the indexes are to be created. You can do this
either on an inclusive (list of systems on which it should be created) or an exclusinve (list of
systems on which it should not be created) basis. In either case, you can list up to four different
database systems.
No database index:: The index is not created in the database. If you set this option for an index that
already exists in the database, it is deleted when you activate the table in the ABAP Dictionary.
Note: Unique indexes have an extra function, and must therefore always be created in the database. The
database system prevents entries or index fields being duplicated. Since programs may rely on this
database function, you cannot delete unique indexes from the database.
Enter the name of the fields in the table field below on which U wat to develop
the index .
3. Press the Save key , then check the index and at last , activate it .
Your index is created . The next time when you want to create/modify indexes by
pressing the Indexes pushbutton or from menu path , U will see the list of existing
indexes :-
From here , U can delete one index , create one or edit one .
Data Element Supplement Documentation
1. Go to any field for the data element . Press F1 key and then press F7 key .
The following format comes b4 U . Enter the documentation and save and activate it .
Then come out . The next time you press F1 for that field in that transaction , you will get
your documentation . If U do not get it , press F7 key and enter proper Data Element
supplement no and press Enter . Then come out and press F1 again .
The Data element Supplements are recorded in THLPF table .
Text table
Example : Let us assume that table ysecretcode contains column scode and amount . Table
ysecretcode_text contains columns : scode , spras(language key) and name(description for
scode) . Now, w.r.t. scode column of table ysecretcode_text , table ysecretcode is used as a
check table as follows:-
Now , when a field will be constructed in some program referring scode column of table
ysecretcode_text , the entries in table : ysecretcode along with the descriptions from
table ysecretcode_text will be shown .
F4 help for the parameter in the selection-screen will show entries in table : ysecretcode
with corresponding descriptions from table ysecretcode_text:-
Depending on the data type of the field, there is a conversion when the contents
of a screen field are converted from display format to SAP-internal format and
vice versa. If this standard conversion is not suitable, it can be overridden by
defining a conversion routine in the underlying domain.
CONVERSION_EXIT_xxxxx_INPUT
CONVERSION_EXIT_xxxxx_OUTPUT
The INPUT module converts from display format to internal format, and the
OUTPUT module converts from internal format to display format.
Let us assume a fictitious demand where user will enter some name of students
and a ‘Mr.’ Will be prefixed before the name .
In the database also, it is saved with the prefix ‘Mr.’ . In the database also, it is saved in
the same format .
CREATING LOCK OBJECTS
Go to SE11 . Write the name of the lock object, click on the lock object radio button and
press Create button .
2.Write a short description .In the Tables tabstrip control , write the name of the primary
table , set the lock mode for it . In the bottom portion of the screen , click on the Add
pushbutton and select the secondary table(linked to the primary table by a foreign key)
and choose the lock mode for it .
3. Go to the Lock Parameter tabstrip control .The key columns for the primary and
secondary tables will automatically appear over there .
These parameters are used to copy the key to be locked or to control the lock behavior when the initial value
is passed.
The flag is set by default. If you do not need the lock parameter in the generated function modules, you can
cancel the flag. In this case this parameter is always locked generically.
Now, I will write a program which will take wastage code as input and display the details
of the code . It will make use of ENQUEUE and DEQUEUE function to lock the details of
the wastage code for further use by other users .As U give the wastage code and
execute the report , a message will appear , asking U to execute the same report in
another session . Now, if U execute the report in another session using the same
wastage code, U will face a lock .
REPORT YSUBLCKWST .
tables : ysale_tbl .
skip 2 .
loop at intsale .
write:/15 intsale-memo_no ,
27 intsale-gpass_no ,
40 intsale-werks , 48 intsale-lgort ,
58 intsale-qty , 70 intsale-value .
endloop .
message i398(00) with 'Now open another session and run the same report'
' to get the effect of lock object' '. If same code is used,U will face
a lock' .
2. Go to any field for the data element . Press F1 key and then press F7 key .
The following format comes b4 U . Enter the documentation and save and activate it .
Then come out . The next time you press F1 for that field in that transaction , you will get
your documentation . If U do not get it , press F7 key and enter proper Data Element
supplement no and press Enter . Then come out and press F1 again .
The Data element Supplements are recorded in THLPF table .
Example Program For F1 Help
REPORT demo_dynpro_f1_help .
TABLES demof1help.
text = text-001.
PROCESS ON HELP-REQUEST.
FIELD DEMOF1HELP-FIELD2 MODULE F1_HELP_FIELD2 WITH VAR.
FIELD FIELD3 MODULE F1_HELP_FIELD3.
FIELD FIELD4 MODULE F1_HELP_FIELD4.
A sample code makes use of the above function module is given below:
Here, this technique is being used to populate a parameter (p_scrt1) representing the field, which
would provide the sort criteria for a report.
We need to write the ‘perform’ under the following event in the report.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_scrt1.
* Type for internal table to store possible values for selection field
TYPES : BEGIN OF ty_value,
value(30) TYPE c,
END OF ty_value.
CLEAR i_value.
i_value-value = ‘Shipping point’.
APPEND i_value.
CLEAR i_value.
i_value-value = ‘Route’.
APPEND i_value.
CLEAR i_value.
i_value-value = ‘Customer’.
APPEND i_value.
CLEAR i_value.
i_value-value = ‘Carrier’.
APPEND i_value.
IF sy-subrc = 0.
IF l_index > 0.
* This check is required as user may choose the ‘Cancel’ icon, in which case,
* value of l_index will be 0.
CLEAR i_value.
I_VALUE-VALUE1 = '00011234567'.
I_VALUE-VALUE2 = '2343242342'.
APPEND i_value.
CLEAR i_value.
I_VALUE-VALUE1 = '00011234568'.
I_VALUE-VALUE2 = '2343242343'.
APPEND i_value.