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:
| Feature | Description |
|---|---|
| Cloud-based | Runs entirely in the browser |
| Dev Spaces | Pre-configured development environments |
| ABAP Support | Full ABAP Cloud development |
| Integrated | Connection 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 Cockpit2. Select Subaccount -> Services -> Instances and Subscriptions3. Open SAP Business Application Studio4. 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 Type | Description | Use Case |
|---|---|---|
| SAP ABAP Development | ABAP Cloud development | BTP ABAP Environment |
| Full Stack Cloud Application | Fiori + Backend | Full-stack projects |
| SAP Fiori | UI development | Pure Fiori apps |
3. Start Dev Space
1. Dev Space Status: "STOPPED"2. Click Play button to start3. Wait until Status: "RUNNING" (approx. 1-2 minutes)4. Click "Open" to open IDENote: 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 Environment4. Assign connection name: "BTP_DEV"5. Connection is tested and savedCreate Service Key
To establish the connection, you need a Service Key:
In BTP Cockpit:
1. Subaccount -> Cloud Foundry -> Spaces2. Open Space -> Service Instances3. Select ABAP Environment Instance4. "Create" -> Service Key5. 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 connection4. Enter package: "ZRAP_DEMO"5. Project name: "rap-demo"6. Project is created and openedProject Structure in BAS
rap-demo/├── .abap/│ └── service-binding.json├── src/│ └── zrap_demo/│ ├── zcl_example_class.clas.abap│ └── zif_example_interface.intf.abap└── package.jsonImportant Features and Extensions
ABAP-Specific Features
| Feature | Shortcut | Description |
|---|---|---|
| Code Completion | Ctrl+Space | Intelligent completion |
| Quick Fix | Ctrl+. | Quick error fix |
| Go to Definition | F12 | Jump to definition |
| Find References | Shift+F12 | Find usages |
| Rename Symbol | F2 | Rename |
| Format Document | Shift+Alt+F | Format 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/PullProblems View: All errors and warnings at a glance
View -> Problems (Ctrl+Shift+M)Recommended Extensions
BAS comes with pre-installed extensions for ABAP:
| Extension | Function |
|---|---|
| ABAP Language Support | Syntax, Completion, Navigation |
| ABAP CDS Language Support | CDS View development |
| SAP Fiori Tools | Fiori Elements Generator |
| SAP HANA Database Explorer | Database access |
Comparison to ADT/Eclipse
Feature Comparison
| Feature | BAS | ADT (Eclipse) |
|---|---|---|
| Installation | None (Browser) | Eclipse + Plugin |
| Updates | Automatic | Manual |
| Performance | Network-dependent | Local, faster |
| Offline Work | Not possible | Partially possible |
| ABAP Debugger | Available | Full |
| ABAP Profiler | Limited | Full |
| CDS Development | Yes | Yes |
| RAP Development | Yes | Yes |
| Git Integration | Native | Via Plugin |
| Transport Management | Yes | Yes |
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 development2. BAS for BTP ABAP Environment3. Git as common code base4. Same code, different IDEsPractical 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 : #Adefine 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 Travelpersistent table ztab_traveldraft table ztab_d_travellock master total etag LastChangedAtauthorization 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 number2. Debug configuration: Run -> Add Configuration3. Select ABAP System4. Start app and execute action5. Debugger stops at breakpoint6. Variables View shows variable values7. 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-dependentKeyboard Shortcuts
| Action | Windows/Linux | Mac |
|---|---|---|
| Command Palette | Ctrl+Shift+P | Cmd+Shift+P |
| Quick Open | Ctrl+P | Cmd+P |
| Go to Definition | F12 | F12 |
| Find All References | Shift+F12 | Shift+F12 |
| Rename Symbol | F2 | F2 |
| Format Document | Shift+Alt+F | Shift+Option+F |
| Toggle Terminal | Ctrl+` | Cmd+` |
| Save | Ctrl+S | Cmd+S |
| Activate | Ctrl+F3 | Cmd+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 settingsTroubleshooting
Common Problems
Dev Space won’t start:
Solution:1. Clear browser cache2. Delete Dev Space and recreate3. Check BTP subscriptionConnection to ABAP system faulty:
Solution:1. Create new Service Key2. Recreate connection in BAS3. Check network/firewall settingsSlow performance:
Solution:1. Disable unnecessary extensions2. Reduce project size3. Isolate browser tab4. Restart Dev SpaceCode completion not working:
Solution:1. Check ABAP Language Server status (bottom right)2. Check connection to ABAP system3. Reload project: Command Palette -> Developer: Reload WindowConclusion
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.