Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
ameya_2023
Participant

Do you want to install a SAP system and evaluate ABAP SDK for Google Cloud in under 30 mins? Then keep reading this article.


Few days back SAP made ABAP Platform Trial 1909 SP07 available on Docker. You can read more in this blog ABAP Platform Trial 1909 Available Now. Thank you SAP for providing this!


The purpose of this article is to go through the steps to set up ABAP Platform Trial 1909 on Google Cloud Platform and install ABAP SDK for Google Cloud for evaluation.


To simplify and expedite the setup process and jumpstart our goal of evaluating the ABAP SDK, I have created scripts that are hosted in this GitHub repository. Please refer to the repository README file for detailed documentation of the scripts functionality generated by Google Bard.


The blog below will use these scripts to save your time and effort, and will help you get started ABAP Platform Trial 1909 on Google Cloud Platform quickly and easily.


Let’s begin!!!



Installing ABAP Platform Trial 1909 on Google Cloud Platform


We will use the Google cloud CLI to perform majority of the the steps.




  • Create a 90-Day Free Trial account for Google Cloud Platform.

  • Create a new Google cloud project abap-sdk-poc which will be used to execute all the below installation steps.

  • Click Activate Cloud Shell at the top of the Google Cloud console to Open Cloud Shell. We will use the Cloud Shell to run all our commands.







  • Run the below commands to authenticate for your account and set the default project to abap-sdk-poc. I am using the zone as us-west4-b. If needed, please change the zone in the below command based on your preference. These parameters will be used by the installation script.


gcloud auth login
gcloud config set project abap-sdk-poc
gcloud config set compute/zone us-west4-b

Type the below command to execute the script create_vm_withdocker.sh. The script will do the following activities:




  • Create a VM (Name: abap-trial-docker, Configuration: e2-highmem-2, OS & Disk: debian-12-bookworm, 200gb).

  • Install Docker engine latest version.

  • Pull & Start ABAP Platform Trial 1909 docker container.

  • The script will also activate the IAM Service Account Credentials Service and Address Validation Service which we use to evaluate ABAP SDK.

  • The script will also create a service account abap-sdk-dev@abap-sdk-poc.iam.gserviceaccount.com which will be used by the ABAP SDK.


wget https://raw.githubusercontent.com/google-cloud-abap/community/main/blogs/abap-trial-docker-1909/crea...
chmod 755 create_vm_with_docker.sh
./create_vm_with_docker.sh


  • Note: The script will auto agree the SAP license terms on behalf of the executor using the flag — agree-to-sap-license. (Refer to license section in the docker hub page for more details the license)

  • The VM will get created in a few minutes, but installing the SAP docker container step will take around 30 mins.

  • After the VM is created, SSH into the system using the below command.


gcloud compute ssh "abap-trial-docker"


  • The installation script will create an output file /tmp/output.txt, on which we can run the tail command to monitor.


tail -f /tmp/output.txt


  • Wait till you see the below confirmation message in the output file, that the SAP docker container is running.







  • You can also run the following command to check if the container is running.


sudo docker ps

️This completes the installation and now we can move on to the next step of connecting to the system.

Test connecting to the SAP system



  • You can now connect to the SAP system. If SAP GUI is already installed on your laptop, connect to SAP using the VM external IP address as the Application Server IP.

  • If you are on Mac then you can also install the SAP GUI for Java available in this link.

  • Run the below command to get the External IP Address of the VM or check in the Google cloud platform console.


gcloud compute instances describe abap-trial-docker  \
--format='get(networkInterfaces[0].accessConfigs[0].natIP)'

Use the following to connect from SAP GUI:




  • System ID: A4H

  • Instance Number: 00

  • Application Server: <External IP Address>






The user name is DEVELOPER with the password Htods70334. This is also predefined (same password) for client 000,client 001: SAP* , DDIC.



Activate TMS configuration and Import ABAP SDK


In order to import transports into the system, we must activate the TMS configuration.


Goto TCode STMS → Overview → Imports







Select Environment → System Overview









Select Extras > Distribute and Activate Configuration









Goto TCode STMS_IMPORT, where you should be able to see the following screen.







️Now the SAP system is ready to import any transports.



Configure Trust Certificate


These certificates are required for securely connecting to Google API’s using ABAP SDK.


Download the following certificates from the Google Trust Services repository into your desktop:




  • GTS Root R1 (PEM)

  • GTS CA 1C3 (PEM)


In the SAP GUI, use the STRUST transaction to import both the root and subordinate certificate into the SSL client SSL Client (Standard) PSE folder.


In STRUST, select the node SSL client SSL Client (Standard) and click Import certificate to upload both the files, click Add to Certificate List and Save.











Import ABAP SDK for Google Cloud


The transport files for ABAP SDK for Google cloud are available in link. To expedite we will execute the import using a script.




  • From the cloud shell, SSH into the SAP docker VM using the below command.


gcloud compute ssh "abap-trial-docker"


  • Download and execute the import transport script.


wget https://raw.githubusercontent.com/google-cloud-abap/community/main/blogs/abap-trial-docker-1909/impo...
chmod 755 import_abap_sdk.sh
./import_abap_sdk.sh


  • Once completed check for the package /GOOG/ABAP_SDK in SE80. You now have the ABAP SDK installed.




 

Run a sample scenario


