SAP Business Application Studio: Browser-Based ABAP Development

Category
DevOps
Published
Author
Johannes

SAP Business Application Studio (BAS) is SAP’s cloud-native development environment that runs entirely in the browser. With the ABAP development extension, you can develop ABAP Cloud applications without installing local software.

What is SAP Business Application Studio?

BAS is a web-based IDE based on Eclipse Theia and specifically optimized for SAP development:

FeatureDescription
Cloud-basedRuns entirely in the browser
Dev SpacesPre-configured development environments
ABAP SupportFull ABAP Cloud development
IntegratedConnection to BTP and S/4HANA Cloud

Advantages of BAS

  • No Installation: Only browser required
  • Use Anywhere: Work from any device
  • Always Current: SAP maintains the environment
  • Uniform: Same environment for all developers
  • Integrated: Native BTP integration

Setting Up a Dev Space

1. Access to BAS

To use BAS, you need:

  • SAP BTP Account (Trial or productive)
  • Subscription for SAP Business Application Studio
  • Authorization to create Dev Spaces

2. Create Dev Space

Steps to create an ABAP Dev Space:
1. Open SAP BTP Cockpit
2. Select Subaccount -> Services -> Instances and Subscriptions
3. Open SAP Business Application Studio
4. Click "Create Dev Space"
5. Enter name: "ABAP_Development"
6. Dev Space Type: Select "SAP ABAP Development"
7. Confirm "Create Dev Space"

Dev Space Types for ABAP

Dev Space TypeDescriptionUse Case
SAP ABAP DevelopmentABAP Cloud developmentBTP ABAP Environment
Full Stack Cloud ApplicationFiori + BackendFull-stack projects
SAP FioriUI developmentPure Fiori apps

3. Start Dev Space

1. Dev Space Status: "STOPPED"
2. Click Play button to start
3. Wait until Status: "RUNNING" (approx. 1-2 minutes)
4. Click "Open" to open IDE

Note: Dev Spaces stop automatically after inactivity (approx. 1 hour). Your work remains saved.

Create and Connect ABAP Project

Set Up System Connection

Before you can develop, you must establish a connection to your ABAP system.

Connection to BTP ABAP Environment:
1. View -> Command Palette (Ctrl+Shift+P)
2. Enter "ABAP: Create Service Instance"
3. Paste Service Key from BTP ABAP Environment
4. Assign connection name: "BTP_DEV"
5. Connection is tested and saved

Create Service Key

To establish the connection, you need a Service Key:

In BTP Cockpit:
1. Subaccount -> Cloud Foundry -> Spaces
2. Open Space -> Service Instances
3. Select ABAP Environment Instance
4. "Create" -> Service Key
5. Name: "BAS_Connection"
6. Copy Key data (JSON)

Create ABAP Project

New ABAP Cloud Project:
1. View -> Command Palette (Ctrl+Shift+P)
2. Enter "ABAP: Create Project"
3. Select system connection
4. Enter package: "ZRAP_DEMO"
5. Project name: "rap-demo"
6. Project is created and opened

Project Structure in BAS

rap-demo/
├── .abap/
│ └── service-binding.json
├── src/
│ └── zrap_demo/
│ ├── zcl_example_class.clas.abap
│ └── zif_example_interface.intf.abap
└── package.json

Important Features and Extensions

ABAP-Specific Features

FeatureShortcutDescription
Code CompletionCtrl+SpaceIntelligent completion
Quick FixCtrl+.Quick error fix
Go to DefinitionF12Jump to definition
Find ReferencesShift+F12Find usages
Rename SymbolF2Rename
Format DocumentShift+Alt+FFormat code

Syntax Highlighting and IntelliSense

BAS offers full ABAP syntax support:

CLASS zcl_bas_demo DEFINITION
PUBLIC FINAL
CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES if_oo_adt_classrun.
METHODS calculate_total
IMPORTING
it_items TYPE STANDARD TABLE
RETURNING
VALUE(rv_total) TYPE p.
ENDCLASS.
CLASS zcl_bas_demo IMPLEMENTATION.
METHOD if_oo_adt_classrun~main.
" BAS provides here:
" - Syntax Highlighting
" - IntelliSense for methods
" - Inline documentation
" - Real-time error marking
out->write( 'Hello from BAS!' ).
ENDMETHOD.
METHOD calculate_total.
" Code Completion shows table operations
LOOP AT it_items ASSIGNING FIELD-SYMBOL(<item>).
rv_total = rv_total + <item>-amount.
ENDLOOP.
ENDMETHOD.
ENDCLASS.

Integrated Tools

Terminal: Integrated terminal for Git and CLI tools

