Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
leonh
Participant
82,135
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.
59 Comments
zayidu
Participant
Thanks for this post Leon!

That's really a nice plugin for all the ABAP'ers out there!
former_member566586
Active Participant
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).
0 Kudos
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?

 
leonh
Participant
0 Kudos

Hi Akhilesh,

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

Nice blog!

I have test this way. If it can debug abap code,I will drop Eclipse .
sdfraga
Participant
0 Kudos
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
MarcelloUrbani
Active Contributor
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
MarcelloUrbani
Active Contributor
Thanks for the advertising and the helpful tutorial.

Will probably add a link in my wiki
herzelhaimharel_gilor
Participant
Hi ,

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

 

dose someone have this issue also ?

 
smith_john
Active Participant
0 Kudos
sweet ... love a bit of VSCode!!!

stupid question, how do you do a data preview for a CDS view in VScode?
jtidalgo
Explorer
0 Kudos
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?
Jerry_Lin
Product and Topic Expert
Product and Topic Expert
0 Kudos

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
}
}
}

MarcelloUrbani
Active Contributor
0 Kudos
Did you restart vscode?
jtidalgo
Explorer
0 Kudos
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?
Jerry_Lin
Product and Topic Expert
Product and Topic Expert
Hi Jini,

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



mangonakis
Member
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!
TimMuchena
Participant
0 Kudos
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
0 Kudos
Hi

 

will be single-sign-on supported in the future?
ManuSebastin
Explorer
0 Kudos
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
Chad_He
Participant
0 Kudos
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
0 Kudos
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
leonh
Participant
0 Kudos
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
leonh
Participant
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
alex_glorie
Discoverer
0 Kudos
Hi,

 

I have the following error :

 



How can I solve this ???

 

Alex Glorie
senthilsubram
Explorer
0 Kudos

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

 

senthilsubram
Explorer
0 Kudos
Restarted the VS editor and it worked.
z_brandon
Active Participant
0 Kudos
Hi murbani, 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)?
MarcelloUrbani
Active Contributor
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
MarcelloUrbani
Active Contributor
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.
MarcelloUrbani
Active Contributor
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
MarcelloUrbani
Active Contributor
0 Kudos
Not supported at the moment
MarcelloUrbani
Active Contributor
0 Kudos
Can you access the url in a browser?
leonh
Participant
0 Kudos
Have you tried clearing your browser cookies and data and revalidating your login in VS Code?
z_brandon
Active Participant

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!

marcelhippchen
Explorer
Great post!
former_member288398
Discoverer
0 Kudos
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 in Transport Task release

ravi_rajput
Participant
Great stuff. I was wondering if we can we add abap on cloud trial system to VS code ? 🙂
former_member596519
Participant
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
mrajasekarana
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Leon,

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

ssharma28
Participant
0 Kudos

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 ?

former_member300076
Participant
0 Kudos
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
basantmhr
Participant
0 Kudos

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

 

dominik_lepizh
Discoverer
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
douglas_linkup
Explorer
Nice post Leon. I tried at in to VS Code at Mac (OS X) and worked fine.
Very cool 😉

If someone doesn't want to write the password in the json file, you can leave the password as a empty string. Later when you connect to the system, you'll be asked to type in your password.
leonh
Participant
0 Kudos
yes, you can do this really easily now. it's covered in my book: https://www.sap-press.com/visual-studio-code-for-sap_5605/
leonh
Participant
0 Kudos
using ENV files is also an option, just a local file on your computer that you can point the configuration to 🙂
leonh
Participant
0 Kudos
it might be a network issue where there are so many objects that it is taking a very long time to load, leave it in the background and see if that sorts the issue. If not, raise an issue on Marcello's github in an earlier comment 🙂
leonh
Participant
0 Kudos
hey aleks, it's unfortunately not possible as the extension is not compatible. however. you can use the in-built tools to access an ABAP BTP trial, as you do with vs code using the fiori extension pack.

 

it might be worth reaching out to Marcello, the extension author for VS Code and asking if it could be made compatible with BAS 🙂
proferisrenana
Explorer
0 Kudos

I think I need this too.

In the eclipse I connect easly, but VS Code I got error.

Labels in this area