Dear SAPLearners, in this blog post we will learn to create an ABAP program in SAP Cloud Platform ABAP environment.
Before you start, make sure you have
- Created ABAP trial instance in SAP Cloud Platform
- Created an ABAP Cloud Project using Eclipse ABAP Development Tools
I know you are very much exited to write your first ABAP program/class in SAP Cloud Platform and also got few questions in your mind. Lets get answers to those first
What will be the IDE which i am going to use with ABAP in Cloud system?
The answer is Eclipse ABAP Development Tools
Can i create all ABAP repository objects like in on-premise in ABAP cloud system?
No, you cannot.
Below is the list of ABAP Repository Objects you can create in ABAP system in cloud.
- Data Element
- Database Table
- Dynamic Cache
- Lock Object
- Table Type
2. Message Classes
3. ABAP Package
4. Source Code Library
- ABAP Class
- ABAP Function Group
- ABAP Function Module
- ABAP Interface
6. Core Data Services (CDS)
- Data Definition
- Access Control
- Metadata Extension
- Behavior Definition
- HTTP Service
8. Cloud Communication Management
- Communication Scenario
9. Cloud Identity and Access Management
- Business Catalog
- Identity & Access Management(IAM) App
- Restriction Field
- Restriction Type
10. Business Services
- Service Definition
- Service Consumption Model
- Service Binding
- Authorization Field
- Authorization Object
- Default Authorization Values
The above list may change and new repository objects get added in new releases.
Now that you have understanding of what you can do in cloud ABAP system. Lets create demo ABAP application.
#Create ABAP Package
1. Right-click on ZLOCAL package and choose New -> ABAP Package from the context menu
2. Provide Name and Description of the ABAP package and click Next
3. Hit Next
4. Choose the Transport Request and hit Finish.
5. A new ABAP Package is created. Navigate to the package, right-click and choose New -> ABAP Class.
6. Provide Name and Description of the ABAP class and click Next
7. Select the transport request and hit Finish
8. A new ABAP class is created, copy and paste the below code
CLASS zcloud_demo DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. INTERFACES if_oo_adt_classrun. PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. CLASS zcloud_demo IMPLEMENTATION. METHOD if_oo_adt_classrun~main. out->write('Hello ABAP in Cloud!'). ENDMETHOD. ENDCLASS.
In above code interface IF_OO_ADT_CLASSRUN provides a light-weight solution for executing an ABAP program without launching the integrated SAP GUI.
9. Save and activate code changes.
10. Finally run the ABAP class to see the output in ABAP Console.
Congrats!!! you have successfully created an ABAP program in SAP Cloud Platform ABAP Environment.
Please feel free to comment and let us know your feedback. Subscribe for more updates.
if you liked it, please share it! Thanks!