Technical Articles
A Do-It-Yourself Step-by-Step Guide: How to Set Up Your On-Premise System of SAP S/4HANA 1709 at Home – Part II. Let’s Play with Development Tools and ABAP Programming Model
A quick note for myself (and readers who are interested) regarding the latest development in the ABAP langauge, namley ABAP RESTful Programming Model (RAP): https://blogs.sap.com/2018/10/11/abap-is-evolving/
Part II: Let’s Play with Development Tools, SAP Demo Data, CDSs, oData Services, and SAP Fiori Apps
In Part I, we deployed our own SAP S/4HANA 1709 instance from SAP CAL onto GCP. In Part II, we will build on the previous part, and play with development tools and ABAP Programming Model.
We will download and set up two SAP development tools: ABAP Development Tool (ADT) and Web IDE (Personal Edition). We will then connect them to your instance of SAP S/4HANA 1709 on GCP, and create a very simple Fiori app based on the ABAP Programming Model. We will be covering the following steps (the number continues from Part I of this blog tutorial series):
4. Playing with ABAP Development Tool (ADT)
a. Setting up Java on Your Windows PC
b. Dealing with Eclipse and ADT Plug-in
b. Setting up connection from ADT to Your S/4HANA Instance via Transaction SMGW
c. Generating Flight Demo Data
d. Creating a Custom CDS View
e. Publishing and Testing Your oData Service
5. Playing with Web IDE (Personal Edition)
a. 7-zip
b. Setting Up Web IDE
c. Creating your own Fiori App Using a Template on Web IDE
Part II would be a little more “technical*” than Part I. You do not need to be a command prompt guru, but expect some level of command prompt and configuration directly in text files.
* What does “technical” mean anyway?
Time You Need Spend
- I would have to guess: 60-90 minutes of your time actively facing and typing in your computer, if you want to just go through the steps
- Time to download JRE, Eclipse, Web IDE, and 7-Zip. You may need to check your Windows being 64-bit or 32-bit. You may want to take a bit of time to be careful and accurate here to avoid potential rework. So… 60-120 minutes, perhaps.
- Additionally, 60-120 minutes to wait for zip files for Eclipse and Web IDE to unzip. You could run the unarchiving process and have a lunch, snack, beer, or dinner. I think this would also depend on your machine performance. I remember that Web IDE took longer than my lunch break (sorry, I did not log the duration of time it took); Eclipse was quicker to unzip but it is also rather large an archive file (my screen shot shows estimate time of 10 minutes)
Step 4. Let’s Set Up ABAP Development Tool (ADT)
If you are skimming through this tutorial, and are familiar with Eclipse and Java, you will not need to read all of Step 4. For these people, I’ll note one thing: Go to transaction SMGW and set up RFC for ADT.
(Detail is explained in 4.c. Setting up connection from ADT to Your S/4HANA Instance via Transaction SMGW).
Otherwise, follow this way, please.
You could still use transaction SE80 via SAP GUI for your ABAP development. Why not we try using ADT? Probably you have seen it in action. Let’s play with this newer tool for ABAP development in person.
Here is the documentation on prerequisites and the procedure to install it: https://tools.hana.ondemand.com/#abap.
Note: I did not have to install DLLs VS2010 (listed in the bottom of the table above). It is possible that my Windows had come with it already installed (I am using my company PC). If you have any trouble with this, I’m pretty sure Google can help you find what to do.
ADT is a plug-in to Eclipse. Eclipse is an integrated development environment (IDE) written (mostly) in Java. If you are familiar with Eclipse, the procedure to install ADT is simple. If you haven’t dealt with Java on your Windows, then it could be a little confusing at first. Windows normally does not come with a Java environment, so you will need to get an installer execution file and install a runtime by yourself.
Note: It is possible that there are a newer version of Eclipse and JRE are available when you are reading this. In this case, I will leave it to you to decide which version to go with. I used Oxygen, the latest at the time I played with ADT (around May 2018).
Note 2: As I took a bit of time to finish this blog, a new release of Eclipse (Photon) has arrived. I will stick to Eclipse Oxygen as it is the one I used.
4.a. Setting Up Java on Your Windows PC
Pay particular attention to 32-bit or 64-bit version throughout the installation process. If you are not careful, like me, your Eclipse will fail to launch, even though it looks like you have installed it correctly.
I do not hesitate to use Google to find out how I can confirm that I have 64-bit Windows (or 32-bit).
Next, check whether your PC already has a Java Runtime, or JRE (Java Runtime Environment), and its version.
Open Start menu, and type cmd to start the command prompt.
Type the following command:
java -version
If your PC already has a JRE, then it will return the JRE version like in the screen shot. My JRE is version 1.8.0 and it’s for 64-bit Windows. If your PC has an older version, I think it best to uninstall it and install a new version. I did not have to do this. Googling should tell you how; from memory, you can do this via Control Panel of Windows (or Settings).
To obtain JRE, I used this site to download the 64-bit version (I used version 8). My knowledge of Java is not very much. version 8 seems to be a bit old. But it works. Version 10 is the latest as at the time of writing this. I believe you could choose to use the latest version just fine.
http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html
Select the radio button to accept license agreement. It’s highlighted with a red box in the screen shot below; yes, I always miss it and get an error message.
From my experience, try to avoid using the download from this site:
I ended up having a 32-bit version (I am not sure if you can choose 64-bit version in this site). I ended up repeating the installation process from the Oracle hosts (the screen shot above).
4.b. Dealing with Eclipse and ADT Plug-in
You can get Eclipse www.eclipse.org; however, for us, let’s use the link provided in the ADT site (see the screen shot below and where my cursor is).
There are so many variants that come with additional tools. All we need is a baseline for ABAP developers. “Eclipse IDE for Java Developers” is perfectly fine for us.
I am not too sure if this big “Download” button (top of the screen) is smart enough to detect which variant of Windows my machine is. As I know I have Windows 64-bit and have installed JRE for 64-bit, I will get Eclipse for Windows 64-bit. If you are not familiar with Java, try not to be smart here. Stick to 64-bit in all the layers, or 32-bit in all the layers. I think I have seen a table in Eclipse site to show you possible combinations. Forge different combinations. My initial attempt to launch Eclipse failed because I was not careful enough to get the correct bit version in one of the layers (JRE).
You download a zip file, and then extract it. For this, you can use the standard unzipping tool that comes with Windows, like I did.
You can choose the location where you want to install your Eclipse. Unlike many other pieces of Windows software which are installed via an installer, this is just an archive file (as far as I know). Please comment if I am wrong, but I believe you can even move the entire location after you unzipped the archive file – if you don’t need Eclipse any longer, you just delete the entire folder. Hmm, to me it was a culture shock.
After the unzipping process, go into the eclipse folder (as shown). Double-clicking exlipse.exe will launch Eclipse.
The first you do launch Eclipse, you will get this prompt. Specify a workspace folder. This is the folder where your programming artefacts and other things are saved.
If your installation is successful, you will see this Welcome page. Hooray! This does not understand SAP or ABAP yet.
You then need to install the ADP plug-in for ABAP development. To do this, you need to specify where Eclipse can find ADT via a URL, so that it can download necessary components for you.
Press Add.
Specify the URL as shown in this screen shot (or documentation https://tools.hana.ondemand.com/#abap).
Note: If you are using a version of Eclipse other than Oxygen, the URL will likely be different. Follow the documentation.
You don’t need all of these I that I checked – the documentation mentions only the top one (ADT). I just thought “Why not?” and included the other ones.
Click “Next”.
Accept Software User Agreement, and click on Finish.
The installation process will start automatically.
When the installation finishes, you will get this prompt. Restart Eclipse.
After restart, you will see that Welcome page shows this overview page. It lists all the new features for ABAP Development (and others like SAP Cloud Platform; I believe this is because I installed the other plu-ins on top of ADT).
There are a lot of documentation and tutorials available for ADT. Feel free to go off this blog and explore the vast materials.
One thing you will want to do here is to set a perspective designed for ABAP development. A perspective is (in my own term) a default layout of windows within Eclipse designed for a certain programming language or a development task. ADT comes with a perspective for ABAP. To use it, follow the menu tree as shown and choose ABAP.
When you first select the ABAP perspective, it looks a bit too crowded. This is because the Welcome page is still shown. Go back to the overview and close it.
Close the Overview (Welcome) page.
The ABAP perspective will look something like this.
To start ABAP development, you will need to create an ABAP project like shown. However…
If you haven’t set up SAP GUI on your PC, you may get an error like this. You should not see it if you have already connected to your S/4HANA system, you can select one of your systems and proceed to a logon prompt.
You need to log on to your S/4HANA system with your user.
If you are using your own S/4HANA system that we set up in Part I of this blog series, then you will get an error message saying that the connection has been rejected.
We will fix this in the next step.
4.c. Setting up connection from ADT to Your S/4HANA Instance via Transaction SMGW
So now you have ADT, but the connection to your S/4HANA system has been “rejected”. I could not find this mentioned in the documentation in CAL.
The solution for this can be found in this blog: https://blogs.sap.com/2017/12/14/sap-s4hana-1709-fully-activated-appliance-hints-known-issues/
OK. Let’s do this in our S/4HANA system. Here I am using SAP GUI.
Go to transaction SMGW, and follow the menu tree.
Now you see the source is restricted to “local” – whatever that means, I am not too certain.
Change this to accept any sources as instructed.
Press the save button above.
Save globally.
Now you can connect to your S/4HANA system from ADT!
4.d. Generating Flight Demo Data
If you are already familiar with SAP ERP and S/4HANA, you would have seen SAP flight sample programs and data. You can create your own sample data and examples in anyway you wish in your DIY system, of course. But there is an easy way to generate sample data for the flight examples.
Initially in the CAL instance, you don’t have the sample data. Let’s see an example here.
Press CTRL+SHIFT+A, and display a CDS view named S_BOOKINGS.
You can run this to see the data – it returns no data.
Go to transaction SE38 (or SA38, SE80, etc. you should be able to run this within ADT, too). Run program SAPBC_DATA_GENERATOR.
Specify an option (I chose the “Standard Data Record” option), and execute the program.
Now you can see the data in the CDS view, S_BOOKINGS.
4.e. Creating a CDS view
Let’s create a consumption view to expose some data from S_BOOKINGS as an OData service.
I’ll create a new CDS view.
Give a view name for the ABAP dictionary (for me “NO” is my initial, nothing else), and specify the source.
Press Shift+Space, and insert all elements from S_BOOKINGS.
I commented out some fields for the sake of demo.
Add the tag to let the system know that you want to publish CDS view as an OData service:
@OData.publish: true
The entire source of ZNO_C_BOOKINGS looks like this below.
@AbapCatalog.sqlViewName: 'ZNOBOOKINGS'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Consumptin View for S_BOOKINGS'
@OData.publish: true
define view ZNO_C_BOOKINGS as select from S_Bookings {
//S_BOOKINGS
key CarrierId,
key ConnectionId,
key FlightDate,
key BookId,
CustomerId,
CustomerType,
//Smoker,
//LuggageWeight,
//WeightUnit,
InvoiceId,
Class,
//ForeignCurrencyAmount,
//ForeignCurrencyCode,
//LocalCurrencyAmount,
//LocalCurrencyCode,
OrderDate,
//Counter,
//AgencyNumber,
Cancelled,
Reserved,
//passname,
//passform,
//passbirth,
/* Associations */
//S_BOOKINGS
_Customer,
_Flight
//_ForeignCurrency,
//_LocalCurrency,
//_WeightUnit
}
Press the button second from left to activate my new CDS view.
As the system knows that you intend to publish your CDS as an OData service, it will give you an warning message saying that you still have to do something.
4.f. Activate Your OData Service in SAPGUI via transaction /IWFND/MAINT_SERVICE
ADT has automatically generated an OData service for you. You need to manually activate it.
Go to /IWFND/MAINT_SERVICE (type “/n/IWFND/MAINT_SERVICE” in SAP GUI).
Press Add Service button.
Specify “LOCAL” as System Alias. The external service name should correspond to the name of your CDS view name. In my case, I filtered the list by ZNO*.
Select your service, and press “Add Selected Services” button.
For our purpose, make it a local object. You do not need to change anything else.
Now your oData service is published and active. Let’s test it.
Press “SAP Gateway Client” button to navigate to a client tool to test your OData service.
Execute. You should see a response that looks like this.
You can also test this via your browser. I used Google Chrome here.
Great! Now you have your own OData service based on a CDS view.
Next we will put a user interface on top this to complete our sample Fiori application. To do this, we will set up Web IDE Personal Edition on your PC.
Step 5. Let’s Set Up Web IDE (Personal Edition)
For those who are skimming through this tutorial to see if it has an answer to your problem, here are quick glance at the tips from my own experience. For others, follow along for step-by-step details.
- Use 7-zip to unarchive Wed IDE. Window’s native unarchive tool will NOT work (probably due to the deep folder structure)
- Browser cache may be a problem when launching in Chrome. Try the incognito mode, or different browser such as Firefox if you encounter problem with launching
- config_master folder does not exist immediately after unzipping Web IDE. It gets generated only when you first open Web IDE successfully in your browser (therefore, you need to solve the cache issue first, if you are unlucky to encounter it like I did)
- In the config file for connection, use https; DO NOT use http, (URL=https://vhcals4hci.dummy.nodomain:44301) to connect to your S/4HANA system. If you used http (like I did initially), you will be unable to test your Fiori apps. I had many CSRF token problems, and $batch operations do not work because it uses the POST method of HTTP protocol
5.a. 7-zip
Do not use Windows’s standard unzipping tool to unzip Web IDE archive file. The unzipping process completes, but it will not launch.
I’m sure you could use a unarchiving tool other than 7-zip. It worked for me, and you don’t have to worry about the license to use it (free and open source; most code under the GNU LGPL license).
You can get it here: https://www.7-zip.org/
This downloads an executable file. Execute it to run the installer.
Yes, I got the 64-bit version.
5.b. Setting Up Web IDE Personal Edition
For our DIY purposes, I used Personal Edition. You can download the zip file from here: https://tools.eu1.hana.ondemand.com/#sapui5
Use 7-Zip to unarchive the zip file. I chose the option of Extract… to choose the location.
In my case, I created a folder WebIDE directly under C:\
This takes quite bit of time. In my case, from memory, it was longer than my lunch time.
The application will be located in a folder named “eclipse” – don’t be confused with ADT. It is not the same, of course.
Double click on orion.exe will open a new window and automatically start a server.
Open your browser, and go to http://localhost:8080.
Create a new account for Web IDE and login.
Successfully launching Web IDE will automatically create config_master folder and its subfolders.
Note: The first time you have just unarchived the zip, there is no config_master folder included. It is only after you have first launched Web IDE that you will find it (generated by the system). I spent an aweful lot of time looking for the folder.
Create the config file as specified in the documentation.
Mine look like this. I did not add all the usages. This worked for me. Save the config file.
Note: Make sure that your URL is https://, not http://. I spent a few days and nearly gave up writing this blug because of the issues associated with http://. Fiori apps won’t work properly in the next step if you use it. Make sure to use the correct https and port.
And… I think you will need to shut down the server (just close the window for orion.exe that looks like a command prompt), and restart it (sorry, I was in a bit of rush here and did not record all the fine details).
5.c. Create a Fiori app using the OData service
Start Web IDE server, and log on via browser.
Now you will create an Fiori list report application that consumes your OData service.
The process is straight forward and there are many great and detailed tutorials available. Here I will just let the pictures talk.
Click on the big green “play” button to test the app.
It is a full-fledge app — try the filter function, for instance.
You can see the filter for “J” worked.
Yes, this is it!
Congratulations! You have just created your own Fiori app.
Related Blogs
There are a plenty of good tutorials on how to develop Fiori apps, etc.
If you are just starting out, perhaps this Q&A will be useful. Refer to Jocelyn Dart‘s response to a question of “Where do I start”?” (and perhaps many of her educational blogs on Fiori development).
Closing
I’ll admit; I envied full-stack developers in other development environment. They can (and perhaps need to) build their own server and stack up all the tools they need; almost self-sufficient. Yes, I think the lawn next door looks greener; however, this was one of the biggest sources of motivation of writing this blog series… Some so-called “negative” emotions (such as envy and jealousy) can be channelled into a rather positive feat.
There are a great amount of good tutorials available for ABAP and Fiori development. But I felt that it might be a little challenging for people who are just starting out, or who have other priorities but would benefit from even a short period of hands-on exposure to development in the new SAP environment (I had project managers and experienced functional consultants in mind). What seems to be missing to me was a quick travel guide to prepare for the journey — setting up the environment for ABAP and Fiori development. I have been exposed to some philosophy of DIY — if a tool is not available, think if you can make it.
So I did. Here is a travel guide to (I hope) help you prepare for a fun journey ahead. Hope there have been some useful pieces for you. Your journey has not even begun. Hope you will have a lot of fun along the way.
Fantastic Blog !
Thankyou Noboru Ota
Thank you! Hope this will be useful for you.
Wow - Very Detailed - Awesome Blog. Thanks Noboru
Thank you, Rama!
Noboru Ota Thanks Very Much! Simply Awesome!
I have a question is it possible to download s notes
Thank you. I don’t know the answer to your question. Perhaps you could dig a little deeper and let us know (??) Or other readers know already 🙂
Thanks for Your Warm Speed Reply.
Hi Jani, Yes that is what transaction SNOTE is for.
Thanks Nobby! Great blog. Personally I am not a fan of the Personal Edition - you lose too much! If you want to connect to a SAP Cloud Platform Web IDE account (even a trial account) this blog might be of service 🙂
https://blogs.sap.com/2017/04/25/connecting-a-cal-s4hana-instance-to-sap-cloud-platform-web-ide/
Hi Jocelyn. Thank you for the comment and link to your blog!
I see. I should have read your blog first!
As a next step, I was thinking of going through installation of SAP Connector to my CAL instance and going out to SAP Cloud Platform... I might follow your blog and see where it gets me.
Thanks again!
Hi everyone!
@Noboru: Great blog, I was able to set an SAP instance in a couple of hours yesterday.
However I got stuck connecting Eclipse ADP to SAP. Did anyone else ran into an error like this?
Logon to system &1 failed (partner 'xxx:3300' not reached)
I tried opening TCP 3300 on my laptop but no success...
Thanks, and Noboru again thanks for such a great blog!
Hi Arturo, glad to hear the blog was useful.
Did you try SEGW described in section 4.c?
Thanks for the speedy reply.
Yes the source and destination are set to asterisk.
I am using the Support User ID on Client 100 though. Could it be that I need to create another user with other parameters?
Hmm.
Is it possible to connect from SAPGUI and Fiori from your PC now?
I’m trying to narrow down the problem.
If PC to S4HANA on Cloud connection is working, then it is a problem with ADT to S/4HANA.
“xxx:3300” seems to suggest that somehow eclipse sees “xxx” as an IP? Then perhaps Googling tells you where you can set this up for eclipse (??? very hypothetical).
If PC is not connected to Cloud then, perhap the IP changes dynamically (because it is not set up as static). If this is the case, then you’d need to change the host file in your local PC.
Yes I'll google around and if I find the solution to the problem I will definitely come back and share.
I set the IP as static and I can log in from GUI and Fiori no prob.
The error message actually gives the IP address. I just typed xxx because I didn't want to share the IP with the world 🙂
If I find anything I'll let everyone here know.
Thanks, Arturo. Hope you can find a solution quickly. It is indeed a weird behaviour...
Hi Noboru,
Thanks for your blog. I followed step by step. Everything is ok except the last step. I can open the Fiori app via WebIde, but not have any data. It's empty.
I created the default database and can see the data in CDS view, but not in Fiori. Pls advice!
Hi Cuong,
Hmm. A quick suggestion below. If I were you, I would try the following to see what's really happening.
So you say you can see the data in the database via... eclipse or perhaps SE16 (?).
That would mean that error is likely somewhere in the connection from your Fiori app to ABAP
Also... it's possible that you have the same issue I encountered.
Check if you have set up your Fiori app to use HTTPS to access S/4HANA.
Have a look at Step 5 above, especially this point:
4. In the config file for connection, use https; DO NOT use http, (URL=https://vhcals4hci.dummy.nodomain:44301) to connect to your S/4HANA system. If you used http (like I did initially), you will be unable to test your Fiori apps. I had many CSRF token problems, and $batch operations do not work because it uses the POST method of HTTP protocol
Thanks for this blog!
Unfortunately, I am stuck at step 4.c - maybe you could give me some ideas what to check?
So, I can connect to my S/4 system via SAP logon, but from HANA Studio when creating a new ABAP project and selecting the existing SAP Logon entry (with my valid user login credentials), it fails "Logon to system TD1 failed (partner '3.111.222.333:3301' not reached)"
I did make the changes as you showed in SMGW, so that should not be an issue.
I am also not able to ping the IP address in the SAP Logon entry, which is strange given I can connect to it via SAP logon.
What am I missing? Any insight is welcome..
Thanks 🙂
Perhaps your PC is behind a proxy server (a corporate environment)?
If so, setting up proxies for Eclipse might help.
5.2 Configure Proxy Settings, in
https://sap.github.io/cloud-s4ext/week-1/unit-5/#configure-proxy-settings
Thanks for your response. No proxy is being used actually.
From my PC, I use a remote desktop connection to an AWS hosted session in which I have:
What baffles me is why can I connect to the S/4 system through SAP Logon, but not in Eclipse (HANA Studio) when using the exact same SAP Logon connection entry?
hmm. It's strange.
So... you are using remote desktop where both ADT (eclipse) and SAP Logon reside.
I'm afraid this is beyond me.
TD1 does not seem to be an SID for the system from CAL we use, so not sure if you are using CAL.
But if you are, perhaps you can ask Joerg Wolf for help. He has this page for 1809 fully activated appliance. He has one for each release.
https://blogs.sap.com/2018/12/12/sap-s4hana-1809-fully-activated-appliance-known-issues/comment-page-1/#comment-452159
You might need to do some configuration in ABAP Server.
This documentation is for 1809; it might be useful:
ABAP Back-end for ABAP Development Tools
Thanks, I went through the preparations in the SAP S/4 system as outlined in the doc., but still no connection possible.
What I find strange is, even using the SAP Logon entry from my laptop, NOT connected through the given remote desktop connection, I can still access the S/4 system.
What is the SAP Logon having that Eclipse does not?..that sees the SAP system immediately...
Indeed a strange behaviour!
This page may give you a hint:
https://answers.sap.com/questions/396215/cannot-connect-to-sap-bw-via-eclipse-sap-gui-works.html
This is for BW, not S/4HANA; nonetheless, the issue looks very similar to yours, and it lists how you might get more information via a communication log...
- Create a customer incident for component BC-DWB-AIE
- In eclipse open the view "Communication Log" and press the button "Start logging"
- Try to logon as you did before (causing "Failed to load discovery")
- Choose menu "Help" -> "Collect Support Information"
- On the dialog expand "Additional Data" and check "Communication Log"
- Finish the dialog and the support file export
- Add the support.zip file to the customer incident
- (Optional) Stop and clear the communication log
Thanks so much for the information, I will have a look 🙂