Let’s write some code to call the Google Maps Platforms Address Validation API.


Step1: Configure a Client Key required for connectivity.




  • Login to SAP, goto SPRO > ABAP SDK for Google Cloud > Basic Settings > Configure Client Key and add the following new entry.

  • Note: The service account used below was pre-created by the script in the installation step. The service account id will change if you are using a different project name.



Google Cloud Key Name: DEMO_ADDRESS_VAL


Google Cloud Service Account Name: abap-sdk-dev@abap-sdk-poc.iam.gserviceaccount.com


Google Cloud Scope: https://www.googleapis.com/auth/cloud-platform


Google Cloud Project Identifier: abap-sdk-poc


Authorization Class: /GOOG/CL_AUTH_GOOGLE



Leave the other fields blank


Step2: Create a Program call Address Validation Service




  • Create a program in SE38and paste the following code, which passes the incomplete address to the API for validation. You would notice that the word ‘Mountain’ and ‘Amphitheatre’ are misspelled. Also the pin code is not provided.


DATA: ls_input TYPE /goog/cl_addrvaldn_v1=>ty_012 .

TRY.

* Open HTTP Connection
DATA(lo_client) = NEW /goog/cl_addrvaldn_v1( iv_key_name = 'DEMO_ADDRESS_VAL' ).

* Populate relevant parameters
ls_input-address-region_code = 'US'.
ls_input-address-locality = 'Montain View'.
APPEND '1600 Ampitetre Pkwy' TO ls_input-address-address_lines.


* Call API method
CALL METHOD lo_client->validate_address
EXPORTING
is_input = ls_input
IMPORTING
es_output = DATA(ls_output)
ev_ret_code = DATA(lv_ret_code)
ev_err_text = DATA(lv_err_text)
es_err_resp = DATA(ls_err_resp).

IF lo_client->is_success( lv_ret_code ).
cl_demo_output=>display_data( ls_output-result-address-formatted_address ).
ELSE.
MESSAGE lv_err_text TYPE 'E'.
ENDIF.

* Close HTTP Connection
lo_client->close( ).

CATCH /goog/cx_sdk INTO DATA(lo_exception).
MESSAGE lo_exception->get_text( ) TYPE 'E'.
ENDTRY.

️Execute the program to see the corrected and completed address.





Conclusion


You now have access to a system hosted on Google Cloud Platform for evaluating the ABAP language, Fiori, and related tools. You also received your first introduction to ABAP SDK for Google Cloud.


The SAP trial system will allow you to explore more about ABAP SDK. At the time of writing this article the SAP trial license was valid till 19-Sep-2023. In case you want to renew the SAP trial license, you do so by requesting it here.



Clean Up


For clean up use the below commands to delete the VM, the firewall rules and the service account.



gcloud compute instances delete abap-trial-docker
gcloud compute firewall-rules delete sapmachine
gcloud iam service-accounts delete \
abap-sdk-dev@abap-sdk-poc.iam.gserviceaccount.com

Delete the project abap-sdk-poc using Manage Resources.










️Happy Learning and Happy Innovating !!!













4 Comments
dominik_ritter
Explorer
0 Kudos
Thank you very much!

I tried to use ABAP Platform Trial 1909 on my M1 MacBook Pro but with no success (using docker).

As time is always an issue and playing around is limited by it your effort is very much appreciated.

 

One more question: you refer to a Google Cloud Platform trial account.

Can you estimate the costs after the trial period for Google Cloud is over? For personal use it would be great to be able to continue using it afterwards but it depends on the costs (I do not have any experience with Google Cloud Platform).

Thank you.

 
ameya_2023
Participant
Hello Dominik,

In the above blog, the VM configuration used is : e2-highmem-2, OS & Disk: debian-12-bookworm, 200gb, Region: us-west4.

The combination of these parameter impacts the pricing.

The Google Cloud Pricing Calculator is the best available tool to estimate the cost.

Assuming that on average we will keep the compute engine running for 5 hours and 5 days a week, the calculator estimated a cost of ~33 USD per month for the above configuration.

Note that keeping the instance switched off saves on cost and you will be charged for the disk, but not for compute. Also changing location also changes the pricing. For e.g: Iowa(us-central1) would give us a ~4 USD of savings.

Here the pre-filled calculator link for reference.


Thank you.
venkateswaran_k
Active Contributor
0 Kudos

Hi

Thank you for the blog.

Kindly update me on followings:

a) In SM59 - what is the settings you did for Service connection

b) Im getting 403 Insufficient Privileges when I execute the program - What are all the privileges/permissions to be added in the Service Account

/GOOG/MSG : 403 - Request had insufficient authentication scopes.

 

Kindly update

Regards,

Venkat

ameya_2023
Participant
0 Kudos
Hi Venkat,

Thank you for your question!

The script in the blog creates a compute instance, with the required authentication scope at instance level for the authentication to work.

Since you are getting this error, I assume that you are configuring ABAP SDK in your own instance?

In either case, please validate the following 2 settings:

  1. Validate that the Access Scope in the instance level is set as "
    Allow full access to all Cloud APIs". Please refer to this troubleshooting guide for further reading.

  2. Validate that the Google Cloud Scope in Client Key configuration is set to "https://www.googleapis.com/auth/cloud-platform"









 

Regards,

Ameya
Labels in this area