Creating an SAP program in Yandex Cloud
You will learn to configure a server with an installed SAP environment and write your first program. It will export existing system users in tabular format.
To create an SAP program in Yandex Cloud:
- Prepare your cloud.
- Create a VM for SAP.
- Set up the VM file system.
- Set up an install configuration.
- Install SAP.
- Configure SAP.
- Check that the program runs as expected.
If you no longer need the resources you created, delete them.
Getting started
Sign up for Yandex Cloud and create a billing account:
- Go to the management console
and log in to Yandex Cloud or create an account if you do not have one yet. - On the Yandex Cloud Billing
page, make sure you have a billing account linked and it has theACTIVE
orTRIAL_ACTIVE
status. If you do not have a billing account, create one.
If you have an active billing account, you can go to the cloud page
Learn more about clouds and folders.
Required paid resources
The cost of an SAP installation includes:
- Fee for a continuously running VM (see Yandex Compute Cloud pricing).
- Fee for using a dynamic or static public IP address (see Yandex Virtual Private Cloud pricing).
Create a VM for SAP
Create a VM with a public IP address:
-
On the folder page in the management console
, click Create resource and selectVirtual machine instance
. -
Under Boot disk image, select the SLES for SAP 15 SP2 image.
-
Under Location, select the
ru-central1-d
availability zone. -
Under Disks and file storages:
-
Under Computing resources, navigate to the
Custom
tab and specify the required platform, number of vCPUs, and the amount of RAM:- Platform:
Intel Ice Lake
. - vCPU:
2
. - Guaranteed vCPU performance:
100%
. - RAM:
8 GB
.
- Platform:
-
Under Network settings:
- In the Subnet field, select the network and subnet to connect your VM to. If the required network or subnet is not listed, create it.
- Under Public IP, keep
Auto
to assign your VM a random external IP address from the Yandex Cloud pool or select a static address from the list if you reserved one in advance.
-
Under Access, select SSH key and specify the access credentials for the VM:
- Under Login, enter the username. Do not use
root
or other names reserved by the OS. To perform operations requiring superuser permissions, use thesudo
command. -
In the SSH key field, select the SSH key saved in your organization user profile.
If there are no saved SSH keys in your profile, or you want to add a new key:
- Click Add key.
- Enter a name for the SSH key.
- Upload or paste the contents of the public key file. You need to create a key pair for the SSH connection to a VM yourself.
- Click Add.
The SSH key will be added to your organization user profile.
If users cannot add SSH keys to their profiles in the organization, the added public SSH key will only be saved to the user profile of the VM being created.
- Under Login, enter the username. Do not use
-
Under General information, specify the VM name:
vhcalnplci
. This host name is used in the install script. -
Click Create VM.
Set up the VM file system
Set up the created VM's file structure for the SAP install.
-
Use SSH to connect to the created VM via PuTTY
. -
Switch to root to get superuser privileges:
sudo su
-
Review a list of all the disks:
lsblk
Result:
vda 254:0 0 40G 0 disk ├─vda1 254:1 0 4M 0 part └─vda2 254:2 0 40G 0 part / vdb 254:16 0 90G 0 disk
Where:
vda
: Boot diskvdb
: Data disk
-
Create two partitions on the data disk (
vdb
): 20 GB for the distribution and 70 GB for SAP.-
To manage hard drive partitions, run the
fdisk
utility:fdisk /dev/vdb
If you get the
command not found
error when launchingfdisk
, addfdisk
toPath
:PATH=/sbin:$PATH
-
To add your first partition, type the
n
command and press Enter. -
To select
primary
for default type, press Enter. -
To select
1
for default number, press Enter. -
To select
2048
for first default sector, press Enter. -
Set the size to
+20G
and press Enter. -
Repeat these steps to add another partition. Do not specify partition size in the last step. It will use the remaining 70 GB of disk space by default.
-
To save the partitions you created, type the
w
command and press Enter.Result:
Welcome to fdisk (util-linux 2.33.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table. Created a new DOS disklabel with disk identifier 0xb58ce40a. Command (m for help): n Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p): Using default response p. Partition number (1-4, default 1): First sector (2048-182452223, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-182452223, default 182452223): +20G Created a new partition 1 of type 'Linux' and of size 20 GiB. Command (m for help): n Partition type p primary (1 primary, 0 extended, 3 free) e extended (container for logical partitions) Select (default p): Using default response p. Partition number (2-4, default 2): First sector (41945088-182452223, default 41945088): Last sector, +/-sectors or +/-size{K,M,G,T,P} (41945088-182452223, default 182452223): Created a new partition 2 of type 'Linux' and of size 70 GiB. Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks.
-
Check the disk structure:
lsblk
Result:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT vda 254:0 0 40G 0 disk ├─vda1 254:1 0 4M 0 part └─vda2 254:2 0 40G 0 part / vdb 254:16 0 90G 0 disk ├─vdb1 254:17 0 20G 0 part └─vdb2 254:18 0 70G 0 part
-
-
Configure the
ext4
file system on partitionsvdb1
andvdb2
:mkfs.ext4 /dev/vdb1 mkfs.ext4 /dev/vdb2
Result:
mke2fs 1.43.8 (1-Jan-2018) Creating filesystem with 5242880 4k blocks and 1310720 inodes Filesystem UUID: e878b21b-da84-42f9-ba9f-b6ad3c6edab6 Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000 Allocating group tables: done Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done ... mke2fs 1.43.8 (1-Jan-2018) Creating filesystem with 17563392 4k blocks and 4390912 inodes Filesystem UUID: 14be2468-6a99-4178-a77b-26096c3fcad4 Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424 Allocating group tables: done Writing inode tables: done Creating journal (131072 blocks): done Writing superblocks and filesystem accounting information: done
-
Create directories for the distribution and the SAP application server. Mount these to partitions
vdb1
andvdb2
:mkdir /usr/sap mkdir /distr mount /dev/vdb1 /distr mount /dev/vdb2 /usr/sap
-
For automatic remounting after reboot, edit the
/etc/fstab
file:vi /etc/fstab
Make it look like this:
LABEL=ROOT / xfs defaults 0 1 /dev/vdb1 /distr ext4 defaults 1 1 /dev/vdb2 /usr/sap ext4 defaults 1 1
Configure install
Add the SAP installation files to your VM and configure the upcoming installation.
-
Download the 11 archives with the SAP NetWeaver AS ABAP Developer Edition 7.52 SP04
installation files and unpack their contents to a local folder. -
Save the current VM connection session in PuTTY. You can use any name.
-
Install and run WinSCP
. -
Import the saved PuTTY session settings into WinSCP.
- In the
Login
window, click Tools. - Select Import Sites.
- In the
Import from
field, select PuTTY and select the previously saved session.
- In the
-
Connect to the VM via WinSCP.
- Select the session imported from PuTTY.
- Click Login.
- Enter the VM username.
-
Import the SAP installation files you unpacked from the previously downloaded archives into the
/distr
folder on the VM.- In the left-hand window, open the folder with the unpacked SAP files.
- Highlight the files and click Upload.
- Set
/distr/*.*
as the import location on the VM.
To be able to import the files, you must be the owner of the
/distr
folder. The other option is to connect via WinSCP as a user with root access or configure the use of sudo when logging onto the system . -
On the VM, install and run UUIDD. This is the UUIDD
(universally unique identifiers) daemon. It is required for SAP to run:zypper install uuidd service uuidd start
-
Check for the
libaio
andlibaio1
libraries:rpm -qa | grep libaio rpm -qa | grep libaio1
The response will display the library versions built into the distribution.
-
Find out the VM's private IP:
ip addr show
Result:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether d0:0d:11:31:ee:a6 brd ff:ff:ff:ff:ff:ff inet 10.0.0.29/24 brd 10.0.0.255 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::d20d:11ff:fe31:eea6/64 scope link valid_lft forever preferred_lft forever
-
Add private IP address to
/etc/hosts
.-
Open the file:
vi /etc/hosts
-
Add a line to it as below:
<inet> vhcalnplci vhcalnplci.ru-central1.internal.
Use an
inet
value from theeth0
block.Result:
127.0.0.1 localhost 10.0.0.29 vhcalnplci vhcalnplci.ru-central1.internal
-
-
Check the host name:
hostname
Result:
vhcalnplci
Install SAP
-
Modify the permissions to the folder containing the SAP install files.
chmod -R 777 /distr
-
Go to
/distr
:cd /distr
-
Run the SAP install script:
./install.sh
-
Accept the terms of the license agreement.
-
Set a master password for the users to be created during the SAP install.
Password requirements:
- At least 7 English characters.
- Contains capital letters and numbers.
- No special characters.
-
Wait for the installation to complete.
The install may produce the following error message:
Abort execution because of Step returns modlib.jslib.caughtException Error: sapinst has finished with an error code, please find logs in /tmp/sapinst_instdir Error code: 20
The error is related to an expired license. To resolve:
- Download the
SAP ABAP AS Part License
file for SAP NetWeaver AS ABAP Developer Edition 7.52 SP04 from the official website . - Unpack and copy it to the
server/TAR/x86_64/
directory on the VM. You can do this using WinSCP. - Run
./install.sh
again to install SAP.
- Download the
Run and configure SAP
-
Install the SAP Logon
front-end client on your computer. -
Run SAP Logon and configure a connection to the VM:
- Application Server: Public IPv4 address
- Instance number:
00
- System ID:
NPL
Once you log on to SAP, you will see the SAP Easy Access
user menu on the left-hand side of your screen. This is a user-specific entry point. The user menu only contains those elements that you require for daily tasks.You perform SAP configuration via transaction codes
. These are related to SAP system functionality. Transaction codes must be input through the SAP command line . For quick access, you can add these to your bookmarks . -
Change the default passwords for security:
- Use the SAP Easy Access interface to run transaction
SU01
. - Go to
Logon Data
. - Select the user you would like to edit.
- Enter a new password.
- Use the SAP Easy Access interface to run transaction
Update license
To continue using SAP, you need to update your license:
- Use the SAP Easy Access interface to run transaction
SLICENSE
. - Copy the
Active Hardware Key
field value. - Open the SAP license key page
. - Select
NPL — SAP NetWeaver 7.x (Sybase ASE)
. - Specify the form of address. Enter the name, last name, email, and the
Active Hardware Key
value you copied earlier. - Accept the terms of the license agreement and download the license file called
NPL.tx
. - Move the downloaded license file to the VM and add it to the
SLICENSE
transaction.
Create your first program
To verify system functionality, create a simple program to export the user list.
-
Log in as
DEVELOPER
. -
Run the
SE38
transaction. It is theABAP Editor
program. -
Name the program:
ZTEST
. -
Add a code:
TYPE-POOLS: slis. *&---------------------------------------------------------------------* *& Data Declaration *&---------------------------------------------------------------------* DATA: it_usr01 TYPE TABLE OF USR01. DATA: it_fieldcat TYPE slis_t_fieldcat_alv, wa_fieldcat TYPE slis_fieldcat_alv.` *&---------------------------------------------------------------------* *& START-OF-SELECTION` *&---------------------------------------------------------------------* START-OF-SELECTION. *Fetch data from the database SELECT * FROM USR01 INTO TABLE it_usr01. *Build field catalog wa_fieldcat-fieldname = 'MANDT'. wa_fieldcat-seltext_m = 'MANDT'. APPEND wa_fieldcat TO it_fieldcat. wa_fieldcat-fieldname = 'BNAME'. wa_fieldcat-seltext_m = 'USER'. APPEND wa_fieldcat TO it_fieldcat. * display ALV list CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING it_fieldcat = it_fieldcat TABLES t_outtab = it_usr01 EXCEPTIONS program_error = 1 OTHERS = 2
Result:
| MANDT| USER | | -----| ----------- | | 001 | BWDEVELOPER | | 001 | DDIC | | 001 | DEVELOPER | | 001 | SAP* |
How to delete the resources you created
To stop paying for the resources you created:
- Delete the VM.
- Delete the static public IP if you reserved one specifically for this project.