KEMBAR78
Introduction To Eclipse | PDF | Eclipse (Software) | Window (Computing)
0% found this document useful (0 votes)
64 views26 pages

Introduction To Eclipse

Uploaded by

Jamila Hamdi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views26 pages

Introduction To Eclipse

Uploaded by

Jamila Hamdi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Introduction to Eclipse

Table of Contents

Table of Contents 2

Overview 3

Understanding How SAP Uses Eclipse 4


Background to Eclipse 4
Benefits of Eclipse 5

Defining an ABAP Project 7


The Log On Process 7
Log On To The SAP System 8
The Online Development Model 9
Multiple Projects in a Single Workspace 10
Eclipse Preferences 11
Project Properties 12
Packages and Favorites 13
Add a Package to Favorites 14

Organizing Work with the Eclipse Workbench 15


The Eclipse Workbench 15
Perspectives 16
Open a New Perspective and Customize the ABAP Perspective 18
Editors 20
To Arrange Objects for Editing 21
Views 21
To Arrange Views 22
To Use Quick Views 23
To Pin a View 23
Quick Access 23
To Use Quick Access 24
Learning Assessment 25

2
Overview
In this section, you will learn about:

● Understand the Role of Eclipse-Based Tools at SAP

● Log On To The SAP System

● Explain the online development model

● Explain how multiple projects can exist in a single workspace

● Modify Eclipse preferences and project-specific settings

● Add a favorite package to an ABAP project

● Describe the Eclipse Workbench

● Organize editors and views into perspectives

● Arrange objects for editing

● Navigate information and resources using views

● Access interface elements using Quick Access

3
Understanding How SAP Uses Eclipse

Background to Eclipse
The open Eclipse platform offers first-class user experience, powerful platform capabilities,
and a broad and vivid ecosystem that regularly contributes enhancements and extensions.

Figure 1: SAP and Eclipse

SAP plays an active role in the Eclipse Foundation as one of its strategic members. Many of its
design-time, development, and administration tools already make use of the Eclipse
platform. These include SAP NetWeaver Visual Composer, SAP NetWeaver Developer Studio
for Java development, SAP Mobile Platform, and SAP HANA Studio. The latest addition to the
family is ABAP Development Tools for SAP NetWeaver (also known as ABAP in Eclipse, or
ADT).

ABAP Development Tools has been designed to significantly increase developers’ productivity
by leveraging the proven usability, speed and flexibility of the Eclipse platform. ADT
combines SAP's powerful ABAP application server capabilities such as convenient lifecycle
management, server-based development, full integration, effective testing, and
troubleshooting tools with the powerful Eclipse UI. It also provides a modern - and for many,
familiar - Eclipse UI client on top of the ABAP platform.

4
Figure 2: Architecture of ABAP Development Tools in Eclipse

ABAP Development Tools provides the following benefits:

● A brand new ABAP development experience on top of the Eclipse platform.

● An open platform for developing new ABAP-related tools.

● A set of open, language- and platform-independent APIs that developers can use to build
new custom tools for the ABAP environment.

Benefits of Eclipse
With ABAP Development Tools in Eclipse you can capitalize on the usability, speed, and
flexibility of Eclipse while also benefiting from proven ABAP Workbench features. It’s the best
of both worlds.

ADT improves developer productivity by offering better refactoring functionality, code


completion, auto-insertion, and code templates. It also includes an invaluable Quick Fix
feature and is highly navigable.

5
Figure 3: Benefits of ABAP Development Tools

ADT allows you to connect to multiple ABAP systems and provides session failover, reducing
the impact of lost connections. It also enables cross-platform development by integrating
ABAP and non-ABAP development tools, such as SAP HANA Studio and the UI development
toolkit for HTML5, in a single powerful IDE.

Figure 4: Eclipse-Based ABAP Development

ABAP Development Tools accesses objects in the SAP Repository in exactly the same way as
the existing ABAP Workbench tools.

6
Defining an ABAP Project

In this section, you will learn how projects are defined and adjusted in ABAP Development
Tools in Eclipse.

After completing this section, you will be able to:

● Log On To The SAP System

● Explain the online development model

● Explain how multiple projects can exist in a single workspace

