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 a listing of 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 continuously running VM (see Yandex Compute Cloud pricing).
- A fee for using a dynamic or a static public IP (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 select Virtual machine. - In the Name field, enter the VM name:
vhcalnplci
. This host name is used in the install script. - Select an availability zone
ru-central1-a
. - Under Image/boot disk selection, click the Cloud Marketplace tab and then Show more. In the window that opens, select the SLES for SAP 15 SP2 image.
- Under Disks select
SSD
as your boot disk type and specify 40 GB of disk size. - Click Add disk to add another disk.
- Enter a name for the disk.
- Select
HDD
as type. - Specify a size of 90 GB.
- Click Add.
- Under Computing resources:
- Select the platform: Intel Ice Lake.
- Specify the number of vCPUs and the amount of RAM:
- vCPU: 2.
- Guaranteed vCPU share: 100%
- RAM: 8 GB.
- Under Network settings:
-
Enter a subnet ID or select a cloud network from the list.
If you don't have a network, click Create network to create one:
- In the window that opens, enter the network name and specify the folder to host the network.
- You can select Create subnets to create subnets automatically.
- Click Create.
Each network must have at least one subnet. If there is no subnet, create one by selecting Add subnet.
-
In the Public IP field, select the Auto method for assigning an IP address.
-
- Under Access, specify the information required to access the instance:
- Enter the username in the Login field.
- In the SSH key field, enter the public part of your SSH key. You can create an SSH key pair to connect to the VM by following this guide.
- 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 disk.vdb
: 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 launching
fdisk
returns thecommand not found
error, addfdisk
toPath
:PATH=/sbin:$PATH
-
To add your first partition, press
n
followed by Enter. -
To select
primary
, which is the default type, press Enter. -
To select default number
1
, press Enter. -
To select first default sector
2048
, press Enter. -
Specify size as
+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, press
w
followed by 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 your
vdb1
andvdb2
partitions with theext4
file system: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
/etc/fstab
: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 highlight 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 that 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 have to 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 the private IP 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
-
Change 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
SAP ABAP AS Part License
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
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:
- Using the SAP Easy Access interface, run transaction
SU01
. - Go to the
Logon Data
section. - Select the user you would like to edit.
- Enter a new password.
- Using the SAP Easy Access interface, run transaction
Update license
To continue using SAP, you need to update your license:
- Using the SAP Easy Access interface, run transaction
SLICENSE
. - Copy the value in the
Active Hardware Key
field. - Open the SAP license key page
. - Select
NPL — SAP NetWeaver 7.x (Sybase ASE)
. - Specify the form of address. Enter your name, last name, email, and the previously copied
Active Hardware Key
value. - 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
. -
Call your 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.