Creating an SAP program in Yandex Cloud
You will learn to configure an SAP server and write your first program exporting a list of system users in tabular format.
To create an SAP program in Yandex Cloud:
- Get your cloud ready.
- Create an SAP VM.
- Set up your VM file system.
- Configure SAP installation.
- Install SAP.
- Configure SAP.
- Make sure the program runs correctly.
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 a dynamic or static public IP address (see Yandex Virtual Private Cloud pricing).
Create an SAP VM
Create a VM and give it a public IP address:
-
On the folder dashboard 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 where your VM will get connected. If the selected network has no subnets or there are no networks in the list, create them as required.
- Under Public IP address, leave
Auto
to assign your VM a random external IP address from the Yandex Cloud pool or, if you reserved a static IP address, select it from the list.
-
Under Access, select SSH key and specify your VM access credentials:
- Under Login, specify a username. Do not use
root
or other reserved usernames. To run commands requiring root privileges, 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, specify a username. Do not use
-
Under General information, specify the VM name:
vhcalnplci
that will be used in the SAP installation script. -
Click Create VM.
Set up your VM file system
Create a file system structure for SAP installation.
-
Switch to the
root
account:sudo su
-
List all available 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: 20 GB for the installation files and 70 GB for the SAP application server.
-
Run
fdisk
to manage partitions:fdisk /dev/vdb
If you get
command not found
, addfdisk
toPath
:PATH=/sbin:$PATH
-
To create a new partition, type
n
and press Enter. -
Press Enter to select the
primary
partition type. -
Press Enter to accept the default partition number:
1
. -
Press Enter to accept the default first sector:
2048
. -
Type
+20G
to set the partition size and press Enter. -
Repeat these steps to add another partition. On the last step, do not type anything and press Enter. The partition will use the remaining available space: 70 GB.
-
Type
w
and press Enter to save the changes.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.
-
List all available disks:
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
-
-
Create an
ext4
file system onvdb1
andvdb2
partitions: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 installation files and the SAP application server and mount them to
vdb1
andvdb2
partitions, respectively: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 SAP installation
Copy the installation files to your VM and configure SAP installation.
-
Download 11 SAP NetWeaver AS ABAP Developer Edition 7.52 SP04
archives on your computer and unpack them. -
Save your current VM
PuTTY
session under any name you want. -
Install and run WinSCP
. -
Import the saved PuTTY session into
WinSCP
.- In the
Login
window, click Tools. - Select Import Sites.
- In the
Import from
field, select PuTTY and then select the previously saved session.
- In the
-
Connect to your VM via
WinSCP
.- Select the session imported from
PuTTY
. - Click Login.
- Enter your VM username.
- Select the session imported from
-
Import SAP installation files to your VM
/distr
folder.- In the left-hand window, open the folder where you unpacked SAP files.
- Select all files and click Upload.
- Set
/distr/*.*
as the import destination.
To import files, you should be the
/distr
folder owner. Alternatively, you should connect with root privileges or configure the use of sudo upon logging in . -
Install and run the UUIDD: UUID
(universally unique identifiers) daemon required for SAP to work:zypper install uuidd service uuidd start
-
Check for the
libaio
andlibaio1
packages:rpm -qa | grep libaio rpm -qa | grep libaio1
The command output will display the distribution package versions.
-
Get your VM internal IP address:
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 your VM internal IP address to
/etc/hosts
.-
Open the file:
vi /etc/hosts
-
Add the following line:
<inet> vhcalnplci vhcalnplci.ru-central1.internal.
Where
inet
is an IP address following theinet
parameter in theeth0
section of the previous command output.Result:
127.0.0.1 localhost 10.0.0.29 vhcalnplci vhcalnplci.ru-central1.internal
-
-
Check the host name:
hostname
Result:
vhcalnplci
Install SAP
-
Change the permissions for the SAP installation folder.
chmod -R 777 /distr
-
Navigate to
/distr
:cd /distr
-
Run the SAP installation script:
./install.sh
-
Accept the license agreement terms.
-
Set a master password for standard SAP users.
Password requirements:
- At least 7 Latin characters.
- Contains uppercase and lowercase letters and numbers.
- No special characters.
-
Wait for the installation to complete.
The installation may fail with 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
This error is caused by an expired license. To resolve this problem:
- Download
SAP ABAP AS Part License
for SAP NetWeaver AS ABAP Developer Edition 7.52 SP04 from the official website . - Unpack and copy the license file to your VM’s
server/TAR/x86_64/
directory via WinSCP. - Run
./install.sh
again.
- Download
Start and configure SAP
-
Install the SAP logon client
on your computer. -
Run SAP logon and configure a connection to your VM:
- Application Server: Your VM public IP address
- Instance number:
00
- System ID:
NPL
Once you log on to SAP, you will see the SAP Easy Access
menu on the left. This is a custom user menu containing the items you will need for daily tasks.To configure SAP, you can use transaction codes
linked to the SAP system functions. Enter these codes in the SAP command line or add them to bookmarks for quick access. -
Change the default passwords to ensure optimal security:
- From SAP Easy Access, run
SU01
. - Navigate to
Logon Data
. - Select the user you want to modify.
- Specify a new password.
- From SAP Easy Access, run
Update your license
To continue using SAP, you need to update your license:
- From SAP Easy Access, run
SLICENSE
. - Copy the
Active Hardware Key
. - Open the SAP license key page
. - Select
NPL — SAP NetWeaver 7.x (Sybase ASE)
. - Specify the salutation, your first and last names, email address, and the
Active Hardware Key
you copied earlier. - Accept the license agreement terms and download the
NPL.tx
license file. - Copy the license file to your VM and upload it to
SLICENSE
.
Create your first program
To test whether your system works properly, create a simple program exporting a user list.
-
Log in as
DEVELOPER
. -
Run
SE38
(ABAP Editor
). -
Name your program as
ZTEST
. -
Add program 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.
- If you reserved a static public IP address for this project, delete it.