In this exercise, you start your ABAP cloud project and analyze some existing ABAP code to get familiar with some basic features of the ABAP development environment.
Task 1: Create an ABAP Cloud Project
Open Eclipse, switch to the ABAP perspective and create an ABAP Cloud Project.
Steps
Open Eclipse and switch to the ABAP perspective.
Open Eclipse.
Choose Window→Perspective→Open Perspective→Other....
In the dialog box, double-click ABAP.
Create an ABAP Cloud Project.
Choose File→New→ABAP Cloud Project.
Proceed as follows on the New ABAP Cloud Project dialog that appears:
If you have been given the ABAP Service Instance URL:
- Copy and paste this URL in the corresponding field on the dialog.
- Choose Next.
If you have been given a file containing the Service Key:
- Select the Extract link on the dialog.
- Choose Import... and select the file with the Service Key.
- After importing click Copy to Clipboard to copy the Service Instance URL.
- Choose Close.
- In the top of the popup box in the ABAP Service Instance URL:* field, paste the ABAP Service Instance URL with the key combination Ctrl + V.
- Choose Next.
Choose Open Logon Page in Browser.
You will be prompted to logon to the system.
Enter the user and password that you used to register to SAP Learning Hub.
When you see the message, You have been successfully logged on, close the browser window and return to Eclipse.
To finish creating the project, choose Finish.
Task 2: Analyze ABAP Class /DMO/CL_FLIGHT_LEGACY
Use some functions of the ABAP Development Tools to analyze the source code of ABAP class /DMO/CL_FLIGHT_LEGACY.
Note
You are not required to read the code in this exercise. Instead, concentrate on the navigation and display functions in the development environment.
Steps
Add the /DMO/FLIGHT package to your Favorite Packages.
In the Project Explorer view, right-click on the Favorite Packages folder under your project folder.
Choose Add Package... from the context menu.
In the input field, enter /DMO/FLIGHT as search string.
In the list of matching items, click on the /DMO/FLIGHT entry and choose OK.
Open the ABAP class /DMO/CL_FLIGHT_LEGACY in the editor view.
In the Eclipse menu, choose Navigate→Open ABAP Development Object... or press Ctrl + Shift + A.
In the input field, enter /DMO/CL_FLIGHT as search string.
In the list of matching items, click on /DMO/CL_FLIGHT_LEGACY (Class) and choose OK.
Open the Properties tab to display the administrative data of development object /DMO/CL_FLIGHT_LEGACY.
Place the cursor anywhere in the source code of class /DMO/CL_FLIGHT_LEGACY.
In the tab strip below the editor view, navigate to Properties tab.
Analyze the administrative data that is displayed there, for example the original language or the timestamp of the last change.
Locate the ABAP class /DMO/CL_FLIGHT_LEGACY in the Project Explorer view on the left of the display.
Place the cursor anywhere in the source code of the class /DMO/CL_FLIGHT_LEGACY.
From the toolbar of the Project Explorer, choose Link with Editor. This should expand a part of the tree under your ABAP project with the ABAP class /DMO/CL_FLIGHT_LEGACY as its end point.
Find the string get_instance( )->get in the source code of ABAP class /DMO/CL_FLIGHT_LEGACY.
Note
There has to be exactly one blank between the brackets.
Place the cursor in the first row of the source code of class /DMO/CL_FLIGHT_LEGACY.
Press Ctrl + F to open the Find/Replace dialog.
In the Find input field that appears, enter get_instance( )->get.
In the current code line, navigate to the implementation of code element get.
Press the Ctrl key and click on get. From the appearing menu choose Navigate to Implementation. Alternatively, place the cursor in the word get and press F3.
A few code lines down there is a line starting with SELECT. Without navigating away, display some information about code element /dmo/travel after keyword FROM.
In the code line starting with SELECT, place the cursor on /dmo/travel and press F2.
Display the ABAP Language Help for the keyword SELECT.
At the beginning of the current code line, place the cursor on SELECT and press F1.
Hint
If the ABAP Language Help view that opens indicates that the result set of the search query is not supported in the current ABAP language version, enter SELECT in the search term field of the ABAP Language Help view and press Enter. This search should provide the desired help.
Note
There is no need to read or understand the documentation at this point.