● Modify Eclipse preferences and project-specific settings

● Add a favorite package to an ABAP project

The Log On Process


ABAP Development Tools uses the same online development model for ABAP development
as the ABAP Workbench. This means that when you open Eclipse, you must first log onto an
SAP system before you can display or edit any objects. Each logon session (identified by
system, client, and user) is represented in ABAP Development Tools by an ABAP Project.

7
Figure 6: Logging On

To create a new project, choose New → ABAP Project. Use the Browse function to find the
system to which you want to log on and choose Next. Then enter the client, user, logon
language, and password, and choose Finish. You have now logged onto the system and the
ABAP project will be permanently available in your workspace.

Log On To The SAP System

1. Launch ABAP Development Tools.

a) Start Eclipse on your desktop by choosing Start → All Programs → ABAP


Development Tools → ABAP Development Tools Eclipse launches and displays the
ABAP perspective. However, the Project Explorer view is empty.

2. Create a new ABAP project. Your instructor will tell you the connection, client, user name,
and initial password that you should use.

a) Choose New → ABAP Project. Now you need to choose an SAP system to connect to.

b) Choose Browse and select the ZME system.

c) Choose OK and, on the System Connection screen, choose Next.

d) In the Client field, enter the number provided by your instructor.

e) In the User field, enter BC404-##, where ## is a two-digit number assigned by your
instructor.

f) In the Password field, enter the password provided by your instructor.

g) Choose Next.

h) When prompted, change your password to something of your own choosing.

8
The Online Development Model
Some developers may be used to working in a decentralized development environment. For
example, Java developers who work with the SAP NetWeaver Developer Studio each have a
local runtime environment as well as development environment on their computer. This
means that they can develop and test applications locally, independently of their colleagues.
All of the individual developers’ applications are combined in a central system at some later
point.

Development in ABAP Development Tools works differently. Developers using ADT remain
logged on to the SAP system while they are working on various repository objects. In other
words, development is still server-based; objects are stored solely on the back-end. Besides a
small read-only cache to increase performance and to reduce the server load, no objects are
stored on the client side.

Figure 7: The online development model

This means that if you edit an ABAP repository object in Eclipse, an enqueue lock is set for
this object at the client and the most recent version is retrieved from the back-end. If you
save or activate the object, all your changes are stored directly in the ABAP back-end as well.
There are no complex check-out-/check-in mechanisms, and no need to create local copies of
objects. Other services, such as syntax checks, searches and where-used functionality are all
run on the back-end. Because all repository objects are retrieved from the back-end, and
there is no client-side ABAP runtime, there is no support for working offline.

9
Before you begin development in ADT, you must create an ABAP project. An ABAP project
always represents one system connection. It acts as an intermediary between an ABAP
backend system and the front-end Eclipse-based IDE client, and it provides a framework for
creating, processing, and testing development objects. An ABAP project always represents a
real system logon and additionally offers a user-specific view of all ABAP development
objects of the back-end system.

The specification for an ABAP project contains the following items:

● Project name

● System data, including specifications for the system ID, the client, user, and password

● Default language, that is, the original language of the development objects as well as the
language of the messages and UI texts

● List of the ABAP packages that are displayed as favorites in the project (optional)

Remember that ABAP projects can only be processed if there is an existing system
connection to the ABAP back-end. It is therefore not possible to have read or write access to
the content of an ABAP project in offline mode.

Multiple Projects in a Single Workspace


As with all other project types in Eclipse, ABAP projects, too, form part of a user-specific
workspace and thus define the starting point for all development activities within the new
IDE. Several ABAP projects can exist in one workspace.

10
Figure 8: Multiple Projects

This means, in particular, that the ABAP developer can work on multiple ABAP systems in
one and the same IDE session, without leaving the immediate work environment. This can be
very useful whenever, for example, the status of development objects from the original
development system is to be compared with the status in the consolidation or production
system.

Each subsystem in the Eclipse platform is itself structured as a set of plug-ins that implement
some key function. Some plug-ins add visible features to the platform using the extension
model. Others supply class libraries that can be used to implement system extensions.

Figure 9: ADT Architecture

