Corporate IT Personas:
- SAP Basis administrator: exposes OData services in back-end
- SAP application expert: provides OData service in ABAP back-end.
Systems, Tools, Services:
- SAP GUI
- Eclipse IDE with SAP Development Tools (ABAP in Eclipse/AiE)
- Web browser (Google Chrome)
- SAP NetWeaver AS ABAP 7.50 SP2
Step 1: Use ABAP in Eclipse to work with SAP NetWeaver AS ABAP
In this step you will use ABAP in Eclipse (AiE) to connect to your local SAP NetWeaver AS ABAP.
Note: Remember, that you installed the AiE tools before in Week 1, Unit 5, Step 5.3 as part of the SAP tools for Eclipse.
1.1 Quickcheck: NetWeaver is still up and running
By executing the preparation steps in Week 2, Unit 1 you already ensured that the SAP NetWeaver AS ABAP is up and running. Anyhow, it is a good practice to quickly check if the processes of the system are still running and their process state is GREEN:
- Open your openSUSE VM and start a Konsole terminal window.
- Execute su -l npladm (will ask for SAP NetWeaver AS ABAP system password)
Execute sapcontrol -nr 00 -function GetProcessList to check that the processes are running and are all GREEN
Now that you are sure that the SAP NetWeaver backend system is still up and running, you can start connecting your ABAP in Eclipse tools to it.
1.2 Open ABAP in Eclipse (AiE) tools
ABAP in Eclipse allows you to connect to a SAP NetWeaver system much like the SAP GUI / SAP Logon. In this course we will rely on AiE, as this gives you the benefit of doing all developments in the same IDE.
Open your Eclipse IDE
Hint: To open Eclipse you have to click on eclipse executable file as you did during the installation section 5.1 of unit 5 in week 1.
From the Eclipse menu, choose Window > Perspective > Open Perspective > Other…
In the opened Show Perspective window, select ABAB and click on OK to open the ABAP perspective.
Right-click on the ABAP icon on the upper right corner of the toolbar and choose Show Text to display texts of each perspective button additionally to the icons.
Result: You opened the ABAP perspective in your Eclipse IDE where you do now the ABAP specific development tasks. In the section 1.3 you create a new ABAP project.
1.3 Create new ABAP Project
From the Eclipse menu, choose File > New > ABAP Project.
- On opened New ABAP Project wizard
- Select the table row with Name Local NetWeaver
- Keep the pre-filled values and ignore the SCN is disabled warning.
On Logon to System page enter:
- Client: 001
- User: DEVELOPER
- Password: Appl1ance
- Language: EN
Note: Due to a bug it could happen that the first time your copy and paste values to input fields of ABAP in Eclipse you will get a Cannot paste error. Then just click OK and repeat the paste action, then it will work.
In the next wizard step
- Keep the project name NPL_001_developer_en unchanged
- Click Finish to create the new ABAP project.
Result: You have created a new ABAP project with name NPL_001_developer_en which is visible in the Project Explorer view of your Eclipse IDE. Via this project you established also a connection to the local NetWeaver AS ABAP by means of the Developer user credentials. Keep in mind that when you shutdown the ABAP system then also the project will be disconnected and closed. You can only work on ABAP projects when the ABAP system is connected.
You have now an ABAP project in your Eclipse workspace and also a Java helloworld project. To manage the different types of projects, we will create in the next section two so-called working sets, one for Java and one for ABAP projects.
1.4 Organize Projects in Working Sets
Follow the steps below to create two containers named ABAP and JAVA and add the existing respective projects. These containers are named Working Sets in Eclipse.
In the toolbar of Project Explorer view click the View Menu icon
- Chose menu item Select Working Set….
- On the Select Working Set window create an ABAP Working Set:
- Select the Window Working Sets option.
On the first New Working Set wizard page
- Select Resource as Working set type.
- Click Next.
On next wizard page
- Enter ABAP as Working set name.
- Select only the checkbox of the NPL_001_developer_en ABAP project node.
Result: A new ABAP Working Set has been created which contains the existing ABAP project.
On the Select Working Set window create a JAVA Working Set very similar to the ABAP Working Set but with
- Select Java as Working set type.
- Enter JAVA as Working set name.
- Select helloworld JAVA project node and click Add -> to move it into the Workset content area.
- Select **NPL_001developer_en** ABAP project node and click Remove to remove it from the _Workset content area.
- Click Finish.
Result: Both an ABAP and JAVA Working Set has been created which contains the corresponding ABAP and JAVA projects.
On the Select Working Set dialog:
- Select Selected Working Sets option.
- Select both checkboxes of the ABAP and JAVA node in the Selected Working Set area.
- Click OK.
Back in the Eclipse IDE: In the toolbar of Project Explorer view:
- Click the View Menu icon
Choose menu item Top Level Elements > Working Sets
Result: The two Working Sets ABAP and JAVA are now displayed as top level nodes in the Project Explorer view and inside these two new containers the corresponding ABAP and Java projects are located. In this course we will continue to organize all projects in semantic Working Set containers, e.g. a new Java application project will be added into the JAVA Working Set container. This helps to keep a good overview in the project explore view.
Step 2: Explore Back-End OData Services
Through the before created ABAP project you established from your Eclipse IDE a connection to your SAP NetWeaver AS ABAP system. Via this project-enabled Back-End connection you can now investigate directly from your development IDE which OData Services are exposed by the Back-End system.
2.1 Explore OData Services with SICF
Now you will run from Eclipse IDE an ABAP application, the SICF transaction, where you can explore all OData services exposed by the Back-End.
Info: By means of the ABAP transaction SICF you maintain the services of the Internet Communication Framework (ICF). The ICF allows you to communicate with the SAP system using Internet standard protocols (HTTP, HTTPS and SMTP).
In the Eclipse toolbar click the green icon Run ABAP Development Object as ABAP Application in SAP GUI.
In the opened Run ABAP Application window enter search string SICF (Searching action will start and can take some time, just wait).
Note: The Run ABAP Application action gives you access to all transaction an AS ABAP system exposes and the used SICF is one of them.
- Select first matching item SICF (Transaction).
Result: SICF editor opens with the initial Define Services screen, where you define which services you want to filter.
- Click Minimize icon of the Feature Explorer view to get more space for the SICF editor
Keep the default filter (Hierarchy Type: SERVICE) of the SICF editor and click the Execute icon on the Define Service toolbar to open the hierarchy tree of available services.
In the Virtual Hosts/Services column expand tree item default host > sap > opu > odata > sap.
Note: This location
sap/opu/odata/sapis the location where you find OData services as delivered with any SAP NetWeaver AS ABAP. There you also find the OData services from the Reference applications of the Enterprise Procurement Model (EPM), a demonstration data model on which the business cases and challenges of this course are based on. The Manage Products we use for an extension in this week 2 is one of these EPM Reference Applications and we will look in the following step for the underlying OData service of this application.
- Select tree item default host > sap > opu > odata > sap > epm_ref_apps_prod_man_srv.
- Open right-click context menu.
Make sure that Activate Service is grayed out, which means that the service is already activated.
Note: If an OData service is not activated you can use this Activate Service to activate it.
Now that you have found the OData service epm_ref_apps_prod_man_srv which the Manage Products application uses and confirmed that it is already activated you can explore more details of the service as shown in the following step 2.2.
2.2 Explore OData Service Details with SAP Gateway Client
To explore details of a specific OData service in the NetWeaver back-end you use the ABAP transaction IWFND/MAINT_SERVICE to search for a specific OData service. For the found OData service you open the SAP Gateway Client that provides a REST client tool. All this is shown in the following subsection.
2.2.1 Open SAP Gateway Client
In Eclipse IDE: First close the before opened SICF editor.
- In the Eclipse toolbar click the green icon Run ABAP Development Object...
- In the opened Run ABAP Application window
- Enter search string /IWFND/M (Searching action will start, just wait).
- Select first matching item /IWFND/MAINT_SERVICE (Transaction).
Result: [NLP] IWFND/MAINT_SERVICE editor opens with the initial Activate and Maintain Services screen, where you can e.g. filter for certain services.
- Click Filter button in the toolbar of the Activate and Maintain Services page
- In the opened Filter for Service Catalog window
- Enter filter string *PROD* as Technical Service Name.
Click green accept icon with tooltip Continue.
Result: The Service Catalog table only displays those services that contain PROD in their technical name.
- Select the table row of the EPM_REF_APPS_PROD_MAN_SRV service (external service name), which is the same as before found in transaction SICF.
Click SAP Gateway Client button in ICF Nodes area at the bottom to explore more details of the selected OData service.
Note: The first time you open the SAP Gateway Client tool in a new window it will take some time, just wait.
If a SAP GUI Security dialog window opens and you are asked to access the file SAPGuiServer.exe
- Mark the checkbox Remember My Decision
- Click Allow to open up a new SAP GUI client window with the SAP Gateway Client.
Result: SAP Gateway Client tool opens in a new window.
2.2.2 Explore OData Service in SAP Gateway Client
The SAP Gateway Client tool has been opened for the selected OData service EPM_REF_APPS_PROD_MAN_SRV. By means of this REST client tool you can explore the details of the service as follows.
Click toolbar button Execute to test the GET HTTP response of the OData service EPM_REF_APPS_PROD_MAN_SRV.
Click Data Explorer button to get more specific data of this OData service.
Hint: The OData service EPM_REF_APPS_PROD_MAN_SRV which we explore here offers the data of a Manage Products application. We want to see now which product data is offered exactly by the service and - for the intended UX Extension - is there some product rating data available which could be added to the application as extension.
Result: The Response is now structured in a service document with entities like Products, Suppliers etc. which the service offers.
Click Entity Sets on the main toolbar of the SAP Gateway Client page to get all Entity Sets provided by the OData service.
Select the Products entity set and click on the green accept icon
Result: The request URI changed to /sap/opu/odata/sap/EPM_REF_APPS_PROD_MAN_SRV/Products, i.e. the Products string was added at the end.
- Click toolbar button Execute to get the GET HTTP response of the OData service EPM_REF_APPS_PROD_MAN_SRV but this time specifically for the Products entity set
Double-click on any Product (e.g. HT-1000) in the HTTP Response area to see the all properties the service offers for each product.
Result: By means of the ABAP transaction
/IWFND/MAINT_SERVICEand the SAP Gateway Client you have seen how to explore the data of a specific OData service. Especially the Products entity set of the EPM_REF_APPS_PROD_MAN_SRV OData service contains also a property value AverageRating which we will use later this week in Unit 5 for the UX extension. Remember that we wanted to help the product manager to identify badly rated products.
2.3 Explore OData Services within Web Browser
So far you explored the back-end OData Services via NetWeaver AS ABAP transactions and tools (SAP Gateway Client). Now we will show how you can investigate a Fiori application in your Web browser to find out which OData service it uses.
As example Fiori application you will use here the Manage Products application which you can find on the S/4HANA Fiori launchpad (FLP) as follows.
Open S/4HANA FLP bookmark in Chrome Web browser - see Week 2, Unit 1, Step 4
On opened FLP login page enter:
- User: DEVELOPER
- Password: Appl1ance
- Click Log On to enter the FLP (launching Fiori launchpad application the first time could again took some time, just wait.)
Click Manage Products tile on the FLP to open the SAP Fiori reference application in which you can manage products coming from a Enterprise Procurement Model (EPM) defined in SAP NetWeaver AS ABAP back-end.
Open Developer Tools in Google Chrome:
- Open the Google Chrome menu, by clicking on the 3 dots icon in the in the upper right corner.
- Select More tools > Developer tools.
- Keyboard shortcut: Windows:
Ctrl + Shift + I/ Mac OS:
Cmd + Alt + I
On opened developer tools (by default on the right side of the Web browser)
Click on Network tab.
- Enter meta as string in the filter field of the network tab.
- Click Refresh icon of the Web browser.
Result: The first entry of the filtered HTTP network requests starts with $metadata? and is the OData service which provides the products data of the Fiori application.
Double-click on row $metadata?sap-documentation=heading&sap-language=EN to open the OData service metadata from the SAP NetWeaver AS ABAP 7.50 server.
Result: The service response gets displayed in a new browser tab, describing the data model of the EPM_REF_APPS_PROD_MAN_SRV OData service. As before in the SAP Gateway Client you can find in the metadata service output in the Web browser the properties of the product entity, e.g. the Average Rating.
|< Previous Unit 1||Up ^ Week 2||Next > Unit 3|