Anda di halaman 1dari 28

Get started with

.....................................................................................................................3
...........................................................................................................................4
...................................................................................................................................6
..........................................................................................................................................14
............................................................................................................................................18
...............................................................................................................19
...............................................................................................20
............................................................................................................................21
......................................................................................................................22
................................................................................................................23
.....................................................................................................25
.................................................................................................................27
The next few pages will give you a short summary of some of the differences between the
work in ABAP Workbench and ABAP in Eclipse. In addition, it serves as a documentation
which shows you interesting information when you start with ABAP in Eclipse.
Chapter 1 is written for ABAP Newbies,so maybe you can skip this.

Attention: Please read the symbol explanation, it will save your time.

Useful information for newbies in ABAP Programming language.


ABAP Workbench experts can skip this information.

Interesting information, links etc.

Differences between ABAP Workbench and ABAP in Eclipse.

New features in ABAP in Eclipse.

Eclipse

ABAP Workbench

So now enjoy the guide and we wish you a great experience with ABAP in Eclipse.
You are an ABAP Newbie: no problem. In this chapter we will start with the basics of Eclipse.
You will learn how you can customize your workspace so you can develop with ABAP.
The First Login:
1. Open Eclipse
If you open Eclipse for the first time the Welcome Help opens so you can click on
the arrow to navigate to the workspace. Further information to the help you can find in
chapter 5.
2. Customize your workspace for ABAP.
Add an ABAP perspective (You will learn in chapter 2 what a perspective is.)
In the right upper corner you can see Open Perspective Symbol" ( ), choose
the ABAP perspective.
You only need to perform this step at the first Logon, Eclipse save the perspective for
all other Logons.

Figure 1: Add a perspective

3. Create a new ABAP project


To create a new project go to File New ABAP Project
Here you can either choose an existing SAP Logon entry or define a new system
connection.
Your project will be added to the Feature Explorer View, here you can see our
project with their folders and files.

Figure 2: Create a new project


The normal Login

1. Open Eclipse
2. Click on your project
3. Enter your password
4. Enjoy the work.

Figure 3: ABAP workspace

Figure 4: Login with password

Now we have laid the foundations for working with ABAP in Eclipse. So you can work in the
next chapter like an expert.
Structure
In the first step you will become familiar with the work athmosphere in Eclipse.
The Eclipse Workbench contains perspectives and views.
A perspective is a group of views and editors. It defines the layout of views.
The relevant perspectives for this documentation are the ABAP and Debug perspectives.
How to open a new perspective

In the right upper corner you can see Open Perspective Symbol ( ).
Also there is an overview of which perspectives are open and where you work. You can
switch/change between the perspectives there.

Figure 5: Add a perspective

A view displays a tool of the ABAP Development Tools or supports an editor. The following
picture shows you the standard organization of views in the ABAP perpsective.

Figure 6: Views overview

You can adapt your window for your personal work by adding, closing and deleting views.
So the view also influences your navigation and how you can receive information.
How to add a view

In the menu bar Window Show View choose the view or use the Shortcut Alt+ Shift +Q.

Create your own perspective


You can add and close views in your perspective. You can save your new layout
under Window Perspective Save Perspective As.

In chapter 4 we will present you a few useful views.


Navigation

In the first step you learned how the Eclipse workspace is organized. Now I will show you
relevant navigation tools.

One interesting point is that you can work in Eclipse with in more than 1 project at the same
time. Furthermore, you can open more than six editor tabs, if you remember, in SAP GUI
the maximum is six modes.

Display <-> Change-mode (Shortcut Ctrl+F1) doesnt exist, in Eclipse, you are
always in change-mode.

Basic navigation:

In ABAP Workbench these are the important navigation tools. In Eclipse other tools are
more important. However it does not mean that these tools are gone.
In Eclipse you can go back to our Last Edit Location (Shortcut Ctrl+ Q) with the arrow.
The other arrows allow you to navigate between your last open programs or annotations.
In addition to that you have a search field Quick Access to navigate very quickly.
Furthermore you will see in the next chapters that you can open / create / go to items in
Eclipse in more than one way. You have the possibility to use the menu bar, the search field
Quick Access, Shortcuts and sometimes a symbol exists for your task. So feel free to try
out which way is the best for you.

Figure 7: Navigation tools

In the next steps I show you navigation tools and useful shortcuts, which make the work and
navigation in Eclipse easier.
Transaction:

Quick Access for a transaction is gone in ABAP in Eclipse.