In the case of ABAP Development Tools, one Eclipse client is installed on the developer PC
and can connect to several back-end systems from different releases. The connection is set
up using a RFC/REST-based protocol. The client provides a set of standard development tools
such as the Project Explorer view for system browsing and a variety of editors, one for each
development object.

The development paradigm is server-based. This means that development objects are stored
solely on the back-end and that services such as syntax-check and search are also run there.

Eclipse Preferences
Eclipse Preferences allow you to make general settings about how you want Eclipse to
operate. You can access Preferences by choosing Window → Preferences. The following
graphic shows the Source Code Editors section of the Eclipse Preferences window.

11
Figure 10: Eclipse Preferences — Source Code Editors

If ABAP Development Tools is installed, there is a specific section for settings related to ABAP
Development. Settings that can be controlled here include the following:

● Whether the system ID is displayed in the Editor tab page, and if so, where

● Settings relating to Debugging, for example, whether system programs should be


debugged

● Settings specific to source code, for example, whether brackets should be automatically
closed, and whether the automatic syntax check should be performed

● Settings related to editors, for example, font size and color options

There is a Restore Defaults button in case you wish to discard the settings you have made.

Project Properties
You can adjust the properties of a specific ABAP project, just as you can adjust preferences
for Eclipse in general. To do so, choose ‘Properties’ from the project’s context menu.

12
One particularly useful collection of settings is found under ABAP Development→ Editors →
Source Code Editors→ Formatter, as shown in the following graphic.

Figure 11: Project Properties Window

The options displayed here correspond roughly to the settings which can be made using the
Pretty Printer in the ABAP Workbench. You can control the code style of the formatter,
including whether source code should be indented (for example, when programming an IF or
CASE construct), and whether keywords and identifiers should be in uppercase or lowercase.
After having made and applied these settings in the project properties, the formatting can be
applied by choosing SHIFT + F1 to format the code in the source code editor.

To Adjust Eclipse Preferences and ABAP Project Properties

1. To adjust Eclipse preferences, choose Window → Preferences.

2. To adjust an ABAP project's properties, select its name in the Project Explorerview and
choose Alt + Enter. Alternatively, you can choose the project's context menu and choose
Properties.

Packages and Favorites

13
When you work with the Object Navigator in the SAP GUI, you are able to display any
package, program, class, or function group in the navigation area by selecting the relevant
object type and entering the name of the object you want to work with. This is not possible in
ABAP Development Tools. (However, later on, you will learn how you can open any
development object using a special search dialog.)

Figure 12: Favorite Packages

However, there may be particular packages with which you want to work on a regular basis.
You can display these packages and their contents in the navigation area of the Eclipse
workspace by adding them as favorites. To add a favorite, expand the project node and from
the context menu of the Favorite Packages

node, choose Add a Package. Then use the search dialog to locate the package or packages
to which you need regular access.

Add a Package to Favorites

Business Example

You are a programmer for an SAP customer and work with the new ABAP Development
Tools. You want to add an ABAP package to your Favorites list in a new project.

1. Add the ABAP package BC404 to your Favorites list.

a) On the Project Name and Favorite Packages screen, choose Add.

14
b) In the ABAP Package Selectiondialog box, enter BC404 in the Select an object field.

c) Choose OK.

d) Choose Finish. The BC404 ABAP package appears in the Project Explorer alongside
another package called $TMP-Username. The latter is always generated when a new
project is created.

Organizing Work with the Eclipse Workbench

After completing this section, you will be able to:

● Describe the Eclipse Workbench

● Organize editors and views into perspectives

● Arrange objects for editing

● Navigate information and resources using views

● Access interface elements using Quick Access

The Eclipse Workbench


The term Workbench refers to the desktop development environment in Eclipse. It is used to
edit objects, manage views, and arrange the developer's work area.

15
Figure 13: The Eclipse Workbench

Each Workbench window contains one or more perspectives. Perspectives contain views and
editors. More than one Workbench window can exist on the desktop at any given time. For
example you may open ABAP Development Tools but also SAP HANA Studio at the same
time.

Perspectives
A perspective is a window within the Eclipse Workbench. Each one is made up of an editor
area and a number of panes called views. A perspective provides the functionality necessary
for accomplishing a specific set of tasks or for working with specific types of resources. As
you work in the Workbench, you may find that you need to switch perspectives frequently.

