Skip to Content
Technical Articles
Author's profile photo Leon Hassan

ABAP Development in VS Code

When I started learning ABAP I found myself getting increasingly frustrated with the speed at which the SAP GUI for Java responded and I looked for other options, this is how I found that you can mount your SAP system as a filesystem in VS Code. This blog will cover how you can get started with developing ABAP from VS Code.

Note: If you are not running Netweaver v7.51+ you will have to install a patch that can be found as part of the first plugin install options.

 

Getting the right plugins

VS Code is required for this tutorial along with the following plugins:

Once you have installed these plugins you can begin configuring your SAP System as a Remote FileSystem.

Note: In this blog I will only cover the configuration of the ABAP Remote FileSystem plugin. For further information on configuring the other plugins listed, please review the VS Code Marketplace/GitHub repositories.

Configuring your SAP system

In order to connect to your SAP system you will need to enable the ABAP Development Tools (ADT) ICF node, this is the same service that tools such as the SAP Hana Studio use.

Open your SAP GUI and connect to the target system, run the transaction SICF and then activate the ADT_SRV service as shown below.

This enables the service that allows code editors and IDEs to connect to your SAP system.

Configuring VS Code

Configuring this plugin to connect to your SAP system is straightforward, just open up your VS Code settings by pressing “Control/Command + ,” select “Extensions” in the menu and then in the “ABAP-FS” plugin, click on “Edit in settings.json”.

Then you need to update the below block of json to include your SAP system and user details. You can find the URL details by right-clicking the node in SICF on the SAP System (like when we turned the service on, earlier) and selecting “Test Service”.

This will open the ADT service and you can copy the top-level domain and port number from there.

"abapfs.remote": {
  "My SAP System label": {
    "url": "https://my-sap-system:8012/",
    "username": "my-username",
    "password": "my-password",
    "client": "920",
    "language": "EN",
    "allowSelfSigned": true
  }
}

Note: The usual rules apply… if you’re on an SAP system that’s only accessible on a specific network then you’ll still need to be on that network to connect!

This will create a system profile for you to connect to in VS Code, once you’ve saved your settings press F1 (the shortcut to launch a command) and start typing “ABAP” and you should see the “ABAPfs Connect to an ABAP system” command appear, click on this. Then select the profile you just set-up and you will connect to your system.

 

Writing ABAP in VS Code

Now that you’re connected to your SAP system, you can start creating your own reports, classes and structures in VS Code. To get started, make sure that you already have a transport open for your user, you cannot create transports from VS Code.

Transport Management

You can view transports assigned to you (or a colleague) by opening the SAP plugin in the sidebar as pictured below:

Creating an ABAP Object

To create an ABAP object in VS Code, you simply right-click somewhere in your workspace and select “ABAPfs Create object”.

You will then have to select one of the supported object types, these include Core Data Services (CDS) objects. Once you have selected the type of object you are creating, you must write a name and description for the object and then assign it to a package and transport.

Activating changes to an object

When you edit an ABAP object in VS Code, you don’t need to bounce back into the SAP GUI to activate your changes. You can do this in VS Code by clicking on the “activate” wand in the top right corner of your object editor.

The breadcrumbs along the top of your editor full support navigation to related objects just like any other language.

Using VS Code for ABAP day-to-day

Now you’re setup to write ABAP in VS Code! Congratulations and I hope you make use of VS Code’s “Zen Mode” (shortcut: Ctrl+K Z) to minimise distractions.

I will leave you with a word of warning, I don’t think that his setup is quite “production-ready” yet… The major issue I found using this for 5 weeks or so, is that your object-locking can be a little volatile and require a restart of VS Code and that there’s no SAP GUI integration like you have with Eclipse. That said, it’s still great for just sitting down and getting on with some code.

 

I hope you’ve enjoyed getting setup and that this makes you at least a little more productive, let me know how you get on in a comment.