To call a transaction use Open ABAP Development Object (Shortcut Ctrl+ Shift+ A).
Proposal lists give you an overview of possible transactions.

Figure 8: Open ABAP Development

Proposal List:

You know Shortcut F4 for value help? Not needed anymore. In Eclipse proposal list are
directly integrated. The list shows you a proposal of all different element types.

Figure 9: Proposal list


Link with Editor:

Link with Editor combines the current editor tab with your Project Explorer list. You can find
the actual data element in your Project Explorer View when you use Link with Editor.
When Link with Editor is activated all the time, your Project Explorer View always shows
the tab where are currently working. This means that it is automatically updated.

Figure 10: Link with Editor


Shortcuts:

Shortcuts make development in Eclipse much faster and can make your ABAP life easier.

Code element information:

Need information on code elements in ABAP Workbench? You must use transactions and
the ABAP Dictionary. In Eclipse the shortcut F2 shows code element information directly.
For example, it is useful when you look up type information.

Figure 11: Shortcut F2 Show code information

Formatter:

Formatter (Shortcut Shift+F1) is a tool to format your source code. In ABAP Workbench it is
well-known as Pretty Printer.
You can specify the Formatter settings in properties for your project. How can you do that?
In the Project Explorer View mark your project and right-click. Then choose properties (or
use the Shortcut Alt + Enter or menu bar Project Properties).
In the properties dialog, choose ABAP Development Editors Source Code Editors
ABAP Formatter and then you can choose our favorite code style.

The Pretty Printer symbol is gone. Use the familiar Shortcut Shift+F1.
Keyboard Shortcuts:

Oh no, what is the Shortcut to create a New ABAP Project?


You forgot it?
No problem, the Shortcut Ctrl +Shift+ L shows you all keyboard Shortcuts so you can look
there.

Different use:
Shortcut Ctrl+ Shift+ L deletes lines in ABAP Workbench

Figure 12: Shortcut Ctrl +Shift +L Show all keyboard shortcuts


Quick Assist

Quick Assist help you to complete your source-code. It contains ABAP Refactorings, ABAP
Quick Fixes and help to generate elements. You can use the Quick Fix with the Shortcut
Ctrl+1 or use the Shortcut Ctrl+Shift+1 for open the Quick Fix View. Work with the Quick
Assist and you will see to code is easier and faster than before.

Quick Fixes

Quick Fixes help you to code much faster. You can resolve errors and warnings with Quick
Fixes. For example, if you write a method in your source-code but the method is not
declared, you can declare it very fast with a Quick fix. You can see this example (create a
method) in the chapter Class Builder (Page).
How to use Quick Fixes?
Click the line or the item and then choose Shortcut Ctrl+1. Now the Quick Fix Assistant is
open und you can choose an action.
If you prefer the Quick Assist View you can use the Shortcut Ctrl+Shift+1 to open it. An
advantage of the view is that you can change the object and see directly which action is
possible. Normally you must use the Shortcut again when you change the element but here it
is automatically updated.

Figure 13: Shortcut Ctrl +1 "Quick Fix"


Eclipse has many different views.
In the next steps we explain a few useful tools for working in Eclipse.
But first we will show you some general tips for views.

General Information:
Each view has its own menu. You can look in it by clicking on the arrow.

Figure 14: View menu


Templates View:

Code templates save time in Eclipse, an extra view makes it easy.


Why I should use code templates?
It is easier to work when you write less of your own code and so you can save time.
ABAP Workbench Code Templates are suggested by code hints (symbol ).
In Eclipse there is an extra view with predefined templates. The Code templates adjust to the
actual element and you can look in it in the preview. (Also the old function with code hints
works.)

Figure 15: Templates View

Create your own template:


Choose Window in the menu bar PreferencesABAP Development
Editors Source Code Editors ABAP Templates. Here you can choose at the
right side the NEW-Button and create your template.

Figure 16: Create a new template


Task List View

Task- what is it?


It is a private note for things that must be done.
In ABAP Workbench you write Task in Comments but now an extra view is created. But
before I explain the view, here is a short exercise for you. If you want you can do this and
create a Task.
Create a Task:

1. Use the Quick Access write and choose New Task.

Figure 17: Search "New Task"

2. In the new view you can create our task with deadline, reminder and add details in
the comment field.
3. If you finish our task you can change here the status to Complete.

Figure 18: Create a task


The Task List View:

In the Task List View there is an overview of your Tasks. Also you have Mouse-Over-
information, which shows you information pertaining to your task, or you can choose the task
and see all information.