16
Figure 14: A Perspective

Perspectives determine the initial set and layout of views in the Workbench window and
determine which options appear in some menus and toolbars. They define visible action sets,
which you can change to suit your own requirements. When you customize a perspective in
this way, you can save it for later use.

ABAP Development Tools provides several perspectives for the Eclipse workbench: the ABAP
perspective, the ABAP Profiling perspective, and the Debug perspective. The most important
of these is the ABAP perspective.

The ABAP perspective, like any other, provides an initial set of views and editors, and
determines their layout. Specifically, the ABAP views and editors allow you to work with ABAP
development objects that are managed by an ABAP backend system. When using the ABAP
perspective, you always have to establish a system connection which is represented by a
corresponding ABAP project. The ABAP perspective enables access to both Eclipse-based and
SAP GUI-based ABAP tools.

The ABAP perspective consists of an editor area containing various ABAP source code
editors, and the following views:

● Project Explorer

● Outline

● Task Repositories

● Task List

● Problems

● Templates

● Properties

● Feed Reader

● Transport Organizer

17
Open a New Perspective and Customize the ABAP
Perspective
Business Example

You are a programmer for an SAP customer and work with the new ABAP Development
Tools. Your current task is to customize the ABAP perspective by adding ABAP Function
Module to the New menu, and then to save the perspective as BC404_##, where ## is the
group number assigned to you by your instructor. You also want to remove - and then
reinstate - the Help menu and the Launch toolbar from your new perspective.

1. Open the Debug perspective.

2. Customize the ABAP perspective by adding Function Moduleto the New menu.

3. Save the ABAP perspective as a new perspective, BC404_##, where ## is your group
number.

4. Further customize your new perspective by removing the Help menu and the Launch
toolbar.

5. Reset the perspective BC404_## so that the Help menu and Launch toolbar are reinstated
in one step.

Solution

1. Open the Debug perspective.

a) Choose Window → Open Perspective→ Debug. The Debug perspective opens alongside
the ABAP perspective. You can switch between them using the icons in the perspective bar.

2. Customize the ABAP perspective by adding Function Moduleto the New menu.

a) Switch to the ABAP perspective by choosing ABAP in the perspective bar.

b) Choose Window → Customize Perspective...

c) Choose the Menu Visibility tab.

18
d) Expand the File node.

e) Expand the New node.

f) Select ABAP Function Module.

g) Choose OK. ABAP Function Modulehas been added to the New menu in the ABAP
perspective.

3. Save the ABAP perspective as a new perspective, BC404_##, where ## is your group
number.

a) Choose Window → Save Perspective As...

b) In the Save Perspective As dialog box, enter BC404_## as the name.

c) Choose OK.

4. Further customize your new perspective by removing the Help menu and the Launch
toolbar.

a) Ensure that you are currently in the perspective BC404_##.

b) Choose Window → Customize Perspective…

c) Choose the Menu Visibility tab.

d) Deselect Help.

e) Choose the Tool Bar Visbility tab.

f) Deselect Launch.

g) To close the dialog box and verify that the changes which have been made to your
perspective, choose OK.

5. Reset the perspective BC404_## so that the Help menu and Launch toolbar are reinstated
in one step.

a) Choose Window → Reset Perspective ....

19
b) When prompted, confirm that you wish to reset the perspective. The Help menu and
Launch toolbar are reinstated.

Editors
Most perspectives in the Workbench comprise an editor area and one or more views.

There are different editors for different ABAP development objects. The appropriate editor
opens automatically when you open the object. If there is no associated native editor for an
ABAP development object, the Workbench attempts to launch an external editor. For
example, the Eclipse Workbench has no editor for ABAP Dictionary objects such as structures
and tables. If you double-click an ABAP Dictionary object, the SAP GUI will be launched.

Figure 15: The ABAP Class Editor

You can have any number of editors open at the same time, but only one can be active. The
main menu bar and toolbar for the Workbench window always show operations that are
applicable to the active editor. Each open editor has a tab in the editor area. When an editor
has unsaved changes, its tab shows an asterisk (*).

By default, editors are stacked in the editor area, but you can choose to tile them in order to
view multiple source files simultaneously.

