Академический Документы
Профессиональный Документы
Культура Документы
The SAP Web Application Server provides varied options for all aspects of application
development. Different techniques, such as JDBC, are provided also for the database connection
for applications.
Central storage for neutral platform definition of data types and database objects is very helpful if
you are programming extensive SAP applications. SAP provides this storage area in the form of
the Java Dictionary.
Data type descriptions for Web applications can be described centrally, redundancy-free, and
independently of the program code.
In standard J2EE programming, there are three layers: presentation layer, business layer, and
database layer. Cross-layer, reusable storage of data descriptions is possible.
In the Java Dictionary, you can store metadata and services for database objects and user
interfaces (Web Dynpro).
The Java Dictionary provides additional data compared to the database catalog of the respective
database system being used. Data type definitions for fields, for example, can be given an input
help or a field label.
Elementary data types are used in the new SAP programming model for user interfaces, Web Dynpro.
Information from the Java Dictionary can be used in many ways:
If a type from the Dictionary is assigned to an input field, the Web Dynpro runtime automatically
checks whether the values entered match the type.
If there is a fixed set of values for a type, this value set is proposed to the user in a dropdown list.
The label text for an input field or the heading of a table column can be derived, on the basis of
the respective language, from the Dictionary information on the field (or column). This is done
through the generation of suitable properties files.
Check the types into the Design Time Repository server (DTR) of NWDI.
Subsequently, Web Dynpro skilled developers can check them out and reuse consistently within Web
Dynpro DCs.
This way Dictionary DCs can act as a type repository of the database layer and presentation layer of
your, possibly complex, Java application, as you can view in the picture below. If you change a
Dictionary type, all the objects that use it are established upon generation. The objects that are found
are automatically adjusted to include the change.
Prerequisites
STEPS
Create Development Component (DC) of type Dictionary
Open Java Dictionary Perspective
Open NWDS 04. Go to Windows->Open Perspective->Other
Select Dictionary. Click on OK.
Click on Finish.
Navigate to the Definition tab of Simple type.
Keep type as String and Maximum length as 10.
Create another simple type NAME of type String and Maximum Length 30.
Right click on the Structures node of Data Types.
Create New Structure Employee.
Create 2 elements in Employee structure: EMPID and NAME of respective simple types EMPID and
NAME.
Click on Finish.
Define two table columns EMPID and NAME of respective simple types EMPID and NAME.
In the next screen, select Dictionary Simple Type. Check checkboxes for com/sap/mypackage/EMPID
and com/sap/mypackage/NAME.
Then select Dictionary Structure. Check com/sap/mypackage/Employee. Select Dictionary Database
Table. Check /TMP_EMPLOYEE.
Click on Finish
Build , Create .sda and deploy Dictionary DC on J2EE server
Right Click on Dictionary DC ->Development Component->Build
Create Archive (.sda= software development archive)
new
Web
Dynpro
component
Navigate to My Components->dictionary->pp_dictionary.
Reuse of Dictionary types requires that you select the following dependency types:
Build Time (affected Web Dynpro objects need the Dictionary type for compilation)
Run Time (at runtime, the Web Dynpro application dynamically links to the Dictionary data
type deployed to the target server)
Click on Next
Check
checkboxes
for
dictionary
DC
and
dictionary_wd
DC.
Click
on
OK.
Create
Record,
be added
to