Figure 19: Task List View


ABAP Keyword Documentation (ABAP Language Help View):

ABAP Keyword Documentation is a help documentation, which shows


information (meaning, use and example) of ABAP keywords (Shortcut F1).

Open ABAP Keyword Documentation (Shortcut F1). In the ABAP Workbench a new
window is opened.
In Eclipse you can find the help directly in a view. So it is easier to work with the help
information.

In addition to that you have a Feature Explorer View (Shortcut Alt +Shift+ Q Q
Search and choose Feature Explorer View) to get familiar with the basic
features in Eclipse. In the Feature Explorer View you have documentation for
Eclipse, Java, ABAP in Eclipse and so on.

Figure 20: Help View and Feature Explorer View

Welcome Help:
If you are a newbie you can use the Welcome Help in Eclipse. Here you can find
an overview information or first step tutorials to get familiar with Eclipse. Open this
with Help in the menu bar Welcome; then you can choose, for example, tutorials.
Scroll down and on the left side you can find an ABAP information tutorials.
Feel free to try it out.
If you Check ABAP Development Object (Shortcut Ctrl+F2) now you have more information
features.
In an additional view you see all problems of the system with all information.

When you double click on a specific problem you directly navigate to it.
Also at the beginning of the line you can see little symbols

( = warning; = Error) which contain detailed Mouse-Over-information


about the mistakes.

Figure 21: Problems View

Figure 22: Problems mouse- over- information


ABAP Debugger is a diagnostic tool to find program errors.

Figure 23: Debug Perspective

Now you can directly change your source-code.


You can also access debugging from Web IDE.
You can look directly at a structure or table and navigate directly to other elements.
Build a class:

In the ABAP Workbench source- code-based and Form-based options are possible.
In Eclipse there is only the source- code-based option to create a class.
But Stop! It is not a problem. If you dont like it, you can open the Class Builder in SAP GUI
and use your familiar form-based option.
But to create a method now the source- code-based version is very easy, because you can
directly create a method with Quick Assist.

Figure 24: Class source-code

Build a method:
Write the normal method statement, then click on the method and use the Quick Fix
(Shortcut Ctrl+1) or Open Quick Assist view (Shortcut Ctrl+Shift+1).
Now you can choose create a method. In the next step your method is declared.

Figure 25: Create a method defintion with "Quick Fix"


Function modules contain code elements. These code elements are easy to paste
in different programs. So function modules help you to write code very fast.

Function module create form-based in the ABAP Workbench.


In Eclipse only the source- code-based option available. Use templates for Export/Import
parameters.

Figure 26: Create a function module with template


With SAP HANA a new principle was born: Push down semantic database information to the
database layer.
To implement this a new infrastructure for data modelling was created. Core Data Service
(CDS) is the new concept to fulfill this principle; it is an infrastructure for defining and
semantically consuming rich data models. Rich data models are represented as CDS-views.
However, please note: there are two different types of CDS HANA CDS and ABAP CDS. In
this documentation we look at ABAP CDS.

When you need more information about the two types of CDS here is a good link
for you: https://blogs.sap.com/2015/07/20/cds-one-model-two-flavors/

But what is ABAP CDS?

ABAP CDS is the Core Data Service concept integrated in the ABAP Development tools.
With SAP NetWeaver 7.4 SPS 05 it is completely implemented in AS ABAP. Until now the
ABAP Dictionary was used to define tables, views and data types. So the natural way to
introduce CDS on the ABAP Application Server is to add it to the ABAP Dictionary. You
define and work with CDS-artefacts in a DDL-Editor, which is included in ABAP Development
Tools. CDS artefacts are stored in the ABAP Dictionary and can be accessed in ABAP
programs via Open SQL in the same way as ordinary ABAP tables and views. The definition
of the data model is done with the SQL-based Data Definition Language (DDL). DDL
contains annotations for linking existing tables with new technologies like ODATA or UI5.
Furthermore it contains associations, which define the relationship between CDS-Views and
annotations. An additional difference is that in CDS you can use special operator like UNION
to combine Select-statements. Furthermore a new client authorization concept based on
roles is integrated in CDS. You therefore use a DCL-source code.
With ABAP CDS, a developer can work on the ABAP layer and the code is pushed down to
the database. In contrast to HANA CDS, ABAP CDS operates on all database platform s
(including SAP HANA).
How does our source-code look:
To create a CDS-view you can find so many tutorials in the internet; there is documentation
in the Feature Explorer View (for example, How can I create a Data Definition?)? For this
reason I will not show you how you can create it but I will give you a short insight in the
source-code.
First you create a Data Definition with the define View statement. For the new authorization
concept you can use the operator define role.
With Annotations you can add core and framework-specific metadata to a CDS object. In
CDS there are view -, table function-, element annotations and parameter annotations; each
existing piece of metadata is valid for the whole View, Table function parameters etc.
depending on the annotation scope. You can add annotations direct on the DDL source-code
(Data Definition) but do not forget the @-character at the beginning. Also you can write
annotations in front of the define view statement. With association you can define the
relationship between CDS- entities. Add associations like this:
Managed Associations Association [ <cardinality> ] to <targetEntity> [ <forwardLink> ]
Unmanaged Associations Association [ <cardinality> ] to <targetEntity> <unmanagedJoin>