Assigned tags

      43 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Zayidu Ansari
      Zayidu Ansari

      Thanks for this post Leon!

      That's really a nice plugin for all the ABAP'ers out there!

      Author's profile photo Frederik Hudak
      Frederik Hudak

      Welcome to the bleeding edge of ABAP development!

      A small note: the ABAP and CDS highlighting plugins do not need to be installed separately as they are dependencies of abap-remote-fs.

      By the way, did anyone try using remote fs with visual studio live share? If it works like I imagine, I think that by sharing the remote workspace, you could achieve live centralized development without the downside of locking files (I'm missing a friend with 15 minutes of spare time to try this out).

      Author's profile photo Akhilesh Vatupalli
      Akhilesh Vatupalli

      Hi Leon Hassan,

      Thanks a lot for your detailed blog! It was really helpful!

      After configuring everything as you mentioned, I am getting an error message stating 'Error: No ABAP server connection active for <SID>'. Could you please help me resolving this problem?

       

      Author's profile photo Leon Hassan
      Leon Hassan
      Blog Post Author

      Hi Akhilesh,

      Are ABAP Development Tools (ADT) enabled on the system?

      Author's profile photo Song Zhi Chong
      Song Zhi Chong

      Nice blog!

      I have test this way. If it can debug abap code,I will drop Eclipse .

      Author's profile photo Sérgio Fraga
      Sérgio Fraga

      Hello,

      This looks amazing! I'm trying to configure this but I'm having the following error:

      Failed to connect to <my-sap-label>:Error: Invalid protocol: <server_host>

      The system I'm trying to connect is reachable via Eclipse IDE.

      Thank you

      Sérgio

      Author's profile photo Marcello Urbani
      Marcello Urbani

      You need 2 things:

      • the SICF nodes above to be enabled
      • the system must be exposed over HTTP(s)
      • you need to use the same prefix you use for FIORI apps and similar

      Eclipse connects over RFC, so the connection requirements are quite different

      Author's profile photo Brandon Caulfield
      Brandon Caulfield

      Hi Marcello Urbani, Thanks for your guidance on this. I'm having a similar issue but I'm not 100% clear on point 2 and 3. Are you saying that VSCode has to run over HTTP(s)?

      Author's profile photo Marcello Urbani
      Marcello Urbani

      Yes. Eclipse uses RFC, which would be easy enough to support and would allow connecting using your existing sapgui configuration.

      But binary dependencies are forbidden in code extensions, and distributing the required rfc library is forbidden by sap

      Author's profile photo Marcello Urbani
      Marcello Urbani

      Thanks for the advertising and the helpful tutorial.

      Will probably add a link in my wiki

      Author's profile photo Harel Gilor
      Harel Gilor

      Hi ,

      after installing the plugin and configuring my system i got message: command  'abapfs.connect' not found .

       

      dose someone have this issue also ?

       

      Author's profile photo Marcello Urbani
      Marcello Urbani

      Did you restart vscode?

      Author's profile photo Neil Ward
      Neil Ward

      sweet ... love a bit of VSCode!!!

      stupid question, how do you do a data preview for a CDS view in VScode?

      Author's profile photo Marcello Urbani
      Marcello Urbani

      Not supported at the moment

      Author's profile photo Jini Tidalgo
      Jini Tidalgo

      Thank you for this informative blog! I am currently exploring how to use VS Code in ABAP and this post is very timely!

      My system is currently running on NW 7.3 and not 7.5. Can this be the reason why I don't see the ADT_SRV odata service in SICF? Can I create this service on my own?

      Author's profile photo Jerry Lin
      Jerry Lin

      Thanks for this great tutorial, vs code is more pure and cool env to code.

      One more thing to mention, when anyone encounter a error to connect ABAP system, I think it can be solved by change the setting.json file as bellow :

      {
      "abapfs.remote": {
        "My SAP System label": {
          "url": "https://my-sap-system:8012/",
          "username": "my-username",
          "password": "my-password",
          "client": "920",
          "language": "EN",
          "allowSelfSigned": true
        }
      }
      }

      Author's profile photo Jini Tidalgo
      Jini Tidalgo

      Hello Jerry,

      I also have the same configuration, and I was able to connect to my SAP system ($TMP folder is now visible), but there are no contents inside. When VSCode is trying to retrieve code, I am getting the 403: Forbidden error. Could you please point me to the right direction on how to resolve this?

      Author's profile photo Jerry Lin
      Jerry Lin

      Hi Jini,

      Yes, I am also facing same issue, still seeking solution, will update if any finding.

      Author's profile photo Marcello Urbani
      Marcello Urbani

      Can you access the url in a browser?

      Author's profile photo Dimitrios Mangonakis
      Dimitrios Mangonakis

      Hi there!

      Very nice feature!

      I'm getting the following error:

      Failed to connect to <my-sap-label> :Error: Unauthorized

      Connecting to <my-sap-label> via Eclipse IDE is possible.

      Any ideas?

      Thank you!

      Author's profile photo Timothy Muchena
      Timothy Muchena

      Hi

       

      I managed to connect by following your blog. Thank you.

      I am however concerned about hardcoding user login credentials. Is there a way to hide login credentials in the settings?

       

      Thank you

      Author's profile photo Leon Hassan
      Leon Hassan
      Blog Post Author

      You could set up an environments file that contains a variable for your username and password, this should work without having to install any additional tools

      Author's profile photo Florian Wiedemann
      Florian Wiedemann

      Hi

       

      will be single-sign-on supported in the future?

      Author's profile photo MaNu SebastiN
      MaNu SebastiN

      Hello Everyone,

      Had a chance to play around with this plugin, It is allowing me to surf the packages but while doing a save, the plugin throws me the following error. I understand that i will have to use zabapgit_full to gain a write access since my SAP version is less than 7.5. Can you anyone help me on the flow pls.

      Failed to save 'ZMANUPROG_CHAT_BOX.prog.abap': Unable to write file 'adt://npl/System Library/ZTESTINGPROG/Source Library/Programs/ZMANUPROG_CHAT_BOX/ZMANUPROG_CHAT_BOX.prog.abap' (TypeError: Cannot read property 'asx:values' of undefined)

      Thanks

      Manu

      Author's profile photo Marcello Urbani
      Marcello Urbani

      If before 7.5 you need a plugin linked in the plugin Readme.

      This error though looks like a bigger issue, might be that your system is just too old. I did manage on a 7.31 one.

      Author's profile photo Chad He
      Chad He

      Hi Leon,

      I configured the vs code as you said, and run normally, but I can't access the program that other user created in local or in package $tmp under other account.

      Should I configure some other things?

      Chad

      Author's profile photo Thang Bui
      Thang Bui

      Hi Leon,

      I configured the VS Code as you said, but VS Code can't connect to ABAP remote system. The follow is error message:

      Please let me know how to fix that error.

      Thanks,

      Thang

      Author's profile photo Leon Hassan
      Leon Hassan
      Blog Post Author

      If you can access the url via the browser, you'll have to open an issue with the developer of the plugin. If you can't access via the browser either, it is likely a permissions issue

      Author's profile photo Alex Glorie
      Alex Glorie

      Hi,

       

      I have the following error :

       

      How can I solve this ???

       

      Alex Glorie

      Author's profile photo Leon Hassan
      Leon Hassan
      Blog Post Author

      Have you tried clearing your browser cookies and data and revalidating your login in VS Code?

      Author's profile photo Senthil Subramanian
      Senthil Subramanian

      Hi,

      I am getting the error as below

      “Failed to connect to npl:Error: write EPROTO 1253944680:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:../../third_party/boringssl/src/ssl/tls_record.cc:242:”

      Please advice me to solve this?

      Note: I am able to access the same system using Eclipse.

      Thanks,

      SS

       

      Author's profile photo Senthil Subramanian
      Senthil Subramanian

      Restarted the VS editor and it worked.

      Author's profile photo Marcello Urbani
      Marcello Urbani

      Nice to see all these comments. But for technical support I would recommend you to use the github issues page

      https://github.com/marcellourbani/vscode_abap_remote_fs/issues

      Author's profile photo Brandon Caulfield
      Brandon Caulfield

      Hi Guys,

      I finally managed to get things up and running. I made a short video on the subject as well if anyone needs any more help.

      Youtube link – https://youtu.be/hzjNnRcYmqY

      Thanks again for the brilliant blog post!

      Author's profile photo Marcel Hippchen
      Marcel Hippchen

      Great post!

      Author's profile photo ARUN SHARMA
      ARUN SHARMA

      Nice Blog Post. Awesome. Leon but I faced one error in releasing Transport Task. Maybe the tool is not supporting all functionalities. But if I missed something then please guide me.

      Error%20in%20Transport%20Task%20release

      Error in Transport Task release

      Author's profile photo Ravi Singh
      Ravi Singh

      Great stuff. I was wondering if we can we add abap on cloud trial system to VS code ? 🙂

      Author's profile photo Aleksandar Mijailovic
      Aleksandar Mijailovic

      Hi Leon,

       

      cool stuff! Do you know if it is possible to do the same with the Business Application Studio (BAS), that is based on Eclipse Theia?

       

      Thx. & BR

      Aleks

      Author's profile photo Manikandan Rajasekaran
      Manikandan Rajasekaran

      Hi Leon,

      I connected to my system but cant find any files in #tmp and system library path, can yu please help ?

      Author's profile photo Seema Naharia
      Seema Naharia

      Hi,

      I can't see ADT_SRV in my system Netweaver 7.50.

      What could be the reason? Also I don't see ABAP-FS . I have installed plugin with name ABAP remote filesystem. Is it same ?

      Author's profile photo Sam M.
      Sam M.

      Hi ,

      After installing the plugin and configuring the extension i got message: command  'abapfs.connect' not found .

       

      dose someone have this issue also ?

      I've already restart vscode

      Author's profile photo Dominik Lepizh
      Dominik Lepizh

      got the same...

      two things could be the reason why it is working now:

      1. inherit permissions on filesystem - maybe installing extension did not set right permissions on filesystem
      2. there was a little message like "repair extension settings" or something similiar - unfortunately I did not remember

      After that it worked for me

      Author's profile photo Basant Singh
      Basant Singh

      Hi Leon Hassan,

      Great blog on ABAP in VS Code. I just have a small suggestion, can you please change

      My SAP System label

      to SAP System ID, and also add a little comment to tell that this is the ID of the system one is connecting to. Not sure if it matters that much but I did spent some nice hours on resolving an issue that was coming because I thought that My SAP System Label means a label I am giving to the system I am adding in the config file.

      Error: Failed to connect to XXX:Error: connect ETIMEDOUT XXXXXXXX