If there is a syntax error or problem with the source code, it is flagged with an appropriate
icon in the border of the left margin of the editor. Icons are also displayed there when you
create bookmarks, add breakpoints for debugging, or add a task. To see details about any of
the icons in the margin, simply move the mouse cursor over them.

20
To Arrange Objects for Editing

1. To tile editors horizontally, drag an editor tab down to the bottom of the editor area and
release it when a horizontal green box appears.

2. To tile editors vertically, drag an editor tab to the side of the editor area and release it
when a vertical green box appears.

3. To move an editor within the editor area, drag its tab to the desired location and release.
Note that editors cannot be moved into the view area.

4. To minimize the editor area, choose the Minimize button in the editor area's toolbar. Note
that the entire editor area is minimized to a trim stack. You cannot minimize individual
editors or views.

5. To restore a minimized editor area, choose the Restore button in its trim stack.

6. To maximize the editor area, choose the Maximize button in the editor area's toolbar.

Views
Views support editors and provide ways to navigate the information in your Workbench. For
example, the Project Explorer view allows you to see the project hierarchy and access specific
development objects.

Generally speaking, when you open a perspective, task-dependent views are automatically
opened too. You can open additional views at any time, of course.

Views also have their own menus. To open the menu for a view, click the triangular icon in
the view's title bar. Some views also have their own toolbars. The actions represented by
buttons on view toolbars only affect the items within that view.

A view can appear by itself, or stacked with other views in a tabbed notebook. You can
change the layout of a perspective by opening and closing views and by docking them in
different positions in the Workbench window.

21
To Arrange Views

1. To move a view, drag its tab to the desired location and release it when a green box or line
appears. Note that views cannot be moved into the editor area.

2. To move a group of tabbed views, drag the group's toolbar to the desired location and
release it when the green box or line appears.

3. To minimize a view or a group of tabbed views, choose the Minimize button in its toolbar.
The view or tabbed group of views is minimized to the window's trim stack.

4. To restore a view or group of tabbed views, choose the Restore button in its trim stack.

5. To maximize a view or group of tabbed views, choose the Maximize button in its toolbar.

6. To create a new view window, drag a view or tabbed group of views outside the
perspective. Note that this new window behaves as a separate entity - views can be
minimized, restored, and maximized within it.

7. To restore views that have been dragged out into a new window, drag a single view's tab or
the toolbar of a tabbed group of views back into the perspective.

Trim Stacks

When you minimize a tabbed notebook, a toolbar appears in the trim at the outer edge of
the workbench window. This toolbar is known as a trim stack.

Figure 16: A trim stack.

22
A trim stack has an icon for each of the views it contains. If you click on one of these icons,
the associated view is displayed as an overlay on the existing presentation. Of course, you
can use the trim stack's Restore button to return all of the minimized views to their original
locations.

To Use Quick Views

1. Open a development object in the source code editor.

2. Choose Ctrl + O or in the editor's context menu, choose Quick Outline. The Quick Outline
in-place view appears for the currently opened development object.

3. Choose Ctrl + O once again. The Quick Outline in-place view shows also all
subcomponents of all superclasses and all implemented interfaces. (This works only for
classes.)

4. In the Quick Outline in-place view, you can filter the results list by typing the first
characters of an element.

To Pin a View

There are occasions when you would like to make changes in a view while also keeping its
current contents visible. For example, you want to compare the content of a view with a
second set. Note that you can only pin views if the Pin icon is displayed in their toolbar.

1. Open the view that you want to pin.

2. In the view's toolbar, choose the Pin the ## View button, where ## is the name of the view.

3. You can now open a new instance of the view without losing the original, and arrange
them side by side for comparison.

4. To unpin the view, choose the Pin the ## View button once again.

Quick Access

The Quick Access field is located in the top-right of the Workbench. It allows you to quickly
access UI elements such as views, commands, preference pages, and others.

23
Figure 17: The Quick Access field

To Use Quick Access

1. In the Quick Access field, start typing the name of the UI element you want to open. A list
of relevant elements appears as you type.

2. Choose the element you want to open from the list. The UI element is opened.

24
Learning Assessment

25
26

You might also like