Figure 27: Create a CDS-View

This is a short insight in the source-code but if you need more detailed information look in the
ABAP Language Help and the ADT Help.
When you code you will see learned facts from the other chapters can help you. So you do
not need to know long table names exactly because the code-completion can help. Also you
do not navigate in the DDIC because with Quick Fix F2 you can look direct in the table
content.

Here you can find a video tutorial for build a CDS-View in ABAP on SAP
HANA:
https://www.youtube.com/watch?v=aYRduGG_kL4
Interesting information and useful tips to create our CDS elements you can
find in the CDS Tooling Guide:
http://go.sap.com/germany/documents/2016/06/361ddcf3-787c-0010-
82c7-eda71af511fa.html
I am sure that this chapter information is not really new for you because it is common ground
between ABAP Workbench and ABAP in Eclipse. Nevertheless I will show you this so you
have an easy access to it, since in Eclipse the design is a little bit changed.
ABAP development projects are created in the development system but if they are finished
they must be transported. They are transported to the: test system, quality system and
productive system. For this reason you must assign the project to a transport request. To
transport all objects in the development project together you must create a change order. A
change order includes all objects of a development project. Another positive aspect, is that
all developers can see what they have to do. To have a simple transport organization you
can use the Transport Organizer View.
Transport Organizer View:

Here you can see our projects, transport requests and tasks. To find object faster you can
use the search field.
You can also add users to our transport request, but it is only available when it is in the
modifiable folder. To add a user right-click in our transport request choose add user. Now a
new transport task can be created.
If you are finished and will release your transport request and task you can to this also by
right-clicking.

Figure 28: Transport Organizer View


How can I assign an element to a transport request?
It is very simple if you create a new object for example a new Data Definition, there is the
question: to which transport request you want to assign your object? You can choose
between existing requests or create a new request; you can also search a request. If you
finish and refresh your Transport Organizer View you can find your new create Data
Definition in it.

Figure 29: Connect an element with a transport request


Here is a little overview with shortcuts, which explain or use in this guide.

Familiar Shortcuts

(Shortcuts can use in ABAP Workbench and Eclipse)


F1 ABAP Keyword Documentation
F2 Show Code Element Information
Shift +F1 Formatter (Pretty Printer)
Ctrl +F2 Check ABAP Development Object

New Shortcuts

Ctrl +Shift +A Open ABAP Development Object


Ctrl +6 Open SAP GUI
Ctrl + 1 Quick Assist /Fix
Ctrl +Shift +L Show all keyboard Shortcuts
Alt +Shift +Q Show View
Alt +Enter Properties

Lost/ old Shortcuts

(You dont need this shortcuts anymore)


Ctrl +F1 Display <-> Change mode
F4 Value Help
Transaction: /nex Logout

A useful shortcut overview card you find there:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/8037f180-
b0a5-2f10-949a-dd6a4acf8d96?QuickLink=index&57844619554684
Disclaimer

This document outlines our general product direction and should not be relied on in making a
purchase decision. This document is not subject to your license agreement or any other
agreement with SAP. SAP has no obligation to pursue any course of business outlined in this
document or to develop or release any functionality mentioned in this docum ent. This
document and SAP's strategy and possible future developments are subject to change and
may be changed by SAP at any time for any reason without notice. This document is
provided without a warranty of any kind, either express or implied, including but not limited to,
the implied warranties of merchantability, fitness for a particular purpose, or non-
infringement. SAP assumes no responsibility for errors or omissions in this document, except
if such damages were caused by SAP intentionally or grossly negligent.

Anda mungkin juga menyukai