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: 
jorapoga
Participant
5,820
ABAP trial powered by BTP (Business Technology Platform) is a free version, constantly updated to the latest capabilities and available to coding in ABAP for HANA. This SaaS (Software-as-a-Service) is managed and updated only by SAP and involves all cloud characteristics as multitenancy. SAP has the disposition to end or change the trial period, restricting some authorizations to the users and share ABAP artifacts simultaneously with multiple users.

By contrast, recently is available the SAP ABAP Platform 1909, which you can install as on-premise in your own machine (or in a private cloud) and can be managed only by yourself:

SAP ABAP Platform 1909 - Developer Edition AVAILABLE NOW

I think it is good to have access to both options because each one of them has its own interesting advantages as I mentioned. This article is about to get in a very easy and detailed manner to the first option: the ABAP trial powered by BTP and use it to create (as an example) some basic artifacts: package, transport request, and one class to solve a fun challenge (FizzBuzz). Perhaps you want to access that from your own machine through ADT, and get it all in a fast way.

What do we need?


The first that we need is an account in the BTP. If we don't have it, we can use this steps:

Get a Free Account on SAP BTP Trial

The second that we need is a recent version of ADT (ABAP Development Tools). To achieve this, We can install the latest version of eclipse and also ADT. Some information about the latest tools is here:

https://tools.hana.ondemand.com/

And Third, maybe the most important we need the desire to explore and learn about the latest ABAP statements available. So, this environment lets us practice. Without further ado, let's get started!

ABAP trial from BTP in action, step by step!


We are going to create an ABAP trial instance in the BTP and also connect with our own ADT. In the BTP we need to go to the "Trial Home":Click on the bottom "Enter Yor Trial Account":
Click on the tile of the provider of subaccount that in the example is AWS:Then we get an informative message about the update in the Services Marketplace page, and we click on the button "Go to Marketplace"Click on the tile "ABAP environment":On the right of the page, we get the bottom "Create" that lets us create an share instance of ABAP environment. This mean that we'll aren't the unique users:Then, we need to fill the instance name, for example, "ABAP_instance":In this window, we need fill the email used to create the BTP account between the quotes and without spaces:The next step is the resume of the instance we are creating and then we click on the button "create":We get a successfull message:To the right of page we need to create a service key that let us to connect own ADT with the ABAP trial instance:We need to fill the service key name, for example, "KEY_ABAP_TRIAL" and the click on botton "Create":Then, we can to see that one service key exist:After creating the service key, we need to download the file that contains the data to authentication. So, click in the selection "Download":A partial picture of the service key is shown here as example:Then, we need to open the Eclipse - ADT window and click on File->New->ABAP Cloud Project:Here we have two options to create the connection. For this tutorial we use "Service Key" and click on "Next":Click on the button "Import":And go to the file that was download previously:Click again on the button "Import" so to process the authentication in the cloud service:Click on the bottom "Open Logon Page in Browser":Then we get the successfully message about the logged session and we can close this page:We return to Eclipse's window and click on "Finish" button:Then, we have as default a share package "ZLOCAL" and it's possible add other packages to the project:For this example, the packages associate with BC_TRAVEL_MODEL training are added:We finally get our own ABAP (for HANA) project:We can explore and see the package that we had included:

Expandind the ZLOCAL package it's possible seeanother packages that other users had created before to us:If we go to the option SAP GUI, we get the message that SAP GUI view is not supported. Only Look & Feel is supported:Finally and as an example, we'll create one package, one class and by the way one Transport Request. So we open the contextual menu above the package "ZLOCAL" and click on New->ABAP Package: We fill the information required and click on "Next" button:We fill the description to Transport request and click on "Finish" button:Here we have the resume of the new package:Then, we navigate to the new package within the "ZLOCAL" package and we open the contextual menu -> New->ABAP ClassFilling the required information about the class and click on the "Next" button:We assign our Transport Request and Click on "Finish" button:Finally, we have our canvas for the new class:

With this tool we can build an approach to a fun challenge:

Puzzles in ABAP – Starting with FizzBuzz

Here, I share my approach and I invite you to build one:
CLASS zcl_fizzbuzz DEFINITION
PUBLIC
FINAL
CREATE PUBLIC.

PUBLIC SECTION.
INTERFACES if_oo_adt_classrun.
METHODS: thinking IMPORTING iv_num TYPE int2
RETURNING VALUE(rv_res_word) TYPE string.

PROTECTED SECTION.
PRIVATE SECTION.
METHODS: divider_exam IMPORTING iv_num TYPE int2
RETURNING VALUE(rv_word) TYPE string,
is_three_divider IMPORTING iV_num TYPE int2
RETURNING VALUE(rv_three) TYPE string,
is_five_divider IMPORTING iV_num TYPE int2
RETURNING VALUE(rv_five) TYPE string.
ENDCLASS.

CLASS zcl_fizzbuzz IMPLEMENTATION.
METHOD if_oo_adt_classrun~main.

DATA lv_count TYPE int2 VALUE 1.

DO 100 TIMES.
out->write( thinking( lv_count ) ).
lv_count += 1.
ENDDO.
ENDMETHOD.

METHOD is_three_divider.
DATA(lv_mod) = iV_num MOD 3.
IF lv_mod EQ 0.
rv_three = 'Fizz'.
ENDIF.
ENDMETHOD.

METHOD is_five_divider.
DATA(lv_mod) = iV_num MOD 5.
IF lv_mod EQ 0.
rv_five = 'Buzz'.
ENDIF.
ENDMETHOD.

METHOD divider_exam.
rv_word = is_three_divider( iv_num ) && is_five_divider( iv_num ).
ENDMETHOD.

METHOD thinking.
DATA(lv_result) = divider_exam( iv_num ).
IF lv_result IS NOT INITIAL.
rv_res_word = lv_result.
ELSE.
rv_res_word = iv_num.
ENDIF.
ENDMETHOD.
ENDCLASS.


The output looks just like this:

Summary.


Now, we can happily build for free whatever we want (only limited by SAP authorizations to our user) in the latest ABAP trial version available in the world and powered by BTP. Only the Look & Feel appearance is available and as a modern tool, some things are part of the past and do not exist in the present. For example, we can't create a program (like using SE38 transaction), and is not possible to use the SE11 transaction to create or to edit tables. Using old versions of Eclipse and ADT could involve errors, so it is highly recommended to use the latest versions too.

Enjoy and comment!

8 Comments
Labels in this area