View -> Terminal (Ctrl+`)

Git Integration: Version control directly in BAS

Source Control View (Ctrl+Shift+G)
- Stage Changes
- Commit
- Push/Pull

Problems View: All errors and warnings at a glance

View -> Problems (Ctrl+Shift+M)

BAS comes with pre-installed extensions for ABAP:

ExtensionFunction
ABAP Language SupportSyntax, Completion, Navigation
ABAP CDS Language SupportCDS View development
SAP Fiori ToolsFiori Elements Generator
SAP HANA Database ExplorerDatabase access

Comparison to ADT/Eclipse

Feature Comparison

FeatureBASADT (Eclipse)
InstallationNone (Browser)Eclipse + Plugin
UpdatesAutomaticManual
PerformanceNetwork-dependentLocal, faster
Offline WorkNot possiblePartially possible
ABAP DebuggerAvailableFull
ABAP ProfilerLimitedFull
CDS DevelopmentYesYes
RAP DevelopmentYesYes
Git IntegrationNativeVia Plugin
Transport ManagementYesYes

When to Use BAS?

  • Cloud-First: BTP ABAP Environment development
  • Team Onboarding: Quick start without setup
  • Remote Work: Development from anywhere
  • Standardization: Uniform environment in team

When to Use ADT?

  • On-Premise: S/4HANA On-Premise systems
  • Performance: Large projects with many files
  • Offline: Limited internet connection
  • Special Tools: ABAP Profiler, Memory Inspector

Hybrid Usage

Both tools can be used in parallel:

Typical Workflow:
1. ADT for On-Premise S/4HANA development
2. BAS for BTP ABAP Environment
3. Git as common code base
4. Same code, different IDEs

Practical Examples

Example 1: Create RAP Business Object

Create a simple RAP Business Object in BAS:

" Step 1: Database Table
" Created via Command Palette: ABAP: New -> Database Table
@EndUserText.label : 'Travel Bookings'
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE
@AbapCatalog.tableCategory : #TRANSPARENT
@AbapCatalog.deliveryClass : #A
define table ztab_travel {
key client : abap.clnt not null;
key travel_id : abap.numc(8) not null;
description : abap.char(255);
begin_date : abap.dats;
end_date : abap.dats;
total_price : abap.curr(15,2);
currency_code : abap.cuky;
status : abap.char(1);
created_by : abap.uname;
created_at : timestampl;
last_changed_by : abap.uname;
last_changed_at : timestampl;
}
" Step 2: CDS View Entity
" Command Palette: ABAP: New -> Data Definition
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Travel Booking View'
define root view entity ZI_Travel
as select from ztab_travel
{
key travel_id as TravelId,
description as Description,
begin_date as BeginDate,
end_date as EndDate,
@Semantics.amount.currencyCode: 'CurrencyCode'
total_price as TotalPrice,
currency_code as CurrencyCode,
status as Status,
@Semantics.user.createdBy: true
created_by as CreatedBy,
@Semantics.systemDateTime.createdAt: true
created_at as CreatedAt,
@Semantics.user.lastChangedBy: true
last_changed_by as LastChangedBy,
@Semantics.systemDateTime.lastChangedAt: true
last_changed_at as LastChangedAt
}
" Step 3: Behavior Definition
" Command Palette: ABAP: New -> Behavior Definition
managed implementation in class zbp_i_travel unique;
strict ( 2 );
with draft;
define behavior for ZI_Travel alias Travel
persistent table ztab_travel
draft table ztab_d_travel
lock master total etag LastChangedAt
authorization master ( instance )
{
create;
update;
delete;
field ( numbering : managed, readonly ) TravelId;
field ( readonly ) CreatedBy, CreatedAt, LastChangedBy, LastChangedAt;
determination setDefaults on modify { create; }
validation validateDates on save { field BeginDate, EndDate; }
draft action Edit;
draft action Activate;
draft action Discard;
draft action Resume;
draft determine action Prepare;
mapping for ztab_travel corresponding
{
TravelId = travel_id;
Description = description;
BeginDate = begin_date;
EndDate = end_date;
TotalPrice = total_price;
CurrencyCode = currency_code;
Status = status;
CreatedBy = created_by;
CreatedAt = created_at;
LastChangedBy = last_changed_by;
LastChangedAt = last_changed_at;
}
}

Example 2: CDS View with Associations

" Consumption View with Annotations
" BAS provides auto-complete for all annotations
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Travel Consumption View'
@Metadata.allowExtensions: true
define root view entity ZC_Travel
provider contract transactional_query
as projection on ZI_Travel
{
@UI.facet: [
{ id: 'Travel',
purpose: #STANDARD,
type: #IDENTIFICATION_REFERENCE,
label: 'Travel',
position: 10 }
]
@UI.lineItem: [{ position: 10, importance: #HIGH }]
@UI.identification: [{ position: 10 }]
key TravelId,
@UI.lineItem: [{ position: 20, importance: #HIGH }]
@UI.identification: [{ position: 20 }]
Description,
@UI.lineItem: [{ position: 30 }]
@UI.identification: [{ position: 30 }]
BeginDate,
@UI.lineItem: [{ position: 40 }]
@UI.identification: [{ position: 40 }]
EndDate,
@UI.lineItem: [{ position: 50 }]
@UI.identification: [{ position: 50 }]
TotalPrice,
CurrencyCode,
@UI.lineItem: [{ position: 60, criticality: 'StatusCriticality' }]
Status,
/* Virtual Element for Status Criticality */
case Status
when 'O' then 2 " Open - Yellow
when 'A' then 3 " Approved - Green
when 'R' then 1 " Rejected - Red
else 0
end as StatusCriticality,
/* Admin fields */
CreatedBy,
CreatedAt,
LastChangedBy,
LastChangedAt
}

Example 3: Behavior Implementation with Debugging

CLASS lhc_travel DEFINITION INHERITING FROM cl_abap_behavior_handler.
PRIVATE SECTION.
METHODS setDefaults FOR DETERMINE ON MODIFY
IMPORTING keys FOR Travel~setDefaults.
METHODS validateDates FOR VALIDATE ON SAVE
IMPORTING keys FOR Travel~validateDates.
ENDCLASS.
CLASS lhc_travel IMPLEMENTATION.
METHOD setDefaults.
" Read entities for passed keys
READ ENTITIES OF ZI_Travel IN LOCAL MODE
ENTITY Travel
FIELDS ( TravelId )
WITH CORRESPONDING #( keys )
RESULT DATA(travels).
" Set default values for new entries
MODIFY ENTITIES OF ZI_Travel IN LOCAL MODE
ENTITY Travel
UPDATE
FIELDS ( Status CurrencyCode )
WITH VALUE #( FOR travel IN travels
( %tky = travel-%tky
Status = 'O' " Open
CurrencyCode = 'EUR' ) )
REPORTED DATA(reported).
" In BAS: Set breakpoint by clicking left of line number
" Start debugging via Run -> Start Debugging
ENDMETHOD.
METHOD validateDates.
" Validation: BeginDate must be before EndDate
READ ENTITIES OF ZI_Travel IN LOCAL MODE
ENTITY Travel
FIELDS ( BeginDate EndDate )
WITH CORRESPONDING #( keys )
RESULT DATA(travels).
LOOP AT travels ASSIGNING FIELD-SYMBOL(<travel>).
IF <travel>-BeginDate > <travel>-EndDate.
APPEND VALUE #(
%tky = <travel>-%tky
%msg = new_message_with_text(
severity = if_abap_behv_message=>severity-error
text = 'Begin date must be before end date'
)
%element-BeginDate = if_abap_behv=>mk-on
%element-EndDate = if_abap_behv=>mk-on
) TO reported-travel.
ENDIF.
ENDLOOP.
ENDMETHOD.
ENDCLASS.

Debugging in BAS:

1. Set breakpoint: Click left of line number
2. Debug configuration: Run -> Add Configuration
3. Select ABAP System
4. Start app and execute action
5. Debugger stops at breakpoint
6. Variables View shows variable values
7. Step Over (F10), Step Into (F11), Continue (F5)

Tips and Best Practices

Optimize Performance

1. Only load needed packages
-> Smaller projects = faster performance
2. Restart Dev Space regularly
-> Cleans memory and cache
3. Close unnecessary tabs
-> Reduces memory usage
4. Use stable internet connection
-> BAS is network-dependent

Keyboard Shortcuts

ActionWindows/LinuxMac
Command PaletteCtrl+Shift+PCmd+Shift+P
Quick OpenCtrl+PCmd+P
Go to DefinitionF12F12
Find All ReferencesShift+F12Shift+F12
Rename SymbolF2F2
Format DocumentShift+Alt+FShift+Option+F
Toggle TerminalCtrl+`Cmd+`
SaveCtrl+SCmd+S
ActivateCtrl+F3Cmd+F3

Workspace Organization

Recommended workspace structure:
workspace/
├── project-rap-demo/ # RAP project
├── project-fiori-app/ # Fiori App
├── project-api-integration/ # API Integration
└── .vscode/
└── settings.json # Workspace settings

Troubleshooting

Common Problems

Dev Space won’t start:

Solution:
1. Clear browser cache
2. Delete Dev Space and recreate
3. Check BTP subscription

Connection to ABAP system faulty:

Solution:
1. Create new Service Key
2. Recreate connection in BAS
3. Check network/firewall settings

Slow performance:

Solution:
1. Disable unnecessary extensions
2. Reduce project size
3. Isolate browser tab
4. Restart Dev Space

Code completion not working:

Solution:
1. Check ABAP Language Server status (bottom right)
2. Check connection to ABAP system
3. Reload project: Command Palette -> Developer: Reload Window

Conclusion

SAP Business Application Studio provides a modern, cloud-native development environment for ABAP Cloud:

  • Zero Installation: Ready to go immediately in browser
  • Full ABAP Support: CDS, RAP, Debugging
  • Integrated Tools: Git, Terminal, Extensions
  • Cloud-optimized: Native BTP integration

For BTP ABAP Environment and cloud-based development, BAS is the first choice. For on-premise systems and advanced debugging features, ADT remains the more comprehensive option.

Further Resources

Further Reading