Виртуальная машина sap abap
Введение в ABAP
Так как статей об ABAP’е на хабре совсем мало, а статьи вида «Hello, World!» совсем нету, решил немного написать об этом. Если вам интересно узнать про этот язык или же подумываете заниматься разработкой на ABAP’е, то добро пожаловать под кат.
ABAP (Advanced Business Application Programming) – внутренний язык высокого уровня программирования в среде SAP. Углубляться в историю особенно не хочется, но отмечу лишь, что язык синтаксис языка наиболее близок к языку программирования COBOL.
Язык позволяет работать с внутренними структурами данных, интерфейсами пользователя, транзакциями, отчётами, интерфейсами загрузки, выгрузки данных (word, excel, pdf, …); стоит отметить, что можно использовать объектно-ориентированные конструкции (ABAP Objects); существует множество технологий связи с другими системами (BAPI, RFC, …) для выгрузки и загрузки данных (или же сторонней обработки).
Типизация
Переменные в ABAP обычно объявляются с помощью конструкции DATA.
Хочется обратить внимание, что операторы в коде начинаются с зарезервированных слов и заканчиваются точкой.
Можно сокращать объявление нескольких переменных через запятую и используя символ двоеточия:
Внутри программы можно использовать типы, заложенные в ABAP-словаре, а так же создавать собственные типы и структуры, используя конструкцию TYPES.
Пример со структурой:
В динамическом программировании принято использовать поля типа FIELD SYMBOLS (аналог указателя):
Таблицы можно объявлять как из словаря ABAP, так же и из своих внутренних типов структур:
Среда разработки
ABAP имеет свою собственную среду разработки, которая называется ABAP Workbench, имеющую отладчик, средства трассировки, систему контроля версий, средства работы с буфером, журналы использования, и так далее.
В 2012 году разработчики интегрировали ABAP со всем известной IDE Eclipse. Правда работает это на последних версиях ядра, что есть не на всех проектах.
Предисловие перед «Hello, World»
На самом деле не хочу, чтобы статья была длинной. Вкратце напишу, что ABAP поддерживает работу со всеми арифметическими, строковыми операциями, имеет стандартный набор операторов условий, циклов, обработку исключений, имеет множество технологиями отчетности, поддерживает работу с базой данных (OPEN SQL) и так далее.
В абапе существуют подпрограммы, функциональные модули, макросы, работа с вебом (Web Dynpro, BSP), выгрузка данных в word, excel (посредством OLE), пользовательские интерфейсы, диалоги и так далее. Существует даже несколько сертификаций разработчиков. Об этом всем постараюсь рассказать в следующих постах.
Hello, World!
Итак, если же вам посчастливилось получить доступ к системе разработки SAP или же вы нашли виртуальную машину, на всем любимом русском трекере по запросу «mini sap on vmware (abap)», то дальше я покажу как создать свою программу.
Первым делом заходим в систему SAP (через SAP GUI):
Далее в окошке вводим транзакцию se38:
В соответствии с именованием пользовательский программ (начиная с Z), вводим название своей программы:
и нажимаем кнопку создать. Далее вводим заголовок программы, выбираем тип и нажимаем сохранить.
Далее мы попадаем в окно ABAP-редактора. Вводим код нашей программы:
Активируем программу:
И запускаем:
Результат:
Заключение
В этой статье я написал немного про ABAP, его синтаксис ну и, конечно же, программку Hello, World!
В следующих статьях планирую описать арифметические, строковые операции, работу с базой данных и познакомить с построением отчетности в ABAP с конкретными примерами и мануалами. Ну, а дальше как пойдет.
Innovators at Heart
Information Technology
SAP NW AS ABAP and BW 7.50 SP02 : Virtual Machine
Recently was released the SAP NetWeaver AS ABAP and SAP BW 7.50 SP02 on Sybase ASE
16.0 [Developer Edition], and this edition include:
Open HANASAPCCLAR with virtual box (Maquina / agregar).
Select HANASAPCCLAR.vbox from your system where the virtual machine was extracted.
Start the virtual machine.
Select Boot from hard Disk.
Select openSUSE Leap 42.1. The system should get in without insert user and password. The default user is SAPCCLAR and the password is sap.cc.lar (just in case that is required).
Click on Activities and find xTerm.
Change the user to npladm (SAP system administrator)
pwd: sap.cc.lar
Start the SAP Server. Use the command: startsap ALL (to stop the SAP Server use the command: stopsap).
If the server is running you should see the message: Instance on host vhcalnplci started.
To start the SAPGUI get in the folder: cd /opt/SAPClients/SASPGUI7.40rev8/bin and execute the command: ./guilogon
Connect to NPL system.
If you get the Connection failed Error, close the SAPGUI and stop the SAP Server (command: stopsap). After that, Start the SAP Server again and the SAPGUI too. Try to connect to NPL again.
Connect to NPL
client: 001
user: DEVELOPER
pwd: Appl1ance
The system is working fine.
To open eclipse IDE go to Activities and click on Files.
Open the folder / Home / Desktop / eclipse / and Execute eclipse. Use the workspace: /home/sapcclar/Desktop/eclipse_workspace.
If the system show the message Eclipse is not responding, select Wait.
If the eclipse is running open the ABAP perspective.
To connect to NPL system. From Project Explorer view double click on NPL_001_developer_en project and set the parameters:
Cliente:001
User: DEVELOPER
pwd: Appl1ance
To execute a program open: Favorite / ZTEST package / Source Code / Programs
Double click on: ZHELLOHANA and press F8 to run. (other option is, right click in source windows / Run As / ABAP Application).
The program is working fine. Your SAP NW AS ABAP and BW 7.50 SP02 – Virtual Machine is ready.
Install ABAP Platform Developer Edition 1909 using VM and SUSE
This post is a guide to install “ABAP Platform Developer Edition 1909” from a VMWare virtual machine and using the LINUX SUSE distribution.
Requirements
System
Tools
Environment preparation
Preparing the virtual machine
We access the VMWare program and go to the option “Create a new virtual machine”
We select the Linux image that we have downloaded, in my case SUSE
Add name to the virtual machine (free choice)
150 GB of free disk is recommended for installation, so we can 160BG to give something to the operating system
In the next step, click on the “Customize Hardware” option to modify the specifications of the machine, these will be the parameters:
Finally we press “Finish” to start the installation.
Installing SUSE
Once the configuration is finished, the SUSE installation will start automatically, the first screen that will appear we will press “Installation”:
We accept the license and configure the keyboard language:
When pressing “Next” it will ask us if we want to additionally install YaST2, we will mark “yes”:
The next step is the configuration of online repositories, in this we will mark the following options and click on next:
When the next step appears we select the option: “Desktop with GNOME”
We are pressing “Next” until the following screen appears
Click on “Guided Setup”, and add these settings:
After pressing Next we will return to the “Suggested partitions” screen and we will press Next, we configure the location:
Next step configure our user, we add our name, the user name that we want, and a password:
In the step “Installation Settings” we have to look at these options:
Click “Install” to start the installation, again we need some patience to finish the installation:
Setup Linux
We are going to configure the IP to have a fixed reference. To do this, we go to network settings:
Click on options in the active connection:
We add the manual method in the IPv4 option, adding this data, or similar ones according to your local network configuration. This will allow us to always use the same IP. Make sure that this IP is not assigned to another device connected to your router
We are going to configure the localhost files, for this we execute the following commands:
Where we add the name: vhcala4hci and press Ctrl + O to save and Ctrl + X to exit the editor.
And this second command:
We will add the following entry:
With the IP that we have configured by default and press Ctrl + O to save and Ctrl + X to exit the editor.
Installing Docker
To install Docker it is as easy as running the following commands:
And we can start the service with:
If we also want Docker to start when starting the virtual machine, we can execute:
As you can see, we have everything ready to install our S4Hana developer edition
Downloading the Docker image
The first thing is to login to the docker server, this is because the image that we are going to use is not available in public mode, but we can only download it in private mode at € 0.0.
We can proceed with the download with the command:
Once finished we will see the following message:
Before starting the container, we will add some extra configurations, executing:
We will see how the services are activated. Finally we will see this message indicating that we can now use our new SAP.
Accessing SAP
These are the data, remember that the IP will depend on the configuration made according to your IP:
And we can now access. The user to access is: DEVELOPER with password Ldtf5432
Assigned Tags
Thank you for the tutorial.
The technical prerequisites became high compared to the previous version of the developer platform.
Indeed, the beauty of the current HANA1909 image is the fact that you can install it directly on Windows with Docker Desktop and WSL2 or on Linux with the docker CLI and it will just work.
Hi Eric, VMaware is free?
Thank you for the aclaration
Thank you in advance
I´ve found a solution
[Part 1] – Installing SAP NetWeaver AS ABAP Developer Edition 7.52 SP01 on VirtualBox (Ubuntu 16.04)
if you are here because you want to know more about how to install the SAP ABAP Application Server (trial) you’ve came right place, but before we start let me briefly explain how this blog series works.
Hello, how are you? Welcome to the first part of “The Dev Hero, a journey in the digital transformation”. In this blog series I intent to demonstrate some vary technologies available in nowadays by putting some inputs about, recommendations, and (maybe the most exciting) how to connect several SAP and non-SAP applications in a single architecture.
What will be covered in this first part?
In this first part, I’ll explain how to configure a Virtualbox machine by configuring Ubuntu 16.04 (also works on release 18.04) as operational system in order to run a SAP NetWeaver AS ABAP Developer Edition 7.52 SP01 trial instance. Sizing, system requirements and installation procedures will be covered along this post, and at the end you will be able to create programs and to expose services directly from you personal computer.
Don’t be afraid if you’re not comfortable in using Linux, or didn’t have enogh experience so far, this tutorial was written for those who never had any contact with a unix based system before. Step-by-step guides will provide you a well explained context of each functionality. So let’s get started!
Glossary
1. Components available in SAPNW752 trial version for your software development project
This SAP NetWeaver 752 SP01 version comes with a variety of components designed for software development, such as:
Component offers a tool for development and generation of OData services to a variety of client development tools. Through OData, it’s possible to establish a connection between application or SAP Business Suite data and target clients, platforms, and programming framework. See more in SAP Gateway Foundation (SAP_GWFND)
User Interface Technology (SAP_UI) is a software component available within SAP NetWeaver. The SAP_UI component comes as part of the following software component. See more in Software Component SAP_UI
2. Downloading software dependencies
2.1 Virtualbox
2.1.1 Known issues and how to fix
Sometimes when initialising a virtual machine you might experience errors that prevent its start. Honestly, I’ve faced those errors only when working with Windows, and my tests with Macbook the installation worked really well. So here are errors you may find:
The most possible causes related to the this error are:
2.2 SAP NetWeaver AS ABAP Developer Edition 7.52 SP01 trial version
2.2.1 Installation guide (README.html) and files extraction
The installation guide – or the named README.html, may be found in root folder of SAPNW752. Start Extraction from TD752SP01.part01.rar file, and let the unzip, 7zip (best option), winrar, unrar, (whatever zip/unzip application), work until it extracts the last file.
Installation guide shows the main system requirements, installation procedures, and users available for both database and sap gui.
2.3 Ubuntu 16.04 64-bit PC (AMD64) desktop image
3. Virtualbox instance configuration
Let’s start by creating a new machine on Virtualbox. To do that, choose Machine on Virtualbox menu bar and select option New..
3.1 – Hardware requirements (sizing)
We should strictly follow system requirements before proceeding. Julie Plummer details the system requirements on its blog AS ABAP 752 SP01 Developer Edition to Download
Click on Create
3.2 – Creating a virtual disk
Click on Create
3.3 – Start the virtualbox machine
After complete steps above, the instance sap752 should now appear in the your instances list view.
Click on the instance and choose Start . A popup should appear prompting for a start-up disk containing Ubuntu operation system installation. Click on
, and search for the ubuntu-16.04.5-desktop-amd64.iso previously downloaded on Downloads section.
The Ubuntu installation should start now. During the installation will be asked for Language, Country and Keyboard layout, so choose the more appropriate option for you in each. Be aware in “Who are you?” screen to not forget to set the hostname as vhcalnplci. Otherwise, SAPNW752 installation might potentially fail. (I’ve never succeed when choosing a different hostname). The section 4.1 explains how to do so.
4. Ubuntu installation
Choose Install Ubuntu
Select option Download updates while installing Ubuntu, it will download and update libraries for the current Ubuntu version.
4.1 – Defining vhcalnplci as hostname
SAP Netweaver 752 SP01 installation guide strongly recommends to use vhcalnplci as hostname, and different might lead errors or make server not pingable after its restart. To do that, fill the “Who are you” screen accordingly:
4.2 – Ubuntu installation, Done!
When installation finish, will be prompted to reboot the system. Just reboot and log on by using your user credentials (same created on installation time). Notice that superuser permissions was granted to your user, being able to manage the operational system entirely.
5. Ubuntu configuration and update
Click on the top left icon located in the toolbar, and search for Terminal. It is time for some upgrades before starting SAP NW 75 installation.
In case of the terminal open with a different user than defined on installation time, you have to reboot the ubuntu system. It happens because the installation haven’t finished yet.
Now it is time to upgrade your ubuntu accordingly in order to receive SAP NW 752 properly. As long we are using Ubuntu 16.04 (xenial), The full package list may be find on https://packages.ubuntu.com/xenial/
Bear in mind that administrator privileges are need when installing any unix package. In case of “Permission denied” error after executing statements, use sudo to fix it.
E.g.: sudo apt-get update
Each statement below is followed by small explanation.
The statement apt-get update checks for new package versions available. It will download the information. You can see that there are download information with the ‘get’ line in the screenshot above. (Source https://itsfoss.com/apt-get-linux-guide)
sudo apt-get upgrade
The command apt-get upgrade is very obedient, and never tries to remove any packages or install a new package on its own. (Source https://itsfoss.com/apt-get-linux-guide). Reboot system after packages upgrade
sudo reboot now
enabling/checking/disabling the ubuntu firewall (ufw)
Before proceeding, check for the current firewall status.
In order to disabled it, use statement below. Take in account firewall will not be enable again until you manually enable.
Now its time to create a shared folder (or a bridge – as you prefer), between your computer (host) and the virtual machine. We’re going to mount a directory that contains installation files by using Hypervisor capabilities.
The hypervisor itself separates the computer’s operating system and applications from the underlying physical hardware.
Before mounting directories, make sure you’ve unpacked the installation files. Unpacking large files in this type of virtual machine might lead errors, and non extraction of all files properly. The strategy used in this tutorial, is to extract files on host system.
On Virtualbox, go to Devices > Insert Guest Additions CD images…
The superuser credential will be prompt just after clicking Run.
Point the folder to be shared:
Folder path | host folder containing SAPNW752 extracted installation files |
Auto-mount | true |
Mount point | Shared folder on Ubuntu side. E.g: /var/www |
Make Permanent | true (Keep folder sharing enabled, even when the virtual machine is shut down, suspended, or powered off) |
Back in ubuntu console, add the user (that one created previously during ubuntu installation) to the newly group vboxsf. This user-group is responsible in managing mounted directories created by using HyperVision.
As we’ve copied all files into the /var/www directory, now it’s necessary to move those to an internal ubuntu directory (a non shared one). The idea behind is that /var/www is a shared folder, being not able to be used to handle SAPNW752 and leading errors during it install.
sudo apt-get install gcc perl csh libaio1 libc6 libstdc++6
Missing packages errors might happen during installation, and the log error will display which package is missing. Package csh contains shell with C-like syntax.
After installation finished, reboot your system and changes will have effect. Other errors like “failed to start” might happen, for those I strongly recommend you to check sites below:
edit the /etc/hosts file
Edit current hosts file by adjusting the loopback accordingly to the localhost (comment out line 127.0.1.1 vhcalnplci), and adding the mapping of hostname for FQDN vhcalnplci.dummy.nodomain
Restart ubuntu after /etc/hosts changes.
6. SAP Netweaver AS ABAP trial installation
Still at the command line, go to /srv/www and execute statement sudo install.sh to start installation. In case of skipping any previous step by mistaken missing dependencies will be shown, and it will be asked for its install. Just type “yes” and hit enter to continue.
Also, you will have to accept license terms, so just type “yes” to continue.
Then you should specify a password for the newly OS users.
sapadm | Created by SAP Hostagent, you can manually assign a password |
npladm | SAP System Administrator |
sybnpl | SAP Database Administrator |
FINALLY, installation process will start! Installation might takes around 20 minutes (or more) depending of a few hardware factors. Grab another coffee, wait, take your time for relax. ☕
if you reach this point, WELL DONE!
6.2 Start SAP server
Start the SAP system in ubuntu console:
6.3 Configuring network (NAT)
In the virtualbox, click on Settings of your virtual machine.
When the Settings pop up, click on Network > Advanced > Port Fowarding
Add the following ports
6.4 Adding a new entry in SAPGUI
Open SAPGUI, and add a